]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMerge OpenSSL 1.1.1a.
jkim [Tue, 20 Nov 2018 21:10:04 +0000 (21:10 +0000)]
Merge OpenSSL 1.1.1a.

5 years agocsu: use BSD-1-clause license on csu files
emaste [Tue, 20 Nov 2018 21:04:20 +0000 (21:04 +0000)]
csu: use BSD-1-clause license on csu files

Copyright on these files is held by kib@ and/or the Foundation, and both
agree to this change.

Approved by: kib

5 years agoAdd NT_FREEBSD_FEATURE_CTL ELF note to csu
emaste [Tue, 20 Nov 2018 20:59:49 +0000 (20:59 +0000)]
Add NT_FREEBSD_FEATURE_CTL ELF note to csu

This note will be used to allow binaries to opt out of, or in to,
upcoming vulnerability mitigation and other features.  It is not yet
connected but being added now to facilitate testing and ensure
compatibility with existing kernels and tools.

Reviewed by: brooks, jhb, kib, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17438

5 years agoClear pad bytes in the struct exported by kern.ntp_pll.gettime.
markj [Tue, 20 Nov 2018 20:32:10 +0000 (20:32 +0000)]
Clear pad bytes in the struct exported by kern.ntp_pll.gettime.

Reported by: Thomas Barabosch, Fraunhofer FKIE
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoEnable evdev on ppc32
zeising [Tue, 20 Nov 2018 19:31:02 +0000 (19:31 +0000)]
Enable evdev on ppc32

Enable evdev on ppc32 as well, similar to what was done i386 and amd64 in
r340387 and ppc64 in r340632.

Evdev can be used by X and is used by wayland to handle input devices.

Approved by: jhibbits
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18049

5 years agoImport OpenSSL 1.1.1a.
jkim [Tue, 20 Nov 2018 18:59:41 +0000 (18:59 +0000)]
Import OpenSSL 1.1.1a.

5 years agoMake multiline APPLY_MASK() macro to be function-like.
ae [Tue, 20 Nov 2018 18:38:28 +0000 (18:38 +0000)]
Make multiline APPLY_MASK() macro to be function-like.

Reported by: cem
MFC after: 1 week

5 years agoPlug a trivial memory leak.
markj [Tue, 20 Nov 2018 18:13:18 +0000 (18:13 +0000)]
Plug a trivial memory leak.

CID: 1396911
MFC with: r340485

5 years agoAvoid clobbering a user-specified -g value after r340547.
markj [Tue, 20 Nov 2018 18:10:56 +0000 (18:10 +0000)]
Avoid clobbering a user-specified -g value after r340547.

CID: 1396919
MFC with: r340547

5 years agostand: remove CLANG_NO_IAS from btx and gptboot
emaste [Tue, 20 Nov 2018 16:54:42 +0000 (16:54 +0000)]
stand: remove CLANG_NO_IAS from btx and gptboot

Many components under stand/ had CLANG_NO_IAS added when Clang's
Integrated Assembler (IAS) did not handle .codeNN directives.  Clang
gained support quite some time ago, and we can now build stand/ with
IAS.

Note that in some cases there are small differences in the generated
output, so CLANG_NO_IAS should be removed only after testing (or after
finding no differences in the output).

PR: 205250, 233094
Sponsored by: The FreeBSD Foundation

5 years agotmpfs: use unr64 for inode numbers
mjg [Tue, 20 Nov 2018 15:14:30 +0000 (15:14 +0000)]
tmpfs: use unr64 for inode numbers

Sponsored by: The FreeBSD Foundation

5 years agoHandle kernel superpage mappings in pmap_remove_l2().
markj [Tue, 20 Nov 2018 15:12:37 +0000 (15:12 +0000)]
Handle kernel superpage mappings in pmap_remove_l2().

PR: 233088
Reviewed by: alc, andrew, kib
Tested by: sbruno
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17981

5 years agopipe: use unr64
mjg [Tue, 20 Nov 2018 14:59:27 +0000 (14:59 +0000)]
pipe: use unr64

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18054

5 years agoImplement unr64
mjg [Tue, 20 Nov 2018 14:58:41 +0000 (14:58 +0000)]
Implement unr64

Important users of unr like tmpfs or pipes can get away with just
ever-increasing counters, making the overhead of managing the state
for 32 bit counters a pessimization.

Change it to an atomic variable. This can be further sped up by making
the counts variable "allocate" ranges and store them per-cpu.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18054

5 years agortld: when immediate bind mode is requested, process irelocs in PLT
kib [Tue, 20 Nov 2018 14:52:43 +0000 (14:52 +0000)]
rtld: when immediate bind mode is requested, process irelocs in PLT
immediately after other PLT relocs.

Otherwise, if the object has relro page, we write to readonly page,
and we would need to use mprotect(2) two more times to fix it.  Note
that resolve_object_ifunc() does nothing when called second time, so
there is no need to avoid existing call.

Reported and tested by: emaste
PR: 233333
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoFix another user address dereference in linux_sendmsg syscall.
tijl [Tue, 20 Nov 2018 14:18:57 +0000 (14:18 +0000)]
Fix another user address dereference in linux_sendmsg syscall.

This was hidden behind the LINUX_CMSG_NXTHDR macro which dereferences its
second argument.  Stop using the macro as well as LINUX_CMSG_FIRSTHDR.  Use
the size field of the kernel copy of the control message header to obtain
the next control message.

PR: 217901
MFC after: 2 days
X-MFC-With: r340631

5 years agoports(7): Do not mention deprecated WITH_OPENSSL_PORT.
0mp [Tue, 20 Nov 2018 10:01:56 +0000 (10:01 +0000)]
ports(7): Do not mention deprecated WITH_OPENSSL_PORT.

