Commit Graph

247836 Commits

Author SHA1 Message Date
kib
1d4c150060 When re-evaluating cpu_features, also re-print CPU identification.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2018-01-14 12:33:05 +00:00
tuexen
5c419e6ba6 Add suppor for the supported PR-SCTP policies. 2018-01-14 12:08:41 +00:00
tuexen
445752d5e4 Mark the iovec parameters of writev() and readv() as IN and OUT.
This makes truss work on readv() as expected.
2018-01-14 09:51:25 +00:00
bryanv
adfee38d71 Sync VirtIO IDs with Linux 2018-01-14 06:03:40 +00:00
jeff
cc3d6a3370 Move VM_NUMA_ALLOC and DEVICE_NUMA under the single global config option NUMA.
Sponsored by:	Netflix, Dell/EMC Isilon
Discussed with:	jhb
2018-01-14 03:36:03 +00:00
pfg
9026a8ae0a Fix build after r327949.
Reported by:	Cy Schubert
2018-01-14 00:31:34 +00:00
dim
7dcc49151a Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
6.0.0 (branches/release_60 r321788).  Upstream has branched for the
6.0.0 release, which should be in about 6 weeks.  Please report bugs and
regressions, so we can get them into the release.

Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11
support to build; see UPDATING for more information.

MFC after:	3 months
2018-01-14 00:08:34 +00:00
n_hibma
22f32bbbfb Add support for Quectel EC25.
Submitted by:	Samuel Crookes
MFC after:	3 days
2018-01-13 23:31:21 +00:00
nwhitehorn
f92ca972e6 Document places we assume that physical memory is direct-mapped at zero by
using a new macro PHYS_TO_DMAP, which deliberately has the same name as the
equivalent macro on amd64. This also sets the stage for moving the direct
map to another base address.
2018-01-13 23:14:53 +00:00
pfg
86c1e7ab7b dev: make some use of mallocarray(9).
Focus on code where we are doing multiplications within malloc(9). None of
these is likely to overflow, however the change is still useful as some
static checkers can benefit from the allocation attributes we use for
mallocarray.

This initial sweep only covers malloc(9) calls with M_NOWAIT. No good
reason but I started doing the changes before r327796 and at that time it
was convenient to make sure the sorrounding code could handle NULL values.
2018-01-13 22:30:30 +00:00
bryanv
c4995464a5 Fix possible panic when creating VirtIO console dev aliases
Since we have no control over the name, the MAKEDEV_CHECKNAME flag must be
used to return an error on an invalid (to devfs) name instead of panicing.

r305900 that originally added this feature also introduced a few other bugs:
  - Proper locking not performed
  - Theoretically broke the expectation that the control event buffer would
    not span more than one pages, but did not update the CTASSERT that was
    in place to prevent this. However, since the struct virtio_console_control
    and the bulk buffer together were quite small, this could not have happened.

Also workaround an QEMU VirtIO spec violation in that it includes the NUL
terminator in the buffer length when the spec says it is not included.

PR:		223531
MFC after:	1 week
2018-01-13 21:39:46 +00:00
eadler
2fbd0010bc limits(1): also bump .Dd...
PR:		225147
MFC After:	1 week
2018-01-13 21:37:14 +00:00
eadler
4af255a20c limits(1): fix grammar
Submitted by:	yuri
PR:		225147
MFC After:	1 week
2018-01-13 21:36:39 +00:00
jhibbits
1c6e6537d4 Include only the headers needed
The extra headers came through evolution of the file.
2018-01-13 21:10:42 +00:00
eadler
0d72950788 timed: slave is an infinite loop, mark it as such 2018-01-13 20:35:32 +00:00
pfg
405bd7b74e zstd: Use mallocarray(9) for calloc macro.
This is in contrib code but since we only have mallocarray(9) in current
we will not upstream this.

This effectively brings back r327934, which was reverted to correct the
log message.
2018-01-13 19:02:51 +00:00
kevans
9265bdb095 Add SPDX tag to aw_syscon(4) 2018-01-13 19:02:08 +00:00
kevans
58786377c9 Add SPDX tags to syscon bits, correct inconsistency in Copyright line. 2018-01-13 19:00:41 +00:00
pfg
75aad63139 Revert r327934 to fix the log message. 2018-01-13 18:56:42 +00:00
kevans
85798e7755 Introduce aw_syscon(4) for earlier attachment
Attaching syscon_generic earlier than BUS_PASS_DEFAULT makes it more
difficult for specific syscon drivers to attach to the syscon node and to
get ordering right. Further discussion yielded the following set of
decisions:

- Move syscon_generic to BUS_PASS_DEFAULT
- If a platform needs a syscon with different attach order or probe
behavior, it should subclass syscon_generic and match on the SoC specific
compat string
- When we come across a need for a syscon that attaches earlier but only
specifies compatible = "syscon", we should create a syscon_exclusive driver
that provides generic access but probes earlier and only matches if "syscon"
is the only compatible. Such fdt nodes do exist in the wild right now, but
we don't really use them at the moment.

