]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoSimplify table generation.
Michael Tuexen [Mon, 15 Jan 2018 08:32:49 +0000 (08:32 +0000)]
Simplify table generation.

6 years agoMove the pmap-specific code in copyinout.c that gets pointers to userland
Nathan Whitehorn [Mon, 15 Jan 2018 06:46:33 +0000 (06:46 +0000)]
Move the pmap-specific code in copyinout.c that gets pointers to userland
buffers into a new pmap-module function pmap_map_user_ptr() that can
be implemented by the respective modules. This is required to implement
non-segment-based AIM-ish MMU systems such as the radix-tree page tables
introduced by POWER ISA 3.0 and present on POWER9.

Reviewed by: jhibbits

6 years agostand/fdt: don't send clobbered FDT to the kernel
Kyle Evans [Mon, 15 Jan 2018 05:00:26 +0000 (05:00 +0000)]
stand/fdt: don't send clobbered FDT to the kernel

If fdt_overlay_apply fails at some stage to apply the overlay to the base,
both the base and overlay may be in an inconsistent state (some fixups
applied, some phandles adjusted, some symbols merged). These can be bad for
a number of reasons, to include user frustration if some fixups applied and
not others. Fail a little safer by making a clean copy of the base FDT for
every overlay that we can simply discard if things go awry.

This also allows us the luxury of simply discarding overlays if we hit some
kind of memory limit or if they're malformed and extremely large for some
reason. We'll now leave a nice error message indicating that some overlays
could not be applied due to size restrictions and we apply what we can.

I note that our overlay implementation has some flaws that might still leave
your system in an unbootable state even if an overlay applies correctly;
please exercise caution in using overlays until we can swap it out for
libfdt's implementation.

Tested on: BananaPi-M3 (armv7)
Tested on: Pine64 (aarch64)
Differential Revision: https://reviews.freebsd.org/D13709

6 years agoThe vmm(4) man page is conditional on MK_BHYVE.
Peter Grehan [Mon, 15 Jan 2018 04:52:12 +0000 (04:52 +0000)]
The vmm(4) man page is conditional on MK_BHYVE.

Submitted by: kevlo

6 years agoallwinner: mmc: Multiple improvement
Emmanuel Vadot [Sun, 14 Jan 2018 22:05:29 +0000 (22:05 +0000)]
allwinner: mmc: Multiple improvement

  - Add a per compatible configuration struct
  - Not all SoC uses the same size for DMA transfert, add this into the
    configuration data
  - Use new timing mode for some SoC (A64 mmc)
  - Auto calibrate clock for A64 mmc/emmc
  - A64 mmc controller need masking of data0
  - Add support for vmmc/vqmmc regulator
  - Add more capabilities, r/w speed is better for eMMC
  - MMC_CAP_SIGNALING_180 gives weird result so do not enable it for now.
  - Add new register documented in H3/A64 user manual

Tested-On: Pine64-LTS (A64), eMMC still doesn't work
Tested-On: A64-Olinuxino (A64), sd and eMMC are working
Tested-On: NanoPi Neo Plus2 (H5), sd and eMMC are working
Tested-On: OrangePi PC2 (H5), sd only (no eMMC)
Tested-On: OrangePi One (H3), sd only (no eMMC)
Tested-On: BananaPi M2 (A31s), sd only (no eMMC)

6 years agoAdd metadata_csum feature support.
Fedor Uporov [Sun, 14 Jan 2018 20:46:39 +0000 (20:46 +0000)]
Add metadata_csum feature support.

Reviewed by:   pfg (mentor)
Approved by:   pfg (mentor)
MFC after:     6 months

Differential Revision:    https://reviews.freebsd.org/D13810

6 years agoAdd a rudimentary PWM driver for the RaspberryPi.
Poul-Henning Kamp [Sun, 14 Jan 2018 20:36:21 +0000 (20:36 +0000)]
Add a rudimentary PWM driver for the RaspberryPi.

Control is through sysctl, only GPIO12 supported.

bootverbose creates sysctls for direct mangling of relevant registers.

Only tested on RPI2