Reviewed by: eadler
Approved by: krion (mentor, implicit), mat (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D18045

5 years agoEnsure that all values of ns, us and ms work for {n,u,m}stosbt
imp [Tue, 20 Nov 2018 07:11:23 +0000 (07:11 +0000)]
Ensure that all values of ns, us and ms work for {n,u,m}stosbt

Integer overflows and wrong constants limited the accuracy of these
functions and created situatiosn where sbttoXs(Xstosbt(Y)) != Y. This
was especailly true in the ns case where we had millions of values
that were wrong.

Instead, used fixed constants because there's no way to say ceil(X)
for integer math. Document what these crazy constants are.

Also, use a shift one fewer left to avoid integer overflow causing
incorrect results, and adjust the equasion accordingly. Document this.

Allow times >= 1s to be well defined for these conversion functions
(at least the Xstosbt). There's too many users in the tree that they
work for >= 1s.

This fixes a failure on boot to program firmware on the mlx4
NIC. There was a msleep(1000) in the code. Prior to my recent rounding
changes, msleep(1000) worked, but msleep(1001) did not because the old
code rounded to just below 2^64 and the new code rounds to just above
it (overflowing, causing the msleep(1000) to really sleep 1ms).

A test program to test all cases will be committed shortly. The test
exaustively tries every value (thanks to bde for the test).

Sponsored by: Netflix, Inc
Differential Revision: https://reviews.freebsd.org/D18051

5 years agoImprove sanity checking for the dircount hint argument to
rmacklem [Tue, 20 Nov 2018 01:59:57 +0000 (01:59 +0000)]
Improve sanity checking for the dircount hint argument to
NFSv3's ReaddirPlus and NFSv4's Readdir operations. The code
checked for a zero argument, but did not check for a very large value.
This patch clips dircount at the server's maximum data size.

MFC after: 1 week

5 years agonfsm_advance() would panic() when the offs argument was negative.
rmacklem [Tue, 20 Nov 2018 01:56:34 +0000 (01:56 +0000)]
nfsm_advance() would panic() when the offs argument was negative.
The code assumed that this would indicate a corrupted mbuf chain, but
it could simply be caused by bogus RPC message data.
This patch replaces the panic() with a printf() plus error return.

MFC after: 1 week

5 years agor304026 added code that started statistics gathering for an operation
rmacklem [Tue, 20 Nov 2018 01:52:45 +0000 (01:52 +0000)]
r304026 added code that started statistics gathering for an operation
before the operation number (the variable called "op") was sanity checked.
This patch moves the code down to below the range sanity check for "op".

5 years agoGiven that the idea of D15374 was to "make memmove a first class citizen",
marius [Tue, 20 Nov 2018 00:08:33 +0000 (00:08 +0000)]
Given that the idea of D15374 was to "make memmove a first class citizen",
provide a _MEMMOVE extension of _MEMCPY that deals with overlap based on
the previous bcopy(9) implementation and use the former for bcopy(9) and
memmove(9). This addresses my D15374 review comment, avoiding extra MOVs
in case of memmove(9) and trashing the stack pointer.

5 years agopom: Fix fencepost bugs.
tmunro [Tue, 20 Nov 2018 00:06:53 +0000 (00:06 +0000)]
pom: Fix fencepost bugs.

Under some conditions pom would report "waning" and then "full", show
higher percentages than it should, and get confused by DST.  Fix.

Before:

  2018.01.30: The Moon is Waxing Gibbous (97% of Full)
  2018.01.31: The Moon is Waning Gibbous (100% of Full)
  2018.02.01: The Moon is Full
  2018.02.02: The Moon is Waning Gibbous (98% of Full)

After:

  2018.01.30: The Moon is Waxing Gibbous (96% of Full)
  2018.01.31: The Moon is Waxing Gibbous (99% of Full)
  2018.02.01: The Moon is Full
  2018.02.02: The Moon is Waning Gibbous (97% of Full)

PR:                    231705
Submitted by:          Andrew Gierth
Approved by:           allanjude (mentor)
MFC after:             2 weeks
Differential Revision: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231705

5 years agoFor consistency within the front-end, prefer SDHCI_{READ,WRITE}_{2,4}()
marius [Mon, 19 Nov 2018 23:56:33 +0000 (23:56 +0000)]
For consistency within the front-end, prefer SDHCI_{READ,WRITE}_{2,4}()
to sdhci_acpi_{read,write}_{2,4}() in the sdhci_acpi_set_uhs_timing()
added in r340543.

5 years agopowerpc: Sync icache on SIGILL, in case of cache issues
jhibbits [Mon, 19 Nov 2018 23:54:49 +0000 (23:54 +0000)]
powerpc: Sync icache on SIGILL, in case of cache issues

The update of jemalloc to 5.1.0 exposed a cache syncing issue on a Freescale
e500 base system.  There was already code in the FPU emulator to address
this, but it was limited to a single static variable, and did not attempt to
sync the cache.  This pulls that out to the higher level program exception
handler, and syncs the cache.

If a SIGILL is hit a second time at the same address, it will be treated as
a real illegal instruction, and handled accordingly.

5 years agorescue: set NO_SHARED in Makefile
emaste [Mon, 19 Nov 2018 22:18:18 +0000 (22:18 +0000)]
rescue: set NO_SHARED in Makefile

The rescue binary is built statically via the Makefile generated by
crunchgen, but that does not trigger other shared/static logic in
bsd.prog.mk - in particular disabling retpolineplt with static linking.

PR: 233336
Reported by: Charlie Li
Sponsored by: The FreeBSD Foundation

5 years agocxgbe(4): Update T4/5/6 firmwares to 1.22.0.3.
np [Mon, 19 Nov 2018 21:59:07 +0000 (21:59 +0000)]
cxgbe(4): Update T4/5/6 firmwares to 1.22.0.3.

Obtained from: Chelsio Communications
MFC after: 2 months
Sponsored by: Chelsio Communications

5 years agoAvoid retpolineplt with static linking
emaste [Mon, 19 Nov 2018 20:48:47 +0000 (20:48 +0000)]
Avoid retpolineplt with static linking

Statically linked binaries linked with -zretpolineplt crash at startup
as lld produces a broken PLT.

PR: 233336
Sponsored by: The FreeBSD Foundation

5 years agoAdd a fortune describing how to upload a machine's dmesg information to the
bcr [Mon, 19 Nov 2018 20:45:49 +0000 (20:45 +0000)]
Add a fortune describing how to upload a machine's dmesg information to the
NYCBUG database.

We want to encourage our users to upload their dmesgs so that the project can
get a better insight into what kind of hardware is run on. This helps in making
data-driven decisions about i.e., platform and driver support.

Note that dmesgs may contain sensitive information like hardware serial numbers,
hence uploading them without review is discouraged.

Reviewed by: brooks, imp, allanjude
Approved by: allanjude
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D17705

5 years agoAdd capsicum_helpers.h to -legacy if needed
arichardson [Mon, 19 Nov 2018 18:58:34 +0000 (18:58 +0000)]
Add capsicum_helpers.h to -legacy if needed

This fixes bootstrap of capsicumized strings on FreeBSD 11.

Reviewed By: oshogbo, bdrewery
Differential Revision: https://reviews.freebsd.org/D17971

5 years agoacpi: fix acpi_ec_probe to only check EC devices
bwidawsk [Mon, 19 Nov 2018 18:29:03 +0000 (18:29 +0000)]
acpi: fix acpi_ec_probe to only check EC devices

This patch utilizes the fixed_devclass attribute in order to make sure
other acpi devices with params don't get confused for an EC device.

The existing code assumes that acpi_ec_probe is only ever called with a
dereferencable acpi param. Aside from being incorrect because other
devices of ACPI_TYPE_DEVICE may be probed here which aren't ec devices,
(and they may have set acpi private data), it is even more nefarious if
another ACPI driver uses private data which is not dereferancable. This
will result in a pointer deref during boot and therefore boot failure.

On X86, as it stands today, no other devices actually do this (acpi_cpu
checks for PROCESSOR type devices) and so there is no issue. I ran into
this because I am adding such a device which gets probed before
acpi_ec_probe and sets private data. If ARM ever has an EC, I think
they'd run into this issue as well.

There have been several iterations of this patch. Earlier
iterations had ECDT enumerated ECs not call into the probe/attach
functions of this driver. This change was Suggested by: jhb@.

Reviewed by:    jhb
Approved by: emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D16635

5 years agoMake libthr(3) use sysconf(_SC_NPROCESSORS_CONF); this shaves off
trasz [Mon, 19 Nov 2018 18:24:08 +0000 (18:24 +0000)]
Make libthr(3) use sysconf(_SC_NPROCESSORS_CONF); this shaves off
two calls to sysctl(2) from the binary startup.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18046

5 years agoMake sysconf(_SC_PAGESIZE) return the value from getpagesize(3).
trasz [Mon, 19 Nov 2018 18:23:17 +0000 (18:23 +0000)]
Make sysconf(_SC_PAGESIZE) return the value from getpagesize(3).
That avoids a syscall - getpagesize(3) gets the value from the ELF
aux strings.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17989

5 years agolibc: forcibly disable BIND_NOW
emaste [Mon, 19 Nov 2018 18:12:39 +0000 (18:12 +0000)]
libc: forcibly disable BIND_NOW

Building libc WITH_BIND_NOW results in segfault at process start.  For
now force BIND_NOW off until the root cause can be identified and fixed.

PR: 233333
Sponsored by: The FreeBSD Foundation

5 years agoRemove comments made obsolete by the ino64 work.
markj [Mon, 19 Nov 2018 17:33:44 +0000 (17:33 +0000)]
Remove comments made obsolete by the ino64 work.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agolibcasper: provide compatibility with the old version of service
oshogbo [Mon, 19 Nov 2018 17:22:52 +0000 (17:22 +0000)]
libcasper: provide compatibility with the old version of service

Some external tools like tcpdump(1) have upstream the changes with old limits
name. Because of that provide compatibility with the old names.

Reported by: emaste

5 years agoUse swp_pager_isondev() throughout. Submitted by: ota@j.email.ne.jp
alc [Mon, 19 Nov 2018 17:17:23 +0000 (17:17 +0000)]
Use swp_pager_isondev() throughout.  Submitted by: ota@j.email.ne.jp

Change swp_pager_isondev()'s return type to bool.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16712

5 years agobectl(8) tests: attempt to load the ZFS module
kevans [Mon, 19 Nov 2018 17:09:57 +0000 (17:09 +0000)]
bectl(8) tests: attempt to load the ZFS module

Observed in a CI test image, bectl_create test will run and be marked as
skipped because the module is not loaded. The first zpool invocation will
automagically load the module, but bectl_create is still skipped. Subsequent
tests all pass as expected because the module is now loaded and everything
is OK.

MFC after: 3 days

5 years agolibbe(3): Handle non-ZFS rootfs better
kevans [Mon, 19 Nov 2018 16:47:21 +0000 (16:47 +0000)]
libbe(3): Handle non-ZFS rootfs better

If rootfs isn't ZFS, current version will emit an error claiming so and fail
to initialize libbe. As a consumer, bectl -r (undocumented) can be specified
to operate on a BE independently of whether on a UFS or ZFS root.

Unbreak this for the UFS case by only erroring out the init if we can't
determine a ZFS dataset for rootfs and no BE root was specified. Consumers
of libbe should take care to ensure that rootfs is non-empty if they're
trying to use it, because this could certainly be the case.

Some check is needed before zfs_path_to_zhandle because it will
unconditionally emit to stderr if the path isn't a ZFS filesystem, which is
unhelpful for our purposes.

This should also unbreak the bectl(8) tests on a UFS root, as is the case in
Jenkins' -test runs.

MFC after: 3 days

5 years agoEnable evdev on ppc64
zeising [Mon, 19 Nov 2018 15:36:58 +0000 (15:36 +0000)]
Enable evdev on ppc64

Enable evdev on ppc64 as well, similar to what was done for amd64 and i386
in r340387.

Evdev can be used by X and is used by wayland to handle input devices.

Approved by: mmacy
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18026

5 years agoDo proper copyin of control message data in the Linux sendmsg syscall.
tijl [Mon, 19 Nov 2018 15:31:54 +0000 (15:31 +0000)]
Do proper copyin of control message data in the Linux sendmsg syscall.

Instead of calling m_append with a user address, allocate an mbuf cluster
and copy data into it using copyin.  For the SCM_CREDS case, instead of
zeroing a stack variable and appending that to the mbuf, zero part of the
mbuf cluster directly.  One mbuf cluster is also the size limit used by
the FreeBSD sendmsg syscall (uipc_syscalls.c:sockargs()).

PR: 217901
Reviewed by: kib
MFC after: 3 days

5 years agoMinor code factoring. No functional change.
hselasky [Mon, 19 Nov 2018 09:36:09 +0000 (09:36 +0000)]
Minor code factoring. No functional change.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoBe more verbose when a sysctl fails to unregister.
hselasky [Mon, 19 Nov 2018 09:35:16 +0000 (09:35 +0000)]
Be more verbose when a sysctl fails to unregister.
Print name of sysctl in question.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoUnbreak ng_source(4) for 64-bit platforms including amd64.
eugen [Mon, 19 Nov 2018 07:27:50 +0000 (07:27 +0000)]
Unbreak ng_source(4) for 64-bit platforms including amd64.

5 years agoFix access to cpu_model[] in mtk_soc_set_cpu_model()
sgalabov [Mon, 19 Nov 2018 06:48:48 +0000 (06:48 +0000)]
Fix access to cpu_model[] in mtk_soc_set_cpu_model()

There may be cases where cpu_model[] may not be 32bit aligned, so it is
better to not try to access it as such in order to avoid unaligned access.

Sponsored by: Smartcom - Bulgaria AD

5 years agogitv3_its: fixes for multiple GIC ITS blocks
jchandra [Mon, 19 Nov 2018 03:52:56 +0000 (03:52 +0000)]
gitv3_its: fixes for multiple GIC ITS blocks

First pass of support for multiple GIC ITS blocks with ACPI.
Changes are to:
 * register the correct subset of interrupts with pic_register
   in case of ACPI.
 * initialize just the cpu interface for the first ITS, when
   domain information is not avialable. This has to be done
   until we split the per-CPU init to do LPI setup just once.
 * remove duplicate check for the GIC ITS domain, the sc_cpus
   are setup from domain, so the check again in per-CPU init
   seems unnecessary.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D17841

5 years agopci_host_generic : move activate/release to generic code
jchandra [Mon, 19 Nov 2018 03:43:10 +0000 (03:43 +0000)]
pci_host_generic : move activate/release to generic code

Now that the ACPI and FDT implementations for activating and
deactivating resources are the same, we can move it to
pci_host_generic.c.  No functional changes.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D17793

5 years agopci_host_generic, acpi_resource: drop unneeded code
jchandra [Mon, 19 Nov 2018 03:34:15 +0000 (03:34 +0000)]
pci_host_generic, acpi_resource: drop unneeded code

Now that we are handling PCI resources in pci_host_generic_acpi.c, we
don't need these change (made by r336129)

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D17792

5 years agoacpica, pci_host_generic_acpi: redo pci_host_generic_acpi.c
jchandra [Mon, 19 Nov 2018 03:16:16 +0000 (03:16 +0000)]
acpica, pci_host_generic_acpi: redo pci_host_generic_acpi.c

This is a major update for pci_host_generic_acpi.c, the current
implementation has some gaps that are better fixed up in one go.
The changes are to:
 * Follow x86 method of not adding PCI resources to PCI host bridge in
   ACPI code. This has been moved to pci_host_generic_acpi.c, where we
   walk thru its resources of the host bridge and add them.
 * Fixup code in pci_host_generic_acpi.c to read all decoded ranges
   and update the 'ranges' property. This allows us to share most of
   the code with generic implementation (and the FDT one).
 * Parse and setup IO ranges and bus ranges when walking the resources
   above. Drop most of the changes related to this from acpica code.
 * Add the ECAM memory area as mem resource 0. Implement the logic to
   get the ECAM area from MCFG (using bus range which we now decode),
   or from _CBA (using _BBN/bus range). Drop aarch64 ifdefs from acpica
   code which did part of this.
 * Switch resource activation to similar code as FDT implementation,
   this can be moved into generic implementation in a later pass.
 * Drop the mechanism of using the 7th bit of bus number as the domain,
   this is not correct and will work only in very specific cases. Use
   _SEG as PCI domain and use the bus ranges of the host bridge to
   provide start bus number.

This commit should not make any functional change to dev/acpica/acpi.c
for other architectures, almost all the changes there are to revert
earlier additions in this file done for aarch64.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D17791

5 years agoacpica: rework INTRNG interrupts
jchandra [Mon, 19 Nov 2018 03:02:47 +0000 (03:02 +0000)]
acpica: rework INTRNG interrupts

On arm64 (where INTRNG is enabled), the interrupts have to be mapped
with ACPI_BUS_MAP_INTR() before adding them as resources to devices.

The earlier code did the mapping before calling acpi_set_resource(),
which bypassed code that checked for PCI link interrupts.

To fix this, move the call to map interrupts into acpi_set_resource()
and that requires additional work to lookup interrupt properties.
The changes here are to:
 * extend acpi_lookup_irq_handler() to lookup an irq in the ACPI
   resources
 * create a helper function acpi_map_intr() which uses the updated
   acpi_lookup_irq_handler() to look up an irq, and then map it
   with ACPI_BUS_MAP_INTR()
 * use acpi_map_intr() in acpi_pcib_route_interrupt() to map
   pci link interrupts.

With these changes, we can drop the ifdefs in acpi_resource.c, and
we can also drop the call for mapping interrupts in generic_timer.c

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D17790

5 years agopci_host_generic*: basic implementation of bus range
jchandra [Mon, 19 Nov 2018 02:55:18 +0000 (02:55 +0000)]
pci_host_generic*: basic implementation of bus range

Both ACPI and FDT support bus ranges for pci host bridges. Update
pci_host_generic*.[ch] with a default implementation to support this.
This will be used in the next set of changes for ACPI based host
bridge. No functional changes in this commit.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D17657

5 years agopci_host_generic: allocate resources against devices
jchandra [Mon, 19 Nov 2018 02:43:34 +0000 (02:43 +0000)]
pci_host_generic: allocate resources against devices

Fix up pci_host_generic.c and pci_host_generic_fdt.c to allocate
resources against devices that requested them. Currently the
allocation happens against the pcib, which is incorrect.

This is needed for the upcoming changes for fixing up
pci_host_generic_acpi.c

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D17656

5 years agopci_host_generic: remove unneeded ThunderX2 quirk
jchandra [Mon, 19 Nov 2018 02:38:02 +0000 (02:38 +0000)]
pci_host_generic: remove unneeded ThunderX2 quirk

The current quirk implementation writes a fixed address to the PCI BAR
to fix a firmware bug. The PCI BARs are allocated by firmware and will
change depending on PCI devices present. So using a fixed address here
is not correct.

This quirk worked around a firmware bug that programmed the MSI-X bar
of the SATA controller incorrectly. The newer firmware does not have
this issue, so it is better to drop this quirk altogether.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D17655

5 years agobectl(8): Add some regression tests
kevans [Mon, 19 Nov 2018 02:30:12 +0000 (02:30 +0000)]
bectl(8): Add some regression tests

These tests operate on a file-backed zpool that gets created in the kyua
temp dir. root and ZFS support are both required for these tests. Current
tests cover create, destroy, export/import, jail, list (kind of), mount,
rename, and jail.

List tests should later be extended to cover formatting and the different
list flags, but for now only covers basic "are create/destroy actually
reflected properly"

MFC after: 3 days

5 years agolibbe(3): Properly account for altroot when creating new BEs
kevans [Mon, 19 Nov 2018 02:16:20 +0000 (02:16 +0000)]
libbe(3): Properly account for altroot when creating new BEs

Previously we would blindly copy the 'mountpoint' property, which includes
the altroot. The altroot needs to be snipped off prior to setting it on the
new BE, though, or you'll end up with a new BE and a mountpoint of /mnt with
altroot=/mnt

MFC after: 3 days

5 years agobectl(3)/libbe(3): Allow BE root to be specified
kevans [Mon, 19 Nov 2018 02:12:08 +0000 (02:12 +0000)]
bectl(3)/libbe(3): Allow BE root to be specified

Add an undocumented -r option preceding the bectl subcommand to specify a BE
root to operate out of. This will remain undocumented for now, as some
caveats apply:

- BEs cannot be activated in the pool that doesn't contain the rootfs
- bectl create cannot work out of the box without the -e option right now,
  since it defaults to the rootfs and cross-pool cloning doesn't work like
  that (IIRC)

Plumb the BE root through to libbe(3) so that some things -can- be done to
it, e.g.

bectl -r tank/ROOT create -e default upgrade
bectl -r tank/ROOT mount upgrade /mnt

this aides in some upgrade setups where rootfs is not necessarily ZFS, and
also makes it easier/possible to regression-test bectl when combined with a
file-backed zpool.

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D18029

5 years agoRetire sbsndptr() KPI
kbowling [Mon, 19 Nov 2018 00:54:31 +0000 (00:54 +0000)]
Retire sbsndptr() KPI

As of r340465 all consumers use sbsndptr_adv and sbsndptr_noadv

Reviewed by: gallatin
Approved by: krion (mentor)
Differential Revision: https://reviews.freebsd.org/D17998

5 years agoFix -DNO_CLEAN amd64 build after r340463
arichardson [Sun, 18 Nov 2018 19:55:03 +0000 (19:55 +0000)]
Fix -DNO_CLEAN amd64 build after r340463

Without this change I got the following error:
clang-7: error: no such file or directory: '..../lib/libc/amd64/string/bzero.S'

Reviewed By: mjg
Differential Revision: https://reviews.freebsd.org/D18031

5 years agobrandelf: capsicumize it
oshogbo [Sun, 18 Nov 2018 12:23:03 +0000 (12:23 +0000)]
brandelf: capsicumize it

5 years agobrandelf: fix style nits
oshogbo [Sun, 18 Nov 2018 12:03:12 +0000 (12:03 +0000)]
brandelf: fix style nits

No functional change intended.

Reviewed by: emaste, markj
Differential Revision: https://reviews.freebsd.org/D17966

5 years agoUpdate the names in the LIMITS and EXAMPLES sections after r340363.
oshogbo [Sun, 18 Nov 2018 11:11:27 +0000 (11:11 +0000)]
Update the names in the LIMITS and EXAMPLES sections after r340363.

Reported by: markj

5 years agoChange dumpon(8)'s handling of -g.
markj [Sun, 18 Nov 2018 01:58:48 +0000 (01:58 +0000)]
Change dumpon(8)'s handling of -g.

Rather than using a special value to denote "use the default router",
treat the absence of the -g option to mean the same thing.  The
in-kernel netdump client will always attempt to reach the server
directly before falling back to the configured gateway anyway.  This
change makes it cleaner to support a hostname value for -g.

Reviewed by: cem
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D18025

5 years agoTidy up vm_map_simplify_entry() and its recently introduced helper
alc [Sun, 18 Nov 2018 01:27:17 +0000 (01:27 +0000)]
Tidy up vm_map_simplify_entry() and its recently introduced helper
functions.  Notably, reflow the text of some comments so that they
occupy fewer lines, and introduce an assertion in one of the new
helper functions so that it is not misused by a future caller.

In collaboration with: Doug Moore <dougm@rice.edu>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17635

5 years agoAdd a quirk handling for AMDI0040 controllers allowing them to do HS400.
marius [Sun, 18 Nov 2018 00:52:27 +0000 (00:52 +0000)]
Add a quirk handling for AMDI0040 controllers allowing them to do HS400.

Submitted by: Shreyank Amartya (original version)

5 years agomount_fusefs.8: expand HISTORY section
asomers [Sat, 17 Nov 2018 21:35:01 +0000 (21:35 +0000)]
mount_fusefs.8: expand HISTORY section

Note that fuse was available from ports long before joining the base system.
Also, update the upstream URL.

MFC after: 2 weeks

5 years agolibbe(3): Rewrite be_unmount to stop mucking with getmntinfo(2)
kevans [Sat, 17 Nov 2018 19:19:37 +0000 (19:19 +0000)]
libbe(3): Rewrite be_unmount to stop mucking with getmntinfo(2)

Go through the ZFS layer instead; given a BE, we can derive the dataset,
zfs_open it, then zfs_unmount. ZFS takes care of the dirty details and
likely gets it more correct than we did for more interesting setups.

MFC after: 3 days

5 years agolibbe(3): rewrite init to support chroot usage
kevans [Sat, 17 Nov 2018 19:15:29 +0000 (19:15 +0000)]
libbe(3): rewrite init to support chroot usage

libbe(3) currently uses zfs_be_root and locates which of its children is
currently mounted at "/". This is reasonable, but not correct in the case of
a chroot, for two reasons:

- chroot root may be of a different zpool than zfs_be_root
- chroot root will not show up as mounted at "/"

Fix both of these by rewriting libbe_init to work from the rootfs down.
zfs_path_to_zhandle on / will resolve to the dataset mounted at the new
root, rather than the real root. From there, we can derive the BE root/pool
and grab the bootfs off of the new pool. This does no harm in the average
case, and opens up bectl to operating on different pools for scenarios where
one may be, for instance, updating a pool that generally gets re-rooted into
from a separate UFS root or zfs bootpool.

While here, I've also:
- Eliminated the check for /boot and / to be on the same partition. This
  leaves one open to a setup where /boot (and consequently, kernel/modules)
  are not included in the boot environment. This may very well be an
  intentional setup done by someone that knows what they're doing, we should
  not kill BE usage because of it.

- Eliminated the validation bits of BEs and snapshots that enforced
  'mountpoint' to be "/" -- this broke when trying to operate on an imported
  pool with an altroot, but we need not be this picky.

Reported by: philip
Reviewed by: philip, allanjude (previous version)
Tested by: philip
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D18012

5 years ago- Restore setting the clock for devices which support the default/legacy
marius [Sat, 17 Nov 2018 17:21:36 +0000 (17:21 +0000)]
- Restore setting the clock for devices which support the default/legacy
  transfer mode only (lost with r321385). [1]
- Similarly, don't try to set the power class on MMC devices that comply
  to version 4.0 of the system specification but are operated in default/
  legacy transfer or 1-bit bus mode as no power class is specified for
  these cases. Trying to set a power class nevertheless resulted in an -
  albeit harmless - error message.

PR: 231713 [1]

5 years agoImprove the comment for arpresolve_full() in if_ether.c.
bz [Sat, 17 Nov 2018 16:13:09 +0000 (16:13 +0000)]
Improve the comment for arpresolve_full() in if_ether.c.
No functional changes.

MFC after: 6 weeks

5 years agoRetire arpresolve_addr(), which is not used anywhere, from if_ether.c.
bz [Sat, 17 Nov 2018 16:08:36 +0000 (16:08 +0000)]
Retire arpresolve_addr(), which is not used anywhere, from if_ether.c.

5 years agoMake mbstowcs_basic test pass, now that we have more ctype definitions.
yuripv [Sat, 17 Nov 2018 12:59:59 +0000 (12:59 +0000)]
Make mbstowcs_basic test pass, now that we have more ctype definitions.

Reported by: jenkins
Approved by: kib (mentor, implicit)

5 years agoUse UnicodeData.txt to create UTF-8 ctype map.
yuripv [Sat, 17 Nov 2018 10:36:00 +0000 (10:36 +0000)]
Use UnicodeData.txt to create UTF-8 ctype map.

This should provide more complete coverage of currently defined Unicode
characters as compared to manually assembled one we use currently.

Comparison of original and new UTF-8 ctype maps by character class:

TYPE    ORIG    NEW
alnum   94229   126029
alpha   93557   125419
blank   4       2
cntrl   73      137685
digit   469     622
graph   109615  137203
lower   1478    2145
print   109641  137222
punct   3428    797
rune    110481  274907
space   33      24
upper   983     1781
xdigit  469     622

Large number of added cntrl definitions is due to the fact that private-use
planes are currently defined as such, this can change in the future.

Discussed with: bapt
Approved by: kib (mentor, implicit)
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D17842

5 years agoFix stray tab.
brooks [Sat, 17 Nov 2018 00:03:04 +0000 (00:03 +0000)]
Fix stray tab.

Reported by: jbeich
MFC after: 3 days
MFC with: r340489
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18011

5 years agoFix freebsd32 support for PCIOCGETCONF.
brooks [Fri, 16 Nov 2018 23:58:51 +0000 (23:58 +0000)]
Fix freebsd32 support for PCIOCGETCONF.

This fixes regresssions in pciconf -l and some ports as reported on
freebsd-current:

https://lists.freebsd.org/pipermail/freebsd-current/2018-November/072144.html

Reported by: jbeich
Reviewed by: kib (also proposed an idential patch)
Tested by: jbeich
MFC after: 3 days
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D18011

5 years agoAxe MINIMUM_MSI_INT.
jhb [Fri, 16 Nov 2018 23:39:39 +0000 (23:39 +0000)]
Axe MINIMUM_MSI_INT.

Just allow MSI interrupts to always start at the end of the I/O APIC
pins.  Since existing machines already have more than 255 I/O APIC
pins, IRQ 255 is no longer reliably invalid, so just remove the
minimum starting value for MSI.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D17991

5 years agoAlign IA32_ARCH_CAP MSR definitions and use with SDM rev. 068.
kib [Fri, 16 Nov 2018 21:27:11 +0000 (21:27 +0000)]
Align IA32_ARCH_CAP MSR definitions and use with SDM rev. 068.

SDM rev. 068 was released yesterday and it contains the description of
the MSR 0x10a IA32_ARCH_CAP. This change adds symbolic definitions for
all bits present in the document, and decode them in the CPU
identification lines printed on boot.

But also, the document defines SSB_NO as bit 4, while FreeBSD used but
2 to detect the need to work-around Speculative Store Bypass
issue.  Change code to use the bit from SDM.

Similarly, the document describes bit 3 as an indicator that L1TF
issue is not present, in particular, no L1D flush is needed on
VMENTRY.  We used RDCL_NO to avoid flushing, and again I changed the
code to follow new spec from SDM.

In fact my Apollo Lake machine with latest ucode shows this:
    IA32_ARCH_CAPS=0x19<RDCL_NO,SKIP_L1DFL_VME,SSB_NO>

Reviewed by: bwidawsk
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D18006

5 years agoConsolidate on a single set of constants for SCMD fields.
jhb [Fri, 16 Nov 2018 19:08:52 +0000 (19:08 +0000)]
Consolidate on a single set of constants for SCMD fields.

Both ccr(4) and the TOE TLS code had separate sets of constants for
fields in SCMD messages.

Sponsored by: Chelsio Communications

5 years agoAdd regression tests for r340313 and r340483.
markj [Fri, 16 Nov 2018 19:04:12 +0000 (19:04 +0000)]
Add regression tests for r340313 and r340483.

Reviewed by: emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17926

5 years agoRename the SO_REUSEPORT_LB test file to be consistent with other tests.
markj [Fri, 16 Nov 2018 18:59:58 +0000 (18:59 +0000)]
Rename the SO_REUSEPORT_LB test file to be consistent with other tests.

MFC after: 1 week

5 years agoAdd some additional length checks to the IPv4 fragmentation code.
jtl [Fri, 16 Nov 2018 18:32:48 +0000 (18:32 +0000)]
Add some additional length checks to the IPv4 fragmentation code.

Specifically, block 0-length fragments, even when the MF bit is clear.
Also, ensure that every fragment with the MF bit clear ends at the same
offset and that no subsequently-received fragments exceed that offset.

Reviewed by: glebius, markj
MFC after: 3 days
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D17922

5 years agoproc: always store parent pid in p_oppid
mjg [Fri, 16 Nov 2018 17:07:54 +0000 (17:07 +0000)]
proc: always store parent pid in p_oppid

Doing so removes the dependency on proctree lock from sysctl process list
export which further reduces contention during poudriere -j 128 runs.

Reviewed by: kib (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17825

5 years agoRemove do-nothing nvme_modevent.
imp [Fri, 16 Nov 2018 16:51:44 +0000 (16:51 +0000)]
Remove do-nothing nvme_modevent.

nvme_modevent no longer does anything interesting, remove it.

Sponsored by: Netflix

5 years agoDefine asm macro in the LinuxKPI.
hselasky [Fri, 16 Nov 2018 16:23:45 +0000 (16:23 +0000)]
Define asm macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoImplement ktime_get_ts64() function macro in the LinuxKPI.
hselasky [Fri, 16 Nov 2018 16:19:16 +0000 (16:19 +0000)]
Implement ktime_get_ts64() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agodevelopment(7): Replace "reboot" with "shutdown -r now"
0mp [Fri, 16 Nov 2018 14:29:28 +0000 (14:29 +0000)]
development(7): Replace "reboot" with "shutdown -r now"

We generally document shutdown(8) instead of reboot(8) as it's better for
interactive use.

In modern FreeBSD is matters a lot less, it's mostly just convention. One
minor thing is that shutdown(8) produces a global message, while reboot(8)
does not. It is believed that historically, some versions of reboot did not
do appropriate safe shutdown checks and just rebooted.

It's also just consistency: for example the handbook[1] documents shutdown.

There is actually another important difference between reboot and shutdown
-r now: reboot does not run /etc/rc.shutdown. This is because reboot has
its own shutdown procedure and does not signal init like init 6 and
shutdown -r now do (except in the case of rerooting via reboot -r).

A few years ago jilles@ proposed changing reboot's default to signalling
init (preserving reboot -q which just invokes the reboot system call), but
this was not accepted. Perhaps this can be tried again for 13.0.

[1]: https://www.freebsd.org/doc/handbook/boot-shutdown.html

Reported by: eadler
Reviewed by: eadler, jilles
Approved by: krion (mentor)
Differential Revision: https://reviews.freebsd.org/D16843

5 years agoAllow configuration of several ipsec interfaces with the same tunnel
ae [Fri, 16 Nov 2018 14:21:57 +0000 (14:21 +0000)]
Allow configuration of several ipsec interfaces with the same tunnel
endpoints.

This can be used to configure several IPsec tunnels between two hosts
with different security associations.

Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC

5 years agoImplement support for sysctl hw.model for Mediatek/Ralink SoCs
sgalabov [Fri, 16 Nov 2018 11:17:18 +0000 (11:17 +0000)]
Implement support for sysctl hw.model for Mediatek/Ralink SoCs

These SoCs have CHIPID registers, which store the Chip model, according
to the manufacturer; make use of those in order to better identify
the chip we're actually running on.

If we're unable to read the CHIPID registers for some reason we will
use the string "unknown " as a value for hw.model.

Reported by: yamori813@yahoo.co.jp
Sponsored by: Smartcom - Bulgaria AD

5 years agoifnet(9): Add description of IFCAP_NETMAP
vmaffione [Fri, 16 Nov 2018 10:20:35 +0000 (10:20 +0000)]
ifnet(9): Add description of IFCAP_NETMAP

Describe IFCAP_NETMAP adding a cross reference to netmap(4).

Reviewed by: bcr, 0mp
Approved by: gnn (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D17988

5 years agoFix flags collision causing inability to enable CBQ in ALTQ
karels [Fri, 16 Nov 2018 03:42:29 +0000 (03:42 +0000)]
Fix flags collision causing inability to enable CBQ in ALTQ

The CBQ BORROW flag conflicts with the RMCF_CODEL flag; the
two sets of definitions actually define the same things. The symptom
is that a kernel with CBQ support and not CODEL fails to load a QoS
policy with the obscure error "pfctl: DIOCADDALTQ: Cannot allocate memory."
If ALTQ_DEBUG is enabled, the error becomes a little clearer:
"rmc_newclass: CODEL not configured for CBQ!" is printed by the kernel.
There really shouldn't be two sets of macros that have to be defined
consistently, but the include structure isn't right for exporting
CBQ flags to altq_rmclass.h. Re-align the definitions, and add
CTASSERTs in the kernel to ensure that the definitions are consistent.

PR: 215716
Reviewed by: pkelsey
MFC after: 2 weeks
Sponsored by: Forcepoint LLC
Differential Revision: https://reviews.freebsd.org/D17758

5 years agoRestore the <sys/vmem.h> header to fix build of cxgbe(4) TOM.
jhb [Fri, 16 Nov 2018 01:27:24 +0000 (01:27 +0000)]
Restore the <sys/vmem.h> header to fix build of cxgbe(4) TOM.

vmem's are not just used for TLS memory in TOM and the #include actually
predates the TLS code so should not have been removed when the TLS vmem
moved in r340466.

Pointy hat to: jhb
Sponsored by: Chelsio Communications

5 years agoamd64: handle small memset buffers with overlapping stores
mjg [Fri, 16 Nov 2018 00:44:22 +0000 (00:44 +0000)]
amd64: handle small memset buffers with overlapping stores

Instead of jumping to locations which store the exact number of bytes,
use displacement to move the destination.

In particular the following clears an area between 8-16 (inclusive)
branch-free:

movq    %r10,(%rdi)
movq    %r10,-8(%rdi,%rcx)

For instance for rcx of 10 the second line is rdi + 10 - 8 = rdi + 2.
Writing 8 bytes starting at that offset overlaps with 6 bytes written
previously and writes 2 new, giving 10 in total.

Provides a nice win for smaller stores. Other ones are erratic depending
on the microarchitecture.

General idea taken from NetBSD (restricted use of the trick) and bionic
string functions (use for various ranges like in this patch).

Reviewed by: kib (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17660

5 years agoRemove bogus roundup2() of the key programming work request header.
jhb [Thu, 15 Nov 2018 23:31:04 +0000 (23:31 +0000)]
Remove bogus roundup2() of the key programming work request header.

The key context is always placed immediately after the work request
header.  The total work request length has to be rounded up by 16
however.

MFC after: 1 month
Sponsored by: Chelsio Communications

5 years agoChange the quantum for TLS key addresses to 32 bytes.
jhb [Thu, 15 Nov 2018 23:10:46 +0000 (23:10 +0000)]
Change the quantum for TLS key addresses to 32 bytes.

The addresses passed when reading and writing keys are always shifted
right by 5 as the memory locations are addressed in 32-byte chunks, so
the quantum needs to be 32, not 8.

MFC after: 1 month
Sponsored by: Chelsio Communications

5 years agoRemove mostly-useless proc provider probes.
markj [Thu, 15 Nov 2018 23:02:59 +0000 (23:02 +0000)]
Remove mostly-useless proc provider probes.

For some reason the proc UMA zone's ctor, dtor and init functions are
instrumented, but these functions are always available through FBT.
Moreover, the probes are not part of the original Solaris proc
provider, aren't documented, have no uses (e.g., in dwatch(8)) and
have no clear use to begin with.  Therefore, remove them.

Reviewed by: rpaulo
Differential Revision: https://reviews.freebsd.org/D2169

5 years agoMove the TLS key map into the adapter softc so non-TOE code can use it.
jhb [Thu, 15 Nov 2018 23:00:30 +0000 (23:00 +0000)]
Move the TLS key map into the adapter softc so non-TOE code can use it.

Sponsored by: Chelsio Communications

5 years agoUse sbsndptr_adv() instead of sbsndptr() for TOE TLS.
jhb [Thu, 15 Nov 2018 22:47:47 +0000 (22:47 +0000)]
Use sbsndptr_adv() instead of sbsndptr() for TOE TLS.

For TOE TLS, we just want to advance the send pointer to skip over the
record just sent to the TOE.  The recently added sbsndptr_adv() is
sufficient for that and is cheaper.

MFC after: 1 month
Sponsored by: Chelsio Communications

5 years agoamd64: sync up libc memset with the kernel version
mjg [Thu, 15 Nov 2018 20:28:35 +0000 (20:28 +0000)]
amd64: sync up libc memset with the kernel version

- tidy up memset to have rax set earlier for small sizes
- finish the tail in memset with an overlapping store
- align memset buffers to 16 bytes before using rep stos

Sponsored by: The FreeBSD Foundation

5 years agoamd64: convert libc bzero to a C func to avoid future bloat
mjg [Thu, 15 Nov 2018 20:20:39 +0000 (20:20 +0000)]
amd64: convert libc bzero to a C func to avoid future bloat

Reviewed by: kib (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17549

5 years agoConvert the number of MSI IRQs on x86 from a constant to a tunable.
jhb [Thu, 15 Nov 2018 18:37:41 +0000 (18:37 +0000)]
Convert the number of MSI IRQs on x86 from a constant to a tunable.

The number of MSI IRQs still defaults to 512, but it can now be
changed at boot time via the machdep.num_msi_irqs tunable.

Reviewed by: kib, royger (older version)
Reviewed by: markj
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D17977

5 years agoSet the SPI clock speed and polarity on each transfer to catch up with
loos [Thu, 15 Nov 2018 17:05:02 +0000 (17:05 +0000)]
Set the SPI clock speed and polarity on each transfer to catch up with
recent changes in spibus and allow the use of different SPI modes on
the same bus.

Reported by: ian
Sponsored by: Rubicon Communications, LLC (Netgate)