Additionally:

- Any syscon provider that has needs any more complex than a spinlock solely
for syscon access and a single memory resource should subclass syscon
directly rather than attempting to subclass syscon_generic or add complexity
to it. syscon_generic's attach/detach methods may be made public should the
need arise to subclass it with additional attach/detach behavior.

We introduce aw_syscon(4) that just subclasses syscon_generic but probes
earlier to meet our requirements for if_awg and implements #2 above for this
specific situation. It currently only matches a64/a83t/h3 since these are
the only platforms that really need it at the time being.

Discussed with:	ian
Reviewed by:	manu, andrew, bcr (manpages, content unchanged since review)
Differential Revision:	https://reviews.freebsd.org/D13793
2018-01-13 18:46:31 +00:00
pfg
e846fb33ba Add SPDX identifier for the example license.
For project files we should use the -FreeBSD prefix but for this example
assume it is going to be used for some general purpose.

Submitted by:	kevlo
2018-01-13 18:28:30 +00:00
pfg
d78380c6a4 zstd: Use memalloc(9) for calloc macro.
This is in contrib code but since we only have memalloc(9) in current we
will not upstream this.
2018-01-13 18:09:09 +00:00
cem
d1b1083a47 amd64: Add a 48-bit MAXADDR constant
Some devices (e.g., ccp(4) -- to be committed) can only access the low 48
bits of physical memory.

Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
2018-01-13 17:55:22 +00:00
dim
d91380862c Merge ^/head r327886 through r327930. 2018-01-13 17:52:55 +00:00
dim
a0e4c0ae9f Pull in r314499 from upstream clang trunk (by Daniel Marjamäki):
[Sema] Suppress warnings for C's zero initializer

  Patch by S. Gilles!

  Differential Revision: https://reviews.llvm.org/D28148

Pull in r314838 from upstream clang trunk (by Richard Smith):

  Suppress -Wmissing-braces warning when aggregate-initializing a
  struct with a single field that is itself an aggregate.

  In C++, such initialization of std::array<T, N> types is guaranteed
  to work by the standard, is completely idiomatic, and the "suggested"
  alternative from Clang was technically invalid.

Together, these suppress unneeded "suggest braces around initialization
of subobject" warnings for C++11 initializer lists.

MFC after:	3 days
2018-01-13 17:47:34 +00:00
marius
983127b606 Use the correct revision specifier (EXT_CSD revision rather than
system specification version) for deciding whether the EXT_CSD
register includes the EXT_CSD_GEN_CMD6_TIME field.

Submitted by:	Masanobu SAITOH
2018-01-13 17:36:11 +00:00
jhibbits
afa3517cfd Add SPDX identifier to header
Reported by:	pfg
2018-01-13 17:25:48 +00:00
marius
a80489fe28 Fix a bug introduced in r327355; in mmcsd_ioctl_cmd() when ensuring
that userland doesn't switch partitions on its own, compare against
the partition mmcsd_ioctl_cmd() is going to switch to (based on the
device node used) rather than the currently selected partition.
2018-01-13 16:32:09 +00:00
mav
f9c58dac63 Add IDs for Nuvoton NCT6793/NCT6795.
MFC after:	2 weeks
2018-01-13 16:31:07 +00:00
marius
3d1d28421e Fix a bug introduced in r327339; at the point in time re-tuning is
executed, the interrupt aggregation code might have disabled the
SDHCI_INT_DMA_END and/or SDHCI_INT_RESPONSE bits in slot->intmask
and the SDHCI_SIGNAL_ENABLE register respectively. So when restoring
the interrupt masks based on the previous contents of slot->intmask
in sdhci_exec_tuning(), ensure that the SDHCI_INT_ENABLE register
doesn't lose these two bits.
While at it and in the spirit of r327339, let sdhci_tuning_intmask()
set the tuning error and re-tuning interrupt bits based on the
SDHCI_TUNING_ENABLED rather than the SDHCI_TUNING_SUPPORTED flag
being set, i. e. only when (re-)tuning is actually used. Currently,
this changes makes no net difference, though.
2018-01-13 16:21:13 +00:00
manu
e6c2708832 dwmmc_hisi: Fix build when option MMCCAM is defined 2018-01-13 14:10:45 +00:00
tuexen
9dae44108c Fix a typo introduced in r327919. 2018-01-13 14:10:45 +00:00
tuexen
32d05bc76d Add support for readv() and writev() to truss.
Sponsored by:	Netflix, Inc.
2018-01-13 13:59:35 +00:00
dim
5473ed2089 Build llvm-extract with -lz, and add a few objects to liblldb, both of
which turn out to be needed when you don't use -ffunction-sections.