6 years agovmm(4): add to Makefile
Eitan Adler [Sun, 14 Jan 2018 20:30:58 +0000 (20:30 +0000)]
vmm(4): add to Makefile

r326281 added the vmm man page, but it needs to be installed.

PR: 205705

6 years agoRemove tst.zonename.d from the list of expected failures.
Mark Johnston [Sun, 14 Jan 2018 17:56:19 +0000 (17:56 +0000)]
Remove tst.zonename.d from the list of expected failures.

X-MFC with: r327888

6 years agoUse the thread's ucred struct when fetching jid or jailname.
Mark Johnston [Sun, 14 Jan 2018 17:55:40 +0000 (17:55 +0000)]
Use the thread's ucred struct when fetching jid or jailname.

Reported by: mjg
X-MFC with: r327888

6 years agoAdd RTC clock conversions for BCD values, with non-panic validation.
Ian Lepore [Sun, 14 Jan 2018 17:01:37 +0000 (17:01 +0000)]
Add RTC clock conversions for BCD values, with non-panic validation.

RTC clock hardware frequently uses BCD numbers.  Currently the low-level
bcd2bin() and bin2bcd() functions will KASSERT if given out-of-range BCD
values.  Every RTC driver must implement its own code for validating the
unreliable data coming from the hardware to avoid a potential kernel panic.

This change introduces two new functions, clock_bcd_to_ts() and
clock_ts_to_bcd().  The former validates its inputs and returns EINVAL if any
values are out of range. The latter guarantees the returned data will be
valid BCD in a known format (4-digit years, etc).

A new bcd_clocktime structure is used with the new functions.  It is similar
to the original clocktime structure, but defines the fields holding BCD
values as uint8_t (uint16_t for year), and adds a PM flag for handling hours
using AM/PM mode.

PR: 224813
Differential Revision: https://reviews.freebsd.org/D13730 (no reviewers)

6 years agoReport CG checksum mismatches. These errors are non-fatal. The
Warner Losh [Sun, 14 Jan 2018 16:55:14 +0000 (16:55 +0000)]
Report CG checksum mismatches. These errors are non-fatal. The
previous behavior is preserved (the CG checksum is fixed). We're just
noisy about it now.

Reviewed by: kirk@
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D13884

6 years agoEnable VIMAGE in i386 GENERIC (revert r327840)
Ed Maste [Sun, 14 Jan 2018 16:04:51 +0000 (16:04 +0000)]
Enable VIMAGE in i386 GENERIC (revert r327840)

We've switched back to ld.bfd on i386 for now.

PR: 225077
Sponsored by: The FreeBSD Foundation

6 years agoRemove trailing whitespace.
Bjoern A. Zeeb [Sun, 14 Jan 2018 15:01:25 +0000 (15:01 +0000)]
Remove trailing whitespace.
No functional change.

6 years agoImprove support for sctp_generic_recvmsg() and sctp_generic_sendmsg()
Michael Tuexen [Sun, 14 Jan 2018 14:33:22 +0000 (14:33 +0000)]
Improve support for sctp_generic_recvmsg() and sctp_generic_sendmsg()
and add support for sctp_generic_sendmsg_iov().

Handle the struct iovec argument and the struct sctp_sndrcvinfo
arguments.

6 years agoAdd a function is decode the sinfo_flags of struct sctp_sndrcvinfo.
Michael Tuexen [Sun, 14 Jan 2018 14:27:42 +0000 (14:27 +0000)]
Add a function is decode the sinfo_flags of struct sctp_sndrcvinfo.

6 years agoAdd STAC and CLAC instructions wrappers.
Konstantin Belousov [Sun, 14 Jan 2018 12:39:50 +0000 (12:39 +0000)]
Add STAC and CLAC instructions wrappers.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D13838

6 years agoEnumerate and print Intel CPU features for Speculative Execution Side
Konstantin Belousov [Sun, 14 Jan 2018 12:36:23 +0000 (12:36 +0000)]
Enumerate and print Intel CPU features for Speculative Execution Side
Channel Mitigations.

The definitions are taken from the document 336996-001.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoWhen re-evaluating cpu_features, also re-print CPU identification.
Konstantin Belousov [Sun, 14 Jan 2018 12:33:05 +0000 (12:33 +0000)]
When re-evaluating cpu_features, also re-print CPU identification.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agoAdd suppor for the supported PR-SCTP policies.
Michael Tuexen [Sun, 14 Jan 2018 12:08:41 +0000 (12:08 +0000)]
Add suppor for the supported PR-SCTP policies.

6 years agoMark the iovec parameters of writev() and readv() as IN and OUT.
Michael Tuexen [Sun, 14 Jan 2018 09:51:25 +0000 (09:51 +0000)]
Mark the iovec parameters of writev() and readv() as IN and OUT.
This makes truss work on readv() as expected.

6 years agoSync VirtIO IDs with Linux
Bryan Venteicher [Sun, 14 Jan 2018 06:03:40 +0000 (06:03 +0000)]
Sync VirtIO IDs with Linux

6 years agoMove VM_NUMA_ALLOC and DEVICE_NUMA under the single global config option NUMA.
Jeff Roberson [Sun, 14 Jan 2018 03:36:03 +0000 (03:36 +0000)]
Move VM_NUMA_ALLOC and DEVICE_NUMA under the single global config option NUMA.

Sponsored by: Netflix, Dell/EMC Isilon
Discussed with: jhb

6 years agoFix build after r327949.
Pedro F. Giffuni [Sun, 14 Jan 2018 00:31:34 +0000 (00:31 +0000)]
Fix build after r327949.

Reported by: Cy Schubert

6 years agoUpgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to
Dimitry Andric [Sun, 14 Jan 2018 00:08:34 +0000 (00:08 +0000)]
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

6 years agoAdd support for Quectel EC25.
Nick Hibma [Sat, 13 Jan 2018 23:31:21 +0000 (23:31 +0000)]
Add support for Quectel EC25.

Submitted by: Samuel Crookes
MFC after: 3 days

6 years agoDocument places we assume that physical memory is direct-mapped at zero by
Nathan Whitehorn [Sat, 13 Jan 2018 23:14:53 +0000 (23:14 +0000)]
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.

6 years agodev: make some use of mallocarray(9).
Pedro F. Giffuni [Sat, 13 Jan 2018 22:30:30 +0000 (22:30 +0000)]
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.

6 years agoFix possible panic when creating VirtIO console dev aliases
Bryan Venteicher [Sat, 13 Jan 2018 21:39:46 +0000 (21:39 +0000)]
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

6 years agolimits(1): also bump .Dd...
Eitan Adler [Sat, 13 Jan 2018 21:37:14 +0000 (21:37 +0000)]
limits(1): also bump .Dd...

PR: 225147
MFC After: 1 week

6 years agolimits(1): fix grammar
Eitan Adler [Sat, 13 Jan 2018 21:36:39 +0000 (21:36 +0000)]
limits(1): fix grammar

Submitted by: yuri
PR: 225147
MFC After: 1 week

6 years agoInclude only the headers needed
Justin Hibbits [Sat, 13 Jan 2018 21:10:42 +0000 (21:10 +0000)]
Include only the headers needed

The extra headers came through evolution of the file.

6 years agotimed: slave is an infinite loop, mark it as such
Eitan Adler [Sat, 13 Jan 2018 20:35:32 +0000 (20:35 +0000)]
timed: slave is an infinite loop, mark it as such

6 years agozstd: Use mallocarray(9) for calloc macro.
Pedro F. Giffuni [Sat, 13 Jan 2018 19:02:51 +0000 (19:02 +0000)]
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.

6 years agoAdd SPDX tag to aw_syscon(4)
Kyle Evans [Sat, 13 Jan 2018 19:02:08 +0000 (19:02 +0000)]
Add SPDX tag to aw_syscon(4)

6 years agoAdd SPDX tags to syscon bits, correct inconsistency in Copyright line.
Kyle Evans [Sat, 13 Jan 2018 19:00:41 +0000 (19:00 +0000)]
Add SPDX tags to syscon bits, correct inconsistency in Copyright line.