Reported by:	Shawn Webb <shawn.webb@hardenedbsd.org>
2018-01-13 13:53:05 +00:00
kib
78904c70bb Add sysctl debug.kdb.stack_overflow to conveniently test kernel
handling of the kstack overflow.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2018-01-13 11:59:49 +00:00
mjg
00f02d857e sx: retry hard shared unlock just like in r327905 for rwlocks 2018-01-13 09:26:24 +00:00
cy
e79b07245c Remove redundant variable.
MFC after:	1 week
2018-01-13 08:28:46 +00:00
cy
297cff2ef7 Though this block of code is not used by FreeBSD, correct a call to
sprintf() with a macro call to SNPRINTF similar to other calls to
SNPRINTF within this same block.

MFC after:	1 week
2018-01-13 08:16:10 +00:00
jhibbits
00a6946205 Replace the PMC class struct copy with an explicit memcpy()
This should be effectively a nop for all archs, but for some reason the codegen
difference on the PowerPC 970 is such that the struct assignment doesn't work
(unless a printf() using one of the elements in the copied struct follows it),
while the memcpy() succeeds.  On all archs the memcpy() should be expanded to an
inline copy, since the copy is bounded to ~16 bytes.

MFC after:	3 weeks
2018-01-13 04:53:04 +00:00
emaste
cd92c080b1 Revert r327823, Enable ld.lld as bootstrap linker by default on i386
There's a report of some regression in ports.  Revert for now for an
exp run for this change in isolation (previous lld exp run also included
switching the linker used for ports to lld).

Also revert the src.conf.5 regeneration in r327824.

Reported by:	antoine
Sponsored by:	The FreeBSD Foundation
2018-01-13 04:00:55 +00:00
nwhitehorn
845db5ffdf Chase removal of FDT fixup code on PowerPC in r327907. 2018-01-13 03:09:05 +00:00
jhibbits
57c3e69c29 Remove fdt fixups for powerpc, they are no longer needed.
If a fixup really is needed, it should be fixed in u-boot, not in FreeBSD.

Suggested by:	nwhitehorn
2018-01-13 02:56:09 +00:00
jhibbits
958d24c6d5 Enable L2 cache on supported PowerQUICC and QorIQ platforms
Some PowerQUICC and QorIQ platforms have a L2 cache managed via the
memory-mapped configuration registers, and appear as a node in the device
tree.  This adds basic support to enable the cache.
2018-01-13 01:36:37 +00:00
mjg
6f29c630d9 rwlock: try regular read unlock even in the hard path
Saves on turnstile trips if the lock got more readers.
2018-01-13 00:05:31 +00:00
np
4bda86983b cxgbe/iw_cxgbe: Remove duplicates to fix compilation with recent gcc. 2018-01-13 00:04:11 +00:00
jeff
56eac8c497 Fix compile error from r327900 2018-01-12 23:41:12 +00:00
jeff
bc9177f3a2 Add support for NUMA domains to bus dma tags. This causes all memory
allocated with a tag to come from the specified domain if it meets the
other constraints provided by the tag.  Automatically create a tag at
the root of each bus specifying the domain local to that bus if
available.

Reviewed by:	jhb, kib
Tested by:	pho
Sponsored by:	Netflix, Dell/EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D13545
2018-01-12 23:34:16 +00:00
jeff
f375b4dd66 Implement NUMA support in uma(9) and malloc(9). Allocations from specific
domains can be done by the _domain() API variants.  UMA also supports a
first-touch policy via the NUMA zone flag.

The slab layer is now segregated by VM domains and is precise.  It handles
iteration for round-robin directly.  The per-cpu cache layer remains
a mix of domains according to where memory is allocated and freed.  Well
behaved clients can achieve perfect locality with no performance penalty.

The direct domain allocation functions have to visit the slab layer and
so require per-zone locks which come at some expense.

Reviewed by:	Attilio (a slightly older version)
Tested by:	pho
Sponsored by:	Netflix, Dell/EMC Isilon
2018-01-12 23:25:05 +00:00
jeff
e7c9f84113 Implement NUMA policy for kmem_*(9). This maintains compatibility with
reservations by giving each memory domain its own KVA space in vmem that
is naturally aligned on superpage boundaries.

Reviewed by:	alc, markj, kib  (some objections)
Sponsored by:	Netflix, Dell/EMC Isilon
Tested by;	pho
Differential Revision:	https://reviews.freebsd.org/D13289
2018-01-12 23:13:55 +00:00
pfg
f48ea5d543 libalias: small memory allocation cleanups.
Make the calloc wrappers behave as expected by using mallocarray.
It is rather weird that the malloc wrappers also zeroes the memory: update
a comment to reflect at least two cases where it is expected.

Reviewed by:	tuexen
2018-01-12 23:12:30 +00:00