6 years agoRevert r327934 to fix the log message.
Pedro F. Giffuni [Sat, 13 Jan 2018 18:56:42 +0000 (18:56 +0000)]
Revert r327934 to fix the log message.

6 years agoIntroduce aw_syscon(4) for earlier attachment
Kyle Evans [Sat, 13 Jan 2018 18:46:31 +0000 (18:46 +0000)]
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

6 years agoAdd SPDX identifier for the example license.
Pedro F. Giffuni [Sat, 13 Jan 2018 18:28:30 +0000 (18:28 +0000)]
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

6 years agozstd: Use memalloc(9) for calloc macro.
Pedro F. Giffuni [Sat, 13 Jan 2018 18:09:09 +0000 (18:09 +0000)]
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.

6 years agoamd64: Add a 48-bit MAXADDR constant
Conrad Meyer [Sat, 13 Jan 2018 17:55:22 +0000 (17:55 +0000)]
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

6 years agoMerge ^/head r327886 through r327930.
Dimitry Andric [Sat, 13 Jan 2018 17:52:55 +0000 (17:52 +0000)]
Merge ^/head r327886 through r327930.

6 years agoPull in r314499 from upstream clang trunk (by Daniel Marjamäki):
Dimitry Andric [Sat, 13 Jan 2018 17:47:34 +0000 (17:47 +0000)]
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

6 years agoUse the correct revision specifier (EXT_CSD revision rather than
Marius Strobl [Sat, 13 Jan 2018 17:36:11 +0000 (17:36 +0000)]
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

6 years agoAdd SPDX identifier to header
Justin Hibbits [Sat, 13 Jan 2018 17:25:48 +0000 (17:25 +0000)]
Add SPDX identifier to header

Reported by: pfg

6 years agoFix a bug introduced in r327355; in mmcsd_ioctl_cmd() when ensuring
Marius Strobl [Sat, 13 Jan 2018 16:32:09 +0000 (16:32 +0000)]
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.

6 years agoAdd IDs for Nuvoton NCT6793/NCT6795.
Alexander Motin [Sat, 13 Jan 2018 16:31:07 +0000 (16:31 +0000)]
Add IDs for Nuvoton NCT6793/NCT6795.

MFC after: 2 weeks

6 years agoFix a bug introduced in r327339; at the point in time re-tuning is
Marius Strobl [Sat, 13 Jan 2018 16:21:13 +0000 (16:21 +0000)]
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.

6 years agodwmmc_hisi: Fix build when option MMCCAM is defined
Emmanuel Vadot [Sat, 13 Jan 2018 14:10:45 +0000 (14:10 +0000)]
dwmmc_hisi: Fix build when option MMCCAM is defined

6 years agoFix a typo introduced in r327919.
Michael Tuexen [Sat, 13 Jan 2018 14:10:45 +0000 (14:10 +0000)]
Fix a typo introduced in r327919.

6 years agoAdd support for readv() and writev() to truss.
Michael Tuexen [Sat, 13 Jan 2018 13:59:35 +0000 (13:59 +0000)]
Add support for readv() and writev() to truss.

Sponsored by: Netflix, Inc.

6 years agoBuild llvm-extract with -lz, and add a few objects to liblldb, both of
Dimitry Andric [Sat, 13 Jan 2018 13:53:05 +0000 (13:53 +0000)]
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>

6 years agoAdd sysctl debug.kdb.stack_overflow to conveniently test kernel
Konstantin Belousov [Sat, 13 Jan 2018 11:59:49 +0000 (11:59 +0000)]
Add sysctl debug.kdb.stack_overflow to conveniently test kernel
handling of the kstack overflow.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agosx: retry hard shared unlock just like in r327905 for rwlocks
Mateusz Guzik [Sat, 13 Jan 2018 09:26:24 +0000 (09:26 +0000)]
sx: retry hard shared unlock just like in r327905 for rwlocks

6 years agoRemove redundant variable.
Cy Schubert [Sat, 13 Jan 2018 08:28:46 +0000 (08:28 +0000)]
Remove redundant variable.

MFC after: 1 week

6 years agoThough this block of code is not used by FreeBSD, correct a call to
Cy Schubert [Sat, 13 Jan 2018 08:16:10 +0000 (08:16 +0000)]
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

6 years agoReplace the PMC class struct copy with an explicit memcpy()
Justin Hibbits [Sat, 13 Jan 2018 04:53:04 +0000 (04:53 +0000)]
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

6 years agoRevert r327823, Enable ld.lld as bootstrap linker by default on i386
Ed Maste [Sat, 13 Jan 2018 04:00:55 +0000 (04:00 +0000)]
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

6 years agoChase removal of FDT fixup code on PowerPC in r327907.
Nathan Whitehorn [Sat, 13 Jan 2018 03:09:05 +0000 (03:09 +0000)]
Chase removal of FDT fixup code on PowerPC in r327907.

6 years agoRemove fdt fixups for powerpc, they are no longer needed.
Justin Hibbits [Sat, 13 Jan 2018 02:56:09 +0000 (02:56 +0000)]
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

6 years agoEnable L2 cache on supported PowerQUICC and QorIQ platforms
Justin Hibbits [Sat, 13 Jan 2018 01:36:37 +0000 (01:36 +0000)]
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.

6 years agorwlock: try regular read unlock even in the hard path
Mateusz Guzik [Sat, 13 Jan 2018 00:05:31 +0000 (00:05 +0000)]
rwlock: try regular read unlock even in the hard path

Saves on turnstile trips if the lock got more readers.

6 years agocxgbe/iw_cxgbe: Remove duplicates to fix compilation with recent gcc.
Navdeep Parhar [Sat, 13 Jan 2018 00:04:11 +0000 (00:04 +0000)]
cxgbe/iw_cxgbe: Remove duplicates to fix compilation with recent gcc.

6 years agoFix compile error from r327900
Jeff Roberson [Fri, 12 Jan 2018 23:41:12 +0000 (23:41 +0000)]
Fix compile error from r327900

6 years agoAdd support for NUMA domains to bus dma tags. This causes all memory
Jeff Roberson [Fri, 12 Jan 2018 23:34:16 +0000 (23:34 +0000)]
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

6 years agoImplement NUMA support in uma(9) and malloc(9). Allocations from specific
Jeff Roberson [Fri, 12 Jan 2018 23:25:05 +0000 (23:25 +0000)]
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

6 years agoImplement NUMA policy for kmem_*(9). This maintains compatibility with
Jeff Roberson [Fri, 12 Jan 2018 23:13:55 +0000 (23:13 +0000)]
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

6 years agolibalias: small memory allocation cleanups.
Pedro F. Giffuni [Fri, 12 Jan 2018 23:12:30 +0000 (23:12 +0000)]
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

6 years agoRegenerate auto-generated files
Jeff Roberson [Fri, 12 Jan 2018 23:06:35 +0000 (23:06 +0000)]
Regenerate auto-generated files

6 years agoAdd files for r327895
Jeff Roberson [Fri, 12 Jan 2018 22:57:57 +0000 (22:57 +0000)]
Add files for r327895

Implement 'domainset', a cpuset based NUMA policy mechanism.  This allows
userspace to control NUMA policy administratively and programmatically.

Implement domainset based iterators in the page layer.

Remove the now legacy numa_* syscalls.

Cleanup some header polution created by having seq.h in proc.h.

Reviewed by:  markj, kib
Discussed with:       alc
Tested by:    pho
Sponsored by: Netflix, Dell/EMC Isilon
Differential Revision:        https://reviews.freebsd.org/D13403

6 years agoImplement 'domainset', a cpuset based NUMA policy mechanism. This allows
Jeff Roberson [Fri, 12 Jan 2018 22:48:23 +0000 (22:48 +0000)]
Implement 'domainset', a cpuset based NUMA policy mechanism.  This allows
userspace to control NUMA policy administratively and programmatically.

Implement domainset based iterators in the page layer.

Remove the now legacy numa_* syscalls.

Cleanup some header polution created by having seq.h in proc.h.

Reviewed by: markj, kib
Discussed with: alc
Tested by: pho
Sponsored by: Netflix, Dell/EMC Isilon
Differential Revision: https://reviews.freebsd.org/D13403

6 years agoEnsure MK_LDD for bootstrap-tools matches MK_LLD_BOOTSTRAP.
Bryan Drewery [Fri, 12 Jan 2018 20:40:27 +0000 (20:40 +0000)]
Ensure MK_LDD for bootstrap-tools matches MK_LLD_BOOTSTRAP.

This fixes building libllvmminimal with MK_LLD support when WITHOUT_LLD
or WITHOUT_TOOLCHAIN are set, which are install flags not build tools
flags.

Reported by: sbruno
Tested by: sbruno
Sponsored by: Dell EMC

6 years agoallwinner/a83t_padconf: Rename "emac" function to "gmac" as per upstream DTS
Kyle Evans [Fri, 12 Jan 2018 20:35:27 +0000 (20:35 +0000)]
allwinner/a83t_padconf: Rename "emac" function to "gmac" as per upstream DTS

Although these should have been 'emac', upstream DTS is going with using
'gmac' as the function name for the emac RGMII pins. Rename here to
accommodate.

emac support for the a83t should come in with the 4.16 DTS update, in
another couple of months.

6 years agobsdinstall: disable SUJ by default
Ed Maste [Fri, 12 Jan 2018 20:25:57 +0000 (20:25 +0000)]
bsdinstall: disable SUJ by default

SUJ + cg checksums produce spurious warnings after an unclean shutdown
(e.g. a crash).  For now disable SUJ for UFS installs so installing from
a FreeBSD 12 snapshot results in a usable filesystem, until this can be
fixed.

PR: 225110
Submitted by: Arshan Khanifar <arshankhanifar gmail.com>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13890

6 years agoRevert r280909 "unwind-d2 build workaround for arm64"
Ed Maste [Fri, 12 Jan 2018 20:03:24 +0000 (20:03 +0000)]
Revert r280909 "unwind-d2 build workaround for arm64"

We no longer try to build unwind-dw2.c on arm64 so no need for this
workaround.

Sponsored by: The FreeBSD Foundation

6 years agoAdd "jid" and "jailname" variables to DTrace.
Mark Johnston [Fri, 12 Jan 2018 19:59:46 +0000 (19:59 +0000)]
Add "jid" and "jailname" variables to DTrace.

These return the jail ID and jail name for the traced process,
respectively, and are analogous to "zonename" on Solaris/illumos.
"zonename" is now aliased to "jailname".

Also add some stress tests for the new variables.

Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
Reviewed by: dteske (previous version)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D13877

6 years agoMerge ^/head r327624 through r327885.
Dimitry Andric [Fri, 12 Jan 2018 18:23:35 +0000 (18:23 +0000)]
Merge ^/head r327624 through r327885.

6 years agoPull in r321994 from upstream llvm trunk (by Alexey Bataev):
Dimitry Andric [Fri, 12 Jan 2018 18:19:14 +0000 (18:19 +0000)]
Pull in r321994 from upstream llvm trunk (by Alexey Bataev):

  [SLP] Fix PR35777: Incorrect handling of aggregate values.

  Summary:
  Fixes the bug with incorrect handling of InsertValue|InsertElement
  instrucions in SLP vectorizer. Currently, we may use incorrect
  ExtractElement instructions as the operands of the original
  InsertValue|InsertElement instructions.

  Reviewers: mkuper, hfinkel, RKSimon, spatel

  Subscribers: llvm-commits

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

This should fix "Invalid InsertValueInst operands!" errors when building
certain parts of editors/libreoffice.

Reported by: jbeich
PR: 225086

6 years agoPull in r322264 from upstream lld trunk (by me):
Dimitry Andric [Fri, 12 Jan 2018 18:16:51 +0000 (18:16 +0000)]
Pull in r322264 from upstream lld trunk (by me):

  Fix thread race between SectionPiece's OutputOff and Live members

  Summary:
  As reported in bug 35788, rL316280 reintroduces a race between two
  members of SectionPiece, which share the same 64 bit memory location.

  To fix the race, check the hash before checking the Live member, as
  suggested by Rafael.

  Reviewers: ruiu, rafael

  Reviewed By: ruiu

  Subscribers: smeenai, emaste, llvm-commits

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

6 years agoCorrect a couple of typos.
Jens Schweikhardt [Fri, 12 Jan 2018 17:33:20 +0000 (17:33 +0000)]
Correct a couple of typos.

6 years agoAllow this file to be included
Warner Losh [Fri, 12 Jan 2018 17:21:48 +0000 (17:21 +0000)]
Allow this file to be included

Use simple "foo" rather than "${.CURDIR}/foo" to include Makefile.fat
since the former works when including this Makefile from else
where. Also, use full path from ${BOOTSRC} to the FAT templates for
similar reasons. It doesn't change anything in base FreeBSD, but
allows us to have a custom boot1.efi more easily (though that will be
short-lived for us, it may also be helpful for others).

Sponsored by: Netflix

6 years agoMove getsecs() prototype to stand.h from net.h so it can be used
Warner Losh [Fri, 12 Jan 2018 16:28:51 +0000 (16:28 +0000)]
Move getsecs() prototype to stand.h from net.h so it can be used
everywhere.

Sponsored by: Netflix

6 years agoReport the boot order and where we are in that boot order. Add
Warner Losh [Fri, 12 Jan 2018 15:30:56 +0000 (15:30 +0000)]
Report the boot order and where we are in that boot order.  Add
ability to create a boot1.efi that always fails for testing purposes
and failover scenarios.

Sponsored by: Netflix

6 years agoAdd GUID for UEFI boot manager variables.
Warner Losh [Fri, 12 Jan 2018 15:30:52 +0000 (15:30 +0000)]
Add GUID for UEFI boot manager variables.

Sponsoered by: Netflix

6 years agoFix error in determining the next available boot slot.
Warner Losh [Fri, 12 Jan 2018 15:30:48 +0000 (15:30 +0000)]
Fix error in determining the next available boot slot.

Sponsored by: Netflix

6 years agoWorkaround Spectre Variant 2 on arm64.
Andrew Turner [Fri, 12 Jan 2018 14:01:38 +0000 (14:01 +0000)]
Workaround Spectre Variant 2 on arm64.

We need to handle two cases:

1. One process attacking another process.
2. A process attacking the kernel.

For the first case we clear the branch predictor state on context switch
between different processes. For the second we do this when taking an
instruction abort on a non-userspace address.

To clear the branch predictor state a per-CPU function pointer has been
added. This is set by the new cpu errata code based on if the CPU is
known to be affected.

On Cortex-A57, A72, A73, and A75 we call into the PSCI firmware as newer
versions of this will clear the branch predictor state for us.

It has been reported the ThunderX is unaffected, however the ThunderX2 is
vulnerable. The Qualcomm Falkor core is also affected. As FreeBSD doesn't
yet run on the ThunderX2 or Falkor no workaround is included for these CPUs.

MFC after: 3 days
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D13812

6 years agomtx: use fcmpset to cover setting MTX_CONTESTED
Mateusz Guzik [Fri, 12 Jan 2018 13:40:50 +0000 (13:40 +0000)]
mtx: use fcmpset to cover setting MTX_CONTESTED

6 years agovfs: tidy up vdrop
Mateusz Guzik [Fri, 12 Jan 2018 13:39:02 +0000 (13:39 +0000)]
vfs: tidy up vdrop

Skip vfs_refcount_release_if_not_last if the interlock is held and just
go straight to refcount_release.

While here do cosmetic rearrangement of _vhold to better show it contains
equivalent behaviour.

6 years agoPowerNV: update OPAL driver
Wojciech Macek [Fri, 12 Jan 2018 12:14:52 +0000 (12:14 +0000)]
PowerNV: update OPAL driver

Update OPAL driver with:
- better console support
- proper AP configuration
- enhanced IRQ/OFW mapping
- RTC support

Created by:            Nathan Whitehorn <nwhitehorn@freebsd.org>
Submitted by:          Wojciech Macek <wma@semihalf.com>
Sponsored by:          FreeBSD Foundation

6 years ago- Fix `make` in sys/modules
Li-Wen Hsu [Fri, 12 Jan 2018 12:14:14 +0000 (12:14 +0000)]
- Fix `make` in sys/modules

Reviewed by: gonzo, landonf, br
Differential Revision: https://reviews.freebsd.org/D13856

6 years agoPowerNV: initial support for PCIe host controller
Wojciech Macek [Fri, 12 Jan 2018 07:55:49 +0000 (07:55 +0000)]
PowerNV: initial support for PCIe host controller

Provide initial support for PCIe host controller as
well as for IOMMU mapping. This commit allows proper
bus enumeration, but does not guarantee DMA operations
are working.

Created by:            Nathan Whitehorn <nwhitehorn@freebsd.org>
Submitted by:          Wojciech Macek <wma@semihalf.com>
Sponsored by:          FreeBSD Foundation

6 years agoaesni(4): Quiesce spurious GCC 6.3.0 -Wmaybe-uninitialized warnings
Conrad Meyer [Fri, 12 Jan 2018 06:40:58 +0000 (06:40 +0000)]
aesni(4): Quiesce spurious GCC 6.3.0 -Wmaybe-uninitialized warnings

Always initialize some variables GCC warns about.  They are initialized in
every path where they are used, but GCC doesn't know that.

Sponsored by: Dell EMC Isilon

6 years agosys/dev/e1000: fix uses of 1 << 31
Eitan Adler [Fri, 12 Jan 2018 06:37:53 +0000 (06:37 +0000)]
sys/dev/e1000: fix uses of 1 << 31

Reviewed by: erj (D13858)

6 years agosys/dev/mlx[45]: fix uses of 1 << 31
Eitan Adler [Fri, 12 Jan 2018 06:36:44 +0000 (06:36 +0000)]
sys/dev/mlx[45]: fix uses of 1 << 31

Reviewed by: kib (D13858)

6 years agodhclient(8): add missing include
Alan Somers [Fri, 12 Jan 2018 04:26:40 +0000 (04:26 +0000)]
dhclient(8): add missing include

stdbool is technically needed, though we can get away without it due to
header pollution.

MFC after: 3 days

6 years agoANSIfy function definitions in sys/vm/
Ed Maste [Fri, 12 Jan 2018 03:50:44 +0000 (03:50 +0000)]
ANSIfy function definitions in sys/vm/

6 years agoAdd a hack to disable AUTO_OBJ for 'old style' kernel builds.
Bryan Drewery [Fri, 12 Jan 2018 01:09:41 +0000 (01:09 +0000)]
Add a hack to disable AUTO_OBJ for 'old style' kernel builds.

Another solution would be to extend the Makefile.sys.inc idea, or a .no_obj
file, to more places but I would rather keep that limited to the top-level
build for now to not impact performance (statting a file in every make call)
or to bring unintended side-effects.

Reported by: jhb, imp
Sponsored by: Dell EMC Isilon

6 years agoCache LINKER_FEATURES to fix the wrong ones being used.
Bryan Drewery [Fri, 12 Jan 2018 01:09:30 +0000 (01:09 +0000)]
Cache LINKER_FEATURES to fix the wrong ones being used.

Submitted by: Dan McGregor <dan.mcgregor@usask.ca>

6 years agoBuild systrace_freebsd32 on arm64.
Michael Tuexen [Thu, 11 Jan 2018 21:17:05 +0000 (21:17 +0000)]
Build systrace_freebsd32 on arm64.

Since r326501 which added COMPAT_FREEBSD32 to the GENERIC config for arm64,
we need to build systrace_freebsd32, since dtraceall depends on it.

Reviewed by: ed, gnn
Differential Revision: https://reviews.freebsd.org/D13670

6 years agoPull in r316581 from upstream llvm trunk (by John Baldwin):
Dimitry Andric [Thu, 11 Jan 2018 21:12:23 +0000 (21:12 +0000)]
Pull in r316581 from upstream llvm trunk (by John Baldwin):

  Don't try to use a non-existent header on FreeBSD/mips.

  Reviewers: dim

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

Requested by: jhb
MFC after: 3 days