]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMinor tweak to the debug
imp [Thu, 18 Apr 2019 15:19:19 +0000 (15:19 +0000)]
Minor tweak to the debug

Make it clear we're loading from UFS.

5 years agoCorrect handling of RMRR during early enumeration stages.
kib [Thu, 18 Apr 2019 14:18:06 +0000 (14:18 +0000)]
Correct handling of RMRR during early enumeration stages.

On some machines, DMAR contexts must be created before all devices
under the scope of the corresponding DMAR unit are enumerated.
Current code has two problems with that:
- scope lookup returns NULL device_t, which causes to skip creating a
  context with RMRR, which is fatal for the affected device.
- calculation of the final pci dbsf address fails if any bridge in the
  scope is not yet enumerated, because code relies on pcib_get_bus().

Make creation of contexts work either with device_t, or with DMAR PCI
scope paths.  Scope provides enough information to infer context
address, and it is directly matched against DMAR tables scopes.

When calculating bus addresses for the scope or device, use direct
pci_cfgregread(PCIR_SECBUS_1) to get the secondary bus number, instead
of pcib_get_bus().

The issue was observed on HP Gen servers, where iLO PCI devices are
located behind south bridge switch.  Turning on translation without
satisfying RMRR requests caused iLO to mostly hang, up to the level of
being unusable to control the server.

While there, remove hw.dmar.dmar_match_verbose tunable, and make the
normal logging under bootverbose useful and sufficient to diagnose
DRHD and RMRR parsing and matching.

Sponsored by: Mellanox Technologies
MFC after: 1 week

5 years agoRemove witness warning. dmar_bus_dmamap_create() does not sleep.
kib [Thu, 18 Apr 2019 14:03:59 +0000 (14:03 +0000)]
Remove witness warning. dmar_bus_dmamap_create() does not sleep.

Sponsored by: Mellanox Technologies
MFC after: 1 week

5 years agoReduce verbosity, do not announce details of irte programming by default.
kib [Thu, 18 Apr 2019 14:02:33 +0000 (14:02 +0000)]
Reduce verbosity, do not announce details of irte programming by default.

Sponsored by: Mellanox Technologies
MFC after: 1 week

5 years agopf: No need to M_NOWAIT in DIOCRSETTFLAGS
kp [Thu, 18 Apr 2019 11:37:44 +0000 (11:37 +0000)]
pf: No need to M_NOWAIT in DIOCRSETTFLAGS

Now that we don't hold a lock during DIOCRSETTFLAGS memory allocation we can
use M_WAITOK.

MFC after: 1 week
Event: Aberdeen hackathon 2019
Pointed out by: glebius@

5 years agoAdd a bugs section to pflog man page
thj [Thu, 18 Apr 2019 11:06:45 +0000 (11:06 +0000)]
Add a bugs section to pflog man page

FreeBSD does not set the pid field in the pfloghdr struct. This field is
populated on other platforms, document this to save people from trying
to use this field.

Event: Aberdeen hackathon 2019
Reviewed by: kp, bcr, bz
Approved by: bz (mentor)
Differential Revision: https://reviews.freebsd.org/D19952

5 years agopf tests: Fail the test if we can't set the rules
kp [Thu, 18 Apr 2019 10:54:08 +0000 (10:54 +0000)]
pf tests: Fail the test if we can't set the rules

The test should fail if pf rules can't be set. This is helpful both
while writing tests and to verify that pfctl works as expected.

MFC after: 1 week
Event: Aberdeen hackathon 2019

5 years agoAdd efi_delenv
imp [Thu, 18 Apr 2019 05:40:50 +0000 (05:40 +0000)]
Add efi_delenv

Add an interface to remove / delete UEFI variables.

5 years agoAdd a more generic efi_setenv function.
imp [Thu, 18 Apr 2019 05:37:18 +0000 (05:37 +0000)]
Add a more generic efi_setenv function.

efi_setenv allows any UEFI variable to be set.

5 years agoAs an interim measure until a more permanent solution is implemented
cy [Thu, 18 Apr 2019 01:02:00 +0000 (01:02 +0000)]
As an interim measure until a more permanent solution is implemented
workaround the following error:

/usr/src/contrib/elftoolchain/strings/strings.c:198:55: error: use of
undeclared identifier
'FA_OPEN' fa = fileargs_init(argc, argv, O_RDONLY, 0, &rights, FA_OPEN);

Reported by: O. Hartmann <ohartmann@walstatt.org>
Reported by: Michael Butler <imb@protected-networks.net>
Reported by: gjb@ & cy@ (implicit)
Reviewed by: emaste@
Noted by: rgrimes@

5 years agoarm: allwinner: Fix audio for Allwinner H3/H5
manu [Wed, 17 Apr 2019 21:45:19 +0000 (21:45 +0000)]
arm: allwinner: Fix audio for Allwinner H3/H5

Due to three conditions the codec driver for Allwinner A10/A20 and H3/H5 did not work properly here:

    Wrong bit position for the analog audio reset
    Hardware Reset of codec was not de-asserted correctly
    Linux DTS file did not contain the address of the analog register the way as the driver was expecting it.

This patch proposes fixes for those three parts.

Submitted by: freebsdnewbie@freenet.de (Manuel Stühn)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19910

5 years agoofw_graph: Add functions for graph bindings
manu [Wed, 17 Apr 2019 20:09:01 +0000 (20:09 +0000)]
ofw_graph: Add functions for graph bindings

Those functions are helpers to work on graph bindings.
graphs are mostly use with video related devices.
See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/graph.txt?id=4436a3711e3249840e0679e92d3c951bcaf25515

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19877

5 years agoPut QEMU CI smoke test boot log in /tmp if TMPDIR not set
emaste [Wed, 17 Apr 2019 19:24:41 +0000 (19:24 +0000)]
Put QEMU CI smoke test boot log in /tmp if TMPDIR not set

Sponsored by: The FreeBSD Foundation

5 years agoInstall some entropy for QEMU CI smoke test
emaste [Wed, 17 Apr 2019 19:16:26 +0000 (19:16 +0000)]
Install some entropy for QEMU CI smoke test

See r346250 and followup commits and mailing list discussion.
We currently fail to boot properly in the absense of boot-time entropy.

Sponsored by: The FreeBSD Foundation

5 years agoCompile sha1.c when ether support is included
kevans [Wed, 17 Apr 2019 18:08:28 +0000 (18:08 +0000)]
Compile sha1.c when ether support is included

sha1 is used by ether_gen_addr after r346324. Perhaps in an ideal world we
could detect that the kernel's been compiled without sha1_* bits included
and silently fallback to arc4random instead because these platforms/kernel
configs are far and few between. It's fairly lightweight, though, so just
include it for now.

5 years agoreadelf: use size_t for object counts
emaste [Wed, 17 Apr 2019 17:50:44 +0000 (17:50 +0000)]
readelf: use size_t for object counts

PR: 212539
Reported by: cem
Sponsored by: The FreeBSD Foundation

5 years agoiflib: Use new ether_gen_addr, restricting addresses to that subset
kevans [Wed, 17 Apr 2019 17:19:54 +0000 (17:19 +0000)]
iflib: Use new ether_gen_addr, restricting addresses to that subset

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

5 years agonet: adjust randomized address bits
kevans [Wed, 17 Apr 2019 17:18:43 +0000 (17:18 +0000)]
net: adjust randomized address bits

Give devices that need a MAC a 16-bit allocation out of the FreeBSD
Foundation OUI range. Change the name ether_fakeaddr to ether_gen_addr now
that we're dealing real MAC addresses with a real OUI rather than random
locally-administered addresses.

Reviewed by: bz, rgrimes
Differential Revision: https://reviews.freebsd.org/D19587

5 years agoreadelf: speed up readelf -wo
emaste [Wed, 17 Apr 2019 17:00:16 +0000 (17:00 +0000)]
readelf: speed up readelf -wo

Use an array instead of STAILQ, and sort at the end instead of while
adding new elements.

PR: 212539
Submitted by: Bora Özarslan <borako.ozarslan@gmail.com>
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years ago[casper] fix compilation when casper is disabled.
adrian [Wed, 17 Apr 2019 16:58:38 +0000 (16:58 +0000)]
[casper] fix compilation when casper is disabled.

This triggers an error in gcc-mips 6.4.0 complaining about unused arguments.

Tested:

* compiled/run on mips32; nothing complained.

5 years agocap_fileargs: fix test after r346318
emaste [Wed, 17 Apr 2019 16:45:42 +0000 (16:45 +0000)]
cap_fileargs: fix test after r346318

Reported by: danfe, mjg
MFC after: 3 weeks
MFC with: r346315
Sponsored by: The FreeBSD Foundation

5 years agopf tests: Try to provoke the panic with invalid DIOCRSETTFLAGS
kp [Wed, 17 Apr 2019 16:45:35 +0000 (16:45 +0000)]
pf tests: Try to provoke the panic with invalid DIOCRSETTFLAGS

There was an issue with copyin() on DIOCRSETTFLAGS, which would panic if
pfrio_buffer was NULL.
Test for the issue fixed in r346319.

MFC after: 1 week
Event: Aberdeen hackathon 2019

5 years agopf: Fix panic on invalid DIOCRSETTFLAGS
kp [Wed, 17 Apr 2019 16:42:54 +0000 (16:42 +0000)]
pf: Fix panic on invalid DIOCRSETTFLAGS

If during DIOCRSETTFLAGS pfrio_buffer is NULL copyin() will fault, which we're
not allowed to do with a lock held.
We must count the number of entries in the table and release the lock during
copyin(). Only then can we re-acquire the lock. Note that this is safe, because
pfr_set_tflags() will check if the table and entries exist.

This was discovered by a local syzcaller instance.

MFC after: 1 week
Event: Aberdeen hackathon 2019

5 years agocap_fileargs: fix GCC build, don't shadow 'stat'
emaste [Wed, 17 Apr 2019 16:31:30 +0000 (16:31 +0000)]
cap_fileargs: fix GCC build, don't shadow 'stat'

Reported by: ci.freebsd.org
MFC after: 3 weeks
MFC with: r346315
Sponsored by: The FreeBSD Foundation

5 years agoAllow this test script to be run from within src/tools/boot dir, and create
ian [Wed, 17 Apr 2019 16:27:43 +0000 (16:27 +0000)]
Allow this test script to be run from within src/tools/boot dir, and create
the temporary image in $TMPDIR.

Allow the script to be run from the src/tools/boot directory by using make
-V SRCTOP to find the top of the tree, because this script is handy for
quick smoke-testing of loader changes, as well as being useful in CI testing.

Also, use a temp directory in $TMPDIR to assemble the boot image, and write
the boot log file to $TMPDIR.  Arrange to have the temporary image clean
itself up, but leave the log file in $TMPDIR for post-mortem analysis of
failures when the script is run interactively.

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

5 years agocap_fileargs: chase r346315, update fileargs_init in consumers
emaste [Wed, 17 Apr 2019 16:18:14 +0000 (16:18 +0000)]
cap_fileargs: chase r346315, update fileargs_init in consumers

Reported by: ci.freebsd.org (8 times so far)
MFC after: 3 weeks
MFC with: r346315
Sponsored by: The FreeBSD Foundation

5 years agocap_fileargs: add fileargs_lstat service
emaste [Wed, 17 Apr 2019 16:02:57 +0000 (16:02 +0000)]
cap_fileargs: add fileargs_lstat service

Add fileargs_lstat function to cap_fileargs casper service to be able to
lstat files while in capability mode.  It can only lstat files given in
fileargs_init.

Submitted by: Bora Özarslan <borako.ozarslan@gmail.com>
Reviewed by: oshogbo, cem (partial)
MFC after: 3 weeks
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19548

5 years agocap_fileargs.3: typo and markup corrections
emaste [Wed, 17 Apr 2019 16:00:33 +0000 (16:00 +0000)]
cap_fileargs.3: typo and markup corrections

Submitted by: Bora Özarslan" <borako.ozarslan@gmail.com>
MFC after: 1 week
MFC with: r346313
Sponsored by: The FreeBSD Foundation

5 years agocap_fileargs.3: correct 'filerags' typo
emaste [Wed, 17 Apr 2019 15:48:33 +0000 (15:48 +0000)]
cap_fileargs.3: correct 'filerags' typo

Submitted by: Bora Özarslan" <borako.ozarslan@gmail.com>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoOnly set up the interrupts that will actually be used in arm generic_timer.
ian [Wed, 17 Apr 2019 15:27:11 +0000 (15:27 +0000)]
Only set up the interrupts that will actually be used in arm generic_timer.

The code previously set up interrupt handlers for all the interrupt
resources available, including for timers that are not in use.  That could
lead to interrupt storms.  For example, if boot firmware enabled the virtual
timer but the kernel is using the physical timer, it could get flooded with
interrupts on the virtual timer which it cannot shut off.  By only setting
up an interrupt handler for the hardware that will actually be used, any
interrupts from other timer units will remain masked in the interrupt
controller.

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

5 years agoAdd orphan mentee.
pfg [Wed, 17 Apr 2019 14:20:55 +0000 (14:20 +0000)]
Add orphan mentee.

5 years agoAdd myself to ports committers.
pfg [Wed, 17 Apr 2019 14:12:11 +0000 (14:12 +0000)]
Add myself to ports committers.

Approved by: pfg (mentor)

5 years agofdt: further consolidate DTB building and revise manpage
kevans [Wed, 17 Apr 2019 03:29:16 +0000 (03:29 +0000)]
fdt: further consolidate DTB building and revise manpage

FDT_DTS_FILE was built separately with a rule in sys/conf/files and
recreated the rules we used in dtb.mk. Now that we have other infrastructure
to build a DTB along with the kernel, fold FDT_DTS_FILE into that since it
doesn't have any special requirements.

fdt(4) never got revised to mention the DTS/DTSO make options, so do that
now.

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19736

5 years agoarm: allwinner: Makes more device optional
manu [Tue, 16 Apr 2019 22:42:50 +0000 (22:42 +0000)]
arm: allwinner: Makes more device optional

MFC after: 2 weeks

5 years agoiflibtxrx.9: update function descriptions to match implementation
emaste [Tue, 16 Apr 2019 20:41:04 +0000 (20:41 +0000)]
iflibtxrx.9: update function descriptions to match implementation

isc_rxd_refill, isc_rxd_flush return nothing, not void *.

isc_txd_credits_update, isc_rxd_available return int, not int *.

isc_txd_credits_update has a bool as final argument, not a uint32_t.
Prior to r315217 it took four arguments; the final two were
uint32_t, bool.

Reported by: Gerald Aryeetey <aryeeteygerald_rogers.com>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

5 years agoconfig: Only warn if duplicate option/device comes from the same file
manu [Tue, 16 Apr 2019 20:08:19 +0000 (20:08 +0000)]
config: Only warn if duplicate option/device comes from the same file

This is useful for arm (possibly other arches too) where we want to have
a GENERIC kernel that only include files for the different SoC. Since
multiple SoCs/Board needs the same device we would need to do either :

    Include the device in a generic file
    Include the device in each file that really needs it

Option 1 works but if someone wants to create a specific kernel config
(which isn't uncommon for embedded system), he will need to add a lots
of nodevice to it.

Option 2 also works but produce a lots of warnings.

Reviewed by: kevans
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19424

5 years agoarm: Order files.arm to have cloudabi and annapurna sections
manu [Tue, 16 Apr 2019 20:06:39 +0000 (20:06 +0000)]
arm: Order files.arm to have cloudabi and annapurna sections

MFC after: 2 weeks

5 years agoarm: Add kern_clocksource.c directly in files.arm
manu [Tue, 16 Apr 2019 20:04:22 +0000 (20:04 +0000)]
arm: Add kern_clocksource.c directly in files.arm

This files is needed and included in all our config so move it to a common
location.

MFC after: 2 weeks

5 years agoFix initial x87 state after r345562.
kib [Tue, 16 Apr 2019 19:46:02 +0000 (19:46 +0000)]
Fix initial x87 state after r345562.

After the referenced commit, we did not set x87 and sse valid bits in
the xstate_bv bitmask for initial fpu state (stored in memory), when
using XSAVE.

The state is loaded into FPU register file to initialize the process
FPU state, and since both bits were clear, the default x87 and SSE
states were loaded.  By chance, FreeBSD ABI SSE2 state is same as FPU
initial state, so the bug is not visible for 64bit processes.  But on
i386, the precision control should be set to double (53bit mantissa),
instead of the default double extended (64bit mantissa). For 32bit
processes on amd64, kernel reloads control word with the right mask,
which only left native i386 and amd64 native but using x87 as
affected.

Fix it by setting minimal required xstate_bv mask.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoallwinner: clk: Garbage collect old clock implementation
manu [Tue, 16 Apr 2019 19:38:16 +0000 (19:38 +0000)]
allwinner: clk: Garbage collect old clock implementation

The old clocks are disconneted from the build since r337344.
Remove all those pseudo drivers. The only one remaining is for gmac
(the ethernet controller) so move it to sys/arm/allwinner.
While here remove a83t support from gmacclk as it is unneeded since r326114.

MFC after: 1 month

5 years agostack_protector: Add tunable to bypass random cookies
cem [Tue, 16 Apr 2019 18:47:20 +0000 (18:47 +0000)]
stack_protector: Add tunable to bypass random cookies

This is a stopgap measure to unbreak installer/VM/embedded boot issues
introduced (or at least exposed by) in r346250.

Add the new tunable, "security.stack_protect.permit_nonrandom_cookies," in
order to continue boot with insecure non-random stack cookies if the random
device is unavailable.

For now, enable it by default.  This is NOT safe.  It will be disabled by
default in a future revision.

There is follow-on work planned to use fast random sources (e.g., RDRAND on
x86 and DARN on Power) to seed when the early entropy file cannot be
provided, for whatever reason.  Please see D19928.

Some better hacks may be used to make the non-random __stack_chk_guard
slightly less predictable (from delphij@ and mjg@); those suggestions are
left for a future revision.  I think it may also be plausible to move stack
guard initialization far later in the boot process; potentially it could be
moved all the way to just before userspace is started.

Reported by: many
Reviewed by: delphij, emaste, imp (all w/ caveat: this is a stopgap fix)
Security: yes
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D19927

5 years agorandom(4): Add is_random_seeded(9) KPI
cem [Tue, 16 Apr 2019 17:12:17 +0000 (17:12 +0000)]
random(4): Add is_random_seeded(9) KPI

The imagined use is for early boot consumers of random to be able to make
decisions based on whether random is available yet or not.  One such
consumer seems to be __stack_chk_init(), which runs immediately after random
is initialized.  A follow-up patch will attempt to address that.

Reported by: many
Reviewed by: delphij (except man page)
Approved by: secteam(delphij)
Differential Revision: https://reviews.freebsd.org/D19926

5 years agoReplace cosqos with numa_domain in mbuf pkthdr
gallatin [Tue, 16 Apr 2019 16:49:34 +0000 (16:49 +0000)]
Replace cosqos with numa_domain in mbuf pkthdr

The cosqos field was added nearly 6 years ago in r254804, and it is
still unused by any in-tree consumers.  I have a patchset that I'm
working on which aligns many network resources by NUMA domain,
including inps, inpcb lb group, tcp pacing, lagg output link
selection, backing pages for sendfile, and more.  It reduces
cross-domain traffic by roughly 50% for a real web workload.

This patchset relies on being able to store the numa domain in the
mbuf, and grabbing the unused cosqos field for this purpose is the
first step in starting to usptream it.

Reviewed by: kib, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D19862

5 years agoSigh, r346279 was also a test version with the reduced size doubled (so
bde [Tue, 16 Apr 2019 15:52:04 +0000 (15:52 +0000)]
Sigh, r346279 was also a test version with the reduced size doubled (so
it was actually double the full size in current kernels where the reduction
is null, so overran the mmapped() buffer).

5 years agoOops, r346278 committed a test version with the change annulled.
bde [Tue, 16 Apr 2019 15:41:45 +0000 (15:41 +0000)]
Oops, r346278 committed a test version with the change annulled.

5 years agoQuick fix for slow clearing and context switches of large frame buffers
bde [Tue, 16 Apr 2019 15:31:23 +0000 (15:31 +0000)]
Quick fix for slow clearing and context switches of large frame buffers
with old kernels, by breaking the support for large frame buffers in the
same way as for current kernels.

Large frame buffers may be too large to map into kva, and the kernel
(syscons) only uses the first screen page anyway, so r203535, r205557
and 248799 limit the buffer size in VESA modes to the first screen
page, apparently without noticing that this breaks applications by
using the same limit for user mappings as for kernel mappings.  In
vgl, this makes the virtual screen the same as the physical screen.

However, this is almost a feature since clearing and switching large
(usually mostly unused) frame buffers takes too long.  E.g., on a 16
year old low-end AGP card it takes about 12 seconds to clear the 128MB
frame buffer in old kernels that map it all and also map it with slow
attributes (e.g., uncacheable).  Older PCI cards are even slower, but
usually have less memory.  Newer PCIe cards are faster, but may have
many GB of memory.  Also, vgl malloc()s a shadow buffer with the same
size as the frame buffer, so large frame buffers are even more wasteful
in applications than in the kernel.

Use the same limit in vgl as in newer kernels.

Virtual screens and panning still work in non-VESA modes that have
more than 1 page.  The reduced buffer size in the kernel also breaks
mmap() of the last physical page in modes where the reduced size is
not a multiple of the physical page size.  The same reduction in vgl
only reduces the virtual screen size.

5 years agoFix a variable name in r346215. Clearing of the right of the screen was
bde [Tue, 16 Apr 2019 14:28:33 +0000 (14:28 +0000)]
Fix a variable name in r346215.  Clearing of the right of the screen was
broken, except it worked accidentally in most cases where the virtual
screen is larger than the physical screen.

5 years agoRemove INDEX-10 reference, as 10.x is now EoL.
gjb [Tue, 16 Apr 2019 14:07:14 +0000 (14:07 +0000)]
Remove INDEX-10 reference, as 10.x is now EoL.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agoUpdate and clarify pflog man page
thj [Tue, 16 Apr 2019 13:31:16 +0000 (13:31 +0000)]
Update and clarify pflog man page

The pflog0 interface is created when the module is loaded, this can
be triggered by pf and pflogd being enabled or by kldloading the module.

By default the interface would be pflog0, add the ifconfig stage of the
example to make this example clearer.

Reviewed by: kp, bz, bcr, jtl, 0mp
Approved by: jtl (mentor), bz (mentor)
Differential Revision: https://reviews.freebsd.org/D19861

5 years agocorrect readlinkat(2) return type
emaste [Tue, 16 Apr 2019 13:26:31 +0000 (13:26 +0000)]
correct readlinkat(2) return type

r176215 corrected readlink(2)'s return type and the type of the last
argument.  readlink(2) was introduced in r177788 after being developed
as part of Google Summer of Code 2007; it appears to have inherited the
wrong return type.

Man pages and header files were already ssize_t; update syscalls.master
to match.

PR: 197915
Submitted by: Henning Petersen <henning.petersen@t-online.de>
MFC after: 2 weeks

5 years agoaw_syscon: Add a new compatible
manu [Tue, 16 Apr 2019 12:40:49 +0000 (12:40 +0000)]
aw_syscon: Add a new compatible

Since 5.0 DTS the syscon controller have a new compatible as it
exports new subnodes, we currently only use it as a syscon provider
so just add the new compatible.

Tested On:  H3
MFC after: 1 month

5 years agoaw_rtc: Register the clocks
manu [Tue, 16 Apr 2019 12:39:31 +0000 (12:39 +0000)]
aw_rtc: Register the clocks

Since latest DTS update the rtc is supposed to register two clocks :

- osc32k (the 32k oscillator on the board that the RTC uses directly and
that other peripheral can use)
- iosc (the internal oscillator of the RTC when available which frequency
depend on the SoC revision)

Since we need the RTC before the proper clock control unit (because it uses
those clocks) attach it a BUS_PASS_BUS + MIDDLE and attach the clock control
unit at BUS_PASS_BUS + LAST for the SoC that requires it.

Tested On:      A20, H3, A64

MFC after: 1 month

5 years agoDrop -g from CFLAGS for zfsd(8). No idea why it was ever there.
trasz [Tue, 16 Apr 2019 12:25:15 +0000 (12:25 +0000)]
Drop -g from CFLAGS for zfsd(8).  No idea why it was ever there.

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

5 years agoext2fs: Initial version of DTrace support.
fsu [Tue, 16 Apr 2019 11:37:15 +0000 (11:37 +0000)]
ext2fs: Initial version of DTrace support.

Commit forgotten file.

Reviewed by:    pfg, gnn
MFC after:      1 week

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

5 years agoext2fs: Initial version of DTrace support.
fsu [Tue, 16 Apr 2019 11:20:10 +0000 (11:20 +0000)]
ext2fs: Initial version of DTrace support.

Reviewed by:    pfg, gnn
MFC after:      1 week

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

5 years agoSpecify correct Ethernet phy for RPI-B
peterj [Tue, 16 Apr 2019 09:44:46 +0000 (09:44 +0000)]
Specify correct Ethernet phy for RPI-B

Correct a typo in the RPI-B ethernet config - the RPi-B includes a
SMC LAN9512 USB bridge and Ethernet 10/100 NIC/phy.  The phy part of
this is supported by smscphy.

Tested On: RPi1 Model B

Approved by: grog, jhb (mentors)
MFC after: 3 days

5 years agoFix cpufreq(4) on RPI-B
peterj [Tue, 16 Apr 2019 09:42:42 +0000 (09:42 +0000)]
Fix cpufreq(4) on RPI-B

Since r324184 the root node compatible for the original Raspberry Pi
is "brcm,bcm2835", add it to the compatible list of bcm2835_cpufreq.

Tested On: RPi1 Model B

Note that the default Das U-Boot FDT does not include a cpus clause
so actually adding a bcm2835_cpufreq device requires adding a FDT
overlay defining the cpu.

Approved by: grog, jhb (mentors)
MFC after: 3 days

5 years agoDocument when I received my commit bits.
cy [Tue, 16 Apr 2019 05:11:39 +0000 (05:11 +0000)]
Document when I received my commit bits.

5 years agotcpdump: disable Capsicum if -E option is provided.
oshogbo [Tue, 16 Apr 2019 04:12:41 +0000 (04:12 +0000)]
tcpdump: disable Capsicum if -E option is provided.

The -E is used to provide a secret for decrypting IPsec.
The secret may be provided through command line or as the file.
The problem is that tcpdump doesn't support yet opening files in capability mode
and the file may contain a list of the files to open.

As a workaround, for now, let's just disable capsicum if the -E
the option is provided.

PR: 236819
MFC after: 2 weeks

5 years agoImprove tpm20 style
mw [Tue, 16 Apr 2019 02:46:21 +0000 (02:46 +0000)]
Improve tpm20 style

No functional changes to the code are applied.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield

5 years agotpm: Prevent session hijack
mw [Tue, 16 Apr 2019 02:28:35 +0000 (02:28 +0000)]
tpm: Prevent session hijack

Check caller thread id before allowing to read the buffer
to make sure that it can only be accessed by the thread that
did the associated write to the TPM.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: delphij
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D19713

5 years agoFix 'jot -r 0 start end' to work.
bdrewery [Tue, 16 Apr 2019 00:41:22 +0000 (00:41 +0000)]
Fix 'jot -r 0 start end' to work.

This allows an endless stream of random data within the given bounds.
It already worked if a seed was provided as the 4th argument but not
if one was left out.

In collaboration with: jhb
MFC after: 2 weeks
Relnotes: yes

5 years agoconfig(8): replace opteq with a call to strcasecmp
kevans [Mon, 15 Apr 2019 21:20:06 +0000 (21:20 +0000)]
config(8): replace opteq with a call to strcasecmp

This obscures the comparison slightly less; when option name appear in
files, they are case-insensitive.

MFC after: 1 week

5 years agoAdd myself to committer list.
pkubaj [Mon, 15 Apr 2019 19:21:45 +0000 (19:21 +0000)]
Add myself to committer list.

Approved by: tcberner (mentor)

5 years agocron(8): Add MAILFROM ability for crontabs
kevans [Mon, 15 Apr 2019 18:53:28 +0000 (18:53 +0000)]
cron(8): Add MAILFROM ability for crontabs

This changes the sender mail address in a similar fashion to how MAILTO may
change the recipient. The default from address remains unchanged.

MFC after: 1 week

5 years agorandom.3: Clarify confusing summary
cem [Mon, 15 Apr 2019 18:49:04 +0000 (18:49 +0000)]
random.3: Clarify confusing summary

random.3 is only "better" in contrast to rand.3.  Both are non-cryptographic
pseudo-random number generators.  The opening blurbs of each's DESCRIPTION
section does emphasize this, and correctly directs unfamiliar developers to
arc4random(3).  However, the summary (".Nd" or Name description) of random.3
conflicted in tone and message with that warning.

Resolve the conflict by clarifying in the Nd section that random(3) is
non-cryptographic and pseudo-random.  Elide the "better" qualifier which
implied a comparison but did not provide a specific object to contrast.

Sponsored by: Dell EMC Isilon

5 years agorandom(4): Block read_random(9) on initial seeding
cem [Mon, 15 Apr 2019 18:40:36 +0000 (18:40 +0000)]
random(4): Block read_random(9) on initial seeding

read_random() is/was used, mostly without error checking, in a lot of
very sensitive places in the kernel -- including seeding the widely used
arc4random(9).

Most uses, especially arc4random(9), should block until the device is seeded
rather than proceeding with a bogus or empty seed.  I did not spy any
obvious kernel consumers where blocking would be inappropriate (in the
sense that lack of entropy would be ok -- I did not investigate locking
angle thoroughly).  In many instances, arc4random_buf(9) or that family
of APIs would be more appropriate anyway; that work was done in r345865.

A minor cleanup was made to the implementation of the READ_RANDOM function:
instead of using a variable-length array on the stack to temporarily store
all full random blocks sufficient to satisfy the requested 'len', only store
a single block on the stack.  This has some benefit in terms of reducing
stack usage, reducing memcpy overhead and reducing devrandom output leakage
via the stack.  Additionally, the stack block is now safely zeroed if it was
used.

One caveat of this change is that the kern.arandom sysctl no longer returns
zero bytes immediately if the random device is not seeded.  This means that
FreeBSD-specific userspace applications which attempted to handle an
unseeded random device may be broken by this change.  If such behavior is
needed, it can be replaced by the more portable getrandom(2) GRND_NONBLOCK
option.

On any typical FreeBSD system, entropy is persisted on read/write media and
used to seed the random device very early in boot, and blocking is never a
problem.

This change primarily impacts the behavior of /dev/random on embedded
systems with read-only media that do not configure "nodevice random".  We
toggle the default from 'charge on blindly with no entropy' to 'block
indefinitely.'  This default is safer, but may cause frustration.  Embedded
system designers using FreeBSD have several options.  The most obvious is to
plan to have a small writable NVRAM or NAND to persist entropy, like larger
systems.  Early entropy can be fed from any loader, or by writing directly
to /dev/random during boot.  Some embedded SoCs now provide a fast hardware
entropy source; this would also work for quickly seeding Fortuna.  A 3rd
option would be creating an embedded-specific, more simplistic random
module, like that designed by DJB in [1] (this design still requires a small
rewritable media for forward secrecy).  Finally, the least preferred option
might be "nodevice random", although I plan to remove this in a subsequent
revision.

To help developers emulate the behavior of these embedded systems on
ordinary workstations, the tunable kern.random.block_seeded_status was
added.  When set to 1, it blocks the random device.

I attempted to document this change in random.4 and random.9 and ran into a
bunch of out-of-date or irrelevant or inaccurate content and ended up
rototilling those documents more than I intended to.  Sorry.  I think
they're in a better state now.

PR: 230875
Reviewed by: delphij, markm (earlier version)
Approved by: secteam(delphij), devrandom(markm)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D19744

5 years agoRemove superfluous USB keyword.
hselasky [Mon, 15 Apr 2019 17:32:38 +0000 (17:32 +0000)]
Remove superfluous USB keyword.

Discussed with: danfe@
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agomlx5en: Enable new pfil(9) KPI ethernet filtering hooks
gallatin [Mon, 15 Apr 2019 17:14:50 +0000 (17:14 +0000)]
mlx5en: Enable new pfil(9) KPI ethernet filtering hooks

This allows efficient filtering at packet ingress on mlx5en.

Note that the packets are filtered (and potentially dropped) *before*
the driver has committed to (re)allocating an mbuf for the
packet. Dropped packets are treated essentially the same as an
error. Nothing is allocated, and the existing buffer is recycled. This
allows us to drop malicious packets at close to line rate with very
little CPU use.

Reviewed by: hselasky, slavash, kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D19063

5 years agoFix spelling.
hselasky [Mon, 15 Apr 2019 14:32:19 +0000 (14:32 +0000)]
Fix spelling.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdd quirk for ignoring SPCR AccessWidth values on the PL011 UART
emaste [Mon, 15 Apr 2019 13:41:53 +0000 (13:41 +0000)]
Add quirk for ignoring SPCR AccessWidth values on the PL011 UART

The SPCR table on the Lenovo HR330A Ampere eMAG server indicates 8-bit
access, but 32-bit access is required for the PL011 to work.

PL011 on SBSA platforms always supports 32-bit access (and that was
hardcoded here before my EC2 fix), let's use 32-bit access for PL011
and 32BIT interface types.

Tested by emaste on Ampere eMAG and Cavium/Marvell ThunderX2.

Submitted by: Greg V <greg@unrelenting.technology>
Reviewed by: andrew, imp (earlier)
Differential Revision: https://reviews.freebsd.org/D19507

5 years agoFix order of destructors between main binary and libraries.
kib [Mon, 15 Apr 2019 13:03:09 +0000 (13:03 +0000)]
Fix order of destructors between main binary and libraries.

Since inits for the main binary are run from rtld (for some time), the
rtld_exit atexit(3) handler, which is passed from rtld to the program
entry and installed by csu, is installed after any atexit(3) handlers
installed by main binary constructors.  This means that rtld_exit() is
fired before main binary handlers.

Typical C++ static constructors are executed from init (either binary
or libs) but use atexit(3) to ensure that destructors are called in
the right order, independent of the linking order.  Also, C++
libraries finalizers call __cxa_finalize(3) to flush library'
atexit(3) entries.  Since atexit(3) entry is cleared after being run,
this would be mostly innocent, except that, atexit(rtld_exit) done
after main binary constructors, makes destructors from libraries
executed before destructors for main.

Fix by reordering atexit(rtld_exit) before inits for main binary, same
as it happened when inits were called by csu.  Do it using new private
libc symbol with pre-defined ABI.

Reported. tested, and reviewed by: kan
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoDon't cast result from malloc().
delphij [Mon, 15 Apr 2019 06:33:05 +0000 (06:33 +0000)]
Don't cast result from malloc().

MFC after: 2 weeks

5 years agolibnv: extend the tests
oshogbo [Mon, 15 Apr 2019 03:32:01 +0000 (03:32 +0000)]
libnv: extend the tests

Add cases for sending file descriptors.

Submitted by: Mindaugas Rasiukevicius <rmind@noxt.eu>
MFC after: 2 weeks

5 years agolibnv: add support for nvlist_send()/nvlist_recv() on Linux
oshogbo [Mon, 15 Apr 2019 03:31:02 +0000 (03:31 +0000)]
libnv: add support for nvlist_send()/nvlist_recv() on Linux

This may be useful for cross build in the feature.

Submitted by: Mindaugas Rasiukevicius <rmind@noxt.eu>
MFC after: 2 weeks

5 years agoFix the NFSv4 client to safely find processes.
rmacklem [Mon, 15 Apr 2019 01:27:15 +0000 (01:27 +0000)]
Fix the NFSv4 client to safely find processes.

r340744 broke the NFSv4 client, because it replaced pfind_locked() with a
call to pfind(), since pfind() acquires the sx lock for the pid hash and
the NFSv4 already holds a mutex when it does the call.
The patch fixes the problem by recreating a pfind_any_locked() and adding the
functions pidhash_slockall() and pidhash_sunlockall to acquire/release
all of the pid hash locks.
These functions are then used by the NFSv4 client instead of acquiring
the allproc_lock and calling pfind().

Reviewed by: kib, mjg
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19887

5 years agold-elf.so: make LD_DEBUG always functional.
kib [Sun, 14 Apr 2019 18:04:53 +0000 (18:04 +0000)]
ld-elf.so: make LD_DEBUG always functional.

This causes some increase of the dynamic linker size, but benefits of
avoiding compiling private copy or the linker when debugging is
required. definitely worth it.

The dbg() calls can be compiled out by defining LD_NO_DEBUG symbol.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoFor writing and reading single pixels, avoid some pessimizations for
bde [Sun, 14 Apr 2019 13:37:50 +0000 (13:37 +0000)]
For writing and reading single pixels, avoid some pessimizations for
depths > 8.  Add some smaller optimizations for these depths.  Use a
more generic method for all depths >= 8, although this gives tiny
pessimizations for these depths.

For clearing the whole frame buffer, avoid the same pessimizations
for depths > 8.  Add some larger optimizations for these depths.  Use
an even more generic method for all depths >= 8 to give the optimizations
for depths > 8 and a tiny pessimization for depth 8.

The main pessimization was that old versions of bcopy() copy 1 byte at a
time for all trailing bytes.  (i386 still does this.  amd64 now pessimizzes
large sizes instead of small ones if the CPU supports ERMS.  dev/fb gets
this wrong by mostly not using the bcopy() family or the technically correct
bus space functions but by mostly copying 2 bytes at a time using an
unoptimized loop without even volatile declarations to prevent the compiler
rewriting it.)

The sizes here are 1, 2, 3 or 4 bytes, so depths 9-16 were up to twice as
slow as necessary and depths 17-24 were up to 3 times slower than necessary.
Fix this (except depths 17-24 are still up to 2 times slower than necessary)
by using (builtin) memcpy() instead of bcopy() and reorganizing so that the
complier can see the small constant sizes.  Reduce special cases while
reorganizing although this is slightly slower than adding special cases.
The compiler inlining (and even -O2 vs -O0) makes little difference compared
with reducing the number of accesses except on modern hardware it gives a
small improvement.

Clearing was also pessimized mainly by the extra accesses.  Fix it quite
differently by creating a MEMBUF containing 1 line (in fast memory using
a slow method) and copying this.  This is only slightly slower than reducing
everything to efficient memset()s and bcopy()s, but simpler, especially
for the segmented case.  This works for planar modes too, but don't use it
then since the old method was actually optimal for planar modes (it works
by moving the slow i/o instructions out of inner loops), while for direct
modes the slow instructions were all in the invisible inner loop in bcopy().

Use htole32() and le32toh() and some type puns instead of unoptimized
functions for converting colors.  This optimization is mostly in the noise.
libvgl is only supported on x86, so it could hard-code the assumption that
the byte order is le32, but the old conversion functions didn't hard-code
this.

5 years agoWhen sending a routing message, don't allow the user to set the
tuexen [Sun, 14 Apr 2019 10:18:14 +0000 (10:18 +0000)]
When sending a routing message, don't allow the user to set the
RTF_RNH_LOCKED flag in rtm_flags, since this flag is used only
internally.

Reported by: syzbot+65c676f5248a13753ea0@syzkaller.appspotmail.com
Reviewed by: ae@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19898

5 years agoFix warnings with lib/libpmc
ngie [Sun, 14 Apr 2019 00:06:49 +0000 (00:06 +0000)]
Fix warnings with lib/libpmc

* Use `MIN` instead of similar hand rolled macro.
* Sort headers.
* Use `errno.h` instead of `sys/errno.h`.
* Wrap the argument to sizeof in parentheses for clarity.
* Remove `__BSD_VISIBLE` and `_XOPEN_SOURCE` #defines to mute warnings about
  incompatible snprintf definitions.

This fixes a number of warnings I've been seeing lately in my builds.

Sort makefile variables per style.Makefile(9) (`CFLAGS`/`CWARNFLAG.gcc`) and
bump `WARNS` to 3.

MFC after: 2 weeks
Reviewed by: jtl
Approved by: jtl (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19851

5 years agoRevert r345171 pending review
chuck [Sat, 13 Apr 2019 23:37:27 +0000 (23:37 +0000)]
Revert r345171 pending review

Backing out commit pending further discussion on the PCIe version
supported by pseudo (i.e. emulated) devices. See Differential for
details.

Reviewed by: imp
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D19580

5 years agoFix printing of the line that starts with "LocalOpen...".
rmacklem [Sat, 13 Apr 2019 23:26:02 +0000 (23:26 +0000)]
Fix printing of the line that starts with "LocalOpen...".

When "nfsstat -E -c" was done, the title line starting with "LocalOpen..."
was not being displayed. This was introduced by r328588.

MFC after: 2 weeks

5 years agoAdd support for INET6 addresses to the kernel code that dumps open/lock state.
rmacklem [Sat, 13 Apr 2019 22:00:09 +0000 (22:00 +0000)]
Add support for INET6 addresses to the kernel code that dumps open/lock state.

PR#223036 reported that INET6 callback addresses were not printed by
nfsdumpstate(8). This kernel patch adds INET6 addresses to the dump structure,
so that nfsdumpstate(8) can print them out, post-r346190.
The patch also includes the addition of #ifdef INET, INET6 as requested
by bz@.

PR: 223036
Reviewed by: bz, rgrimes
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19839

5 years agoFix nfsdumpstate(8) so that it can print out INET6 callback addresses.
rmacklem [Sat, 13 Apr 2019 21:45:45 +0000 (21:45 +0000)]
Fix nfsdumpstate(8) so that it can print out INET6 callback addresses.

The patch adds support for printing of INET6 callback addresses.
It also adds the #ifdef INET, INET6 as requested by bz@.

PR: 223036
Reviewed by: bz, rgrimes
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19839

5 years agohexdump(1): Exit gracefully on format strings missing conversion
cem [Sat, 13 Apr 2019 16:51:48 +0000 (16:51 +0000)]
hexdump(1): Exit gracefully on format strings missing conversion

PR: 237263
Submitted by: Bojan Petrovic <bojan_petrovic AT fastmail.fm>

5 years agofusefs: add a fusefs(5) man page
asomers [Sat, 13 Apr 2019 13:59:01 +0000 (13:59 +0000)]
fusefs: add a fusefs(5) man page

PR: 233393
Reported by: tech-lists@zyxst.net
Reviewed by: cem
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19651

5 years agoFollowup to -r344552 in which fsck_ffs checks for a size past the
mckusick [Sat, 13 Apr 2019 13:31:06 +0000 (13:31 +0000)]
Followup to -r344552 in which fsck_ffs checks for a size past the
last allocated block of the file and if that is found, shortens the
file to reference the last allocated block thus avoiding having it
reference a hole at its end.

This update corrects an error where fsck_ffs miscalculated the last
logical block of the file when the file contained a large hole.

Reported by:  Jamie Landeg-Jones
Tested by:    Peter Holm
MFC after:    2 weeks
Sponsored by: Netflix

5 years agonetmap: add test cases for multiple host rings
vmaffione [Sat, 13 Apr 2019 12:50:47 +0000 (12:50 +0000)]
netmap: add test cases for multiple host rings

Extend the netmap unit tests with new test cases for the multiple-host-rings
feature introduced by r345269.

MFC after: 1 week

5 years agoWhen sending IPv4 packets on a SOCK_RAW socket using the IP_HDRINCL option,
tuexen [Sat, 13 Apr 2019 10:47:47 +0000 (10:47 +0000)]
When sending IPv4 packets on a SOCK_RAW socket using the IP_HDRINCL option,
ensure that the ip_hl field is valid. Furthermore, ensure that the complete
IPv4 header is contained in the first mbuf. Finally, move the length checks
before relying on them when accessing fields of the IPv4 header.
Reported by: jtl@
Reviewed by: jtl@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19181

5 years agoMove mpr/mps drivers from per-arch NOTES files into the MI notes
imp [Sat, 13 Apr 2019 06:30:45 +0000 (06:30 +0000)]
Move mpr/mps drivers from per-arch NOTES files into the MI notes
file. They are in more arches they they aren't. Add appropriate
nodevice directives in powerpc and arm.

5 years agoFix sbttons for values > 2s
imp [Sat, 13 Apr 2019 04:46:35 +0000 (04:46 +0000)]
Fix sbttons for values > 2s

Add test against negative times. Add code to cope with larger values
properly.

Discussed with: bde@ (quite some time ago, for an earlier version)

5 years agosort(1): Memoize MD5 computation to reduce repeated computation
cem [Sat, 13 Apr 2019 04:42:17 +0000 (04:42 +0000)]
sort(1): Memoize MD5 computation to reduce repeated computation

Experimentally, reduces sort -R time of a 148160 line corpus from about
3.15s to about 0.93s on this particular system.

There's probably room for improvement using some digest other than md5, but
I don't want to look at sort(1) anymore.  Some discussion of other possible
improvements in the Test Plan section of the Differential.

PR: 230792
Reviewed by: jhb (earlier version)
Differential Revision: https://reviews.freebsd.org/D19885

5 years agoAdd NUMA support to powerpc
jhibbits [Sat, 13 Apr 2019 04:03:18 +0000 (04:03 +0000)]
Add NUMA support to powerpc

Summary:
Initial NUMA support:
    - associate CPU with domain
    - associate memory ranges with domain
    - identify domain for devices
    - limit device interrupt binding to appropriate domain

- Additionally fixes a bug in the setting of Maxmem which led to
  only memory attached to the first socket being enabled for DMA

A pmap variant can opt in to numa support by by calling `numa_mem_regions`
at the end of pmap_bootstrap - registering the corresponding ranges with the
VM.

This yields a ~20% improvement in build times of llvm on dual socket POWER9
over non-NUMA.

Original patch by mmacy.

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

5 years agopowerpc/dtrace: Fix dtrace powerpc asm, and simplify stack walking
jhibbits [Sat, 13 Apr 2019 03:32:21 +0000 (03:32 +0000)]
powerpc/dtrace: Fix dtrace powerpc asm, and simplify stack walking

Fix some execution bugs in the dtrace powerpc asm.  addme pulls in the carry
flag which we don't want, and the result wasn't recorded anyways, so the
following beq to check for exit condition wasn't checking the right
condition.

Simplify the stack walking in dtrace_isa.c, so there's only a single walker
that handles both pc and sp.  This should make it easier to follow, and any
bugfix that may be needed for walking only needs to be made in one place
instead of two now.

MFC after: 2 weeks

5 years agopowerpc: Add file forgotten in r346144
jhibbits [Sat, 13 Apr 2019 02:29:30 +0000 (02:29 +0000)]
powerpc: Add file forgotten in r346144

Forgot to add the changes for DELAY(), which lowers priority during the
delay period.  Also, mark the timebase read as volatile so newer GCC does
not optimize it away, as it reportedly does currently.

MFC after: 2 weeks
MFC with: r346144

5 years agoFix SCSI sense data pass through.
mav [Fri, 12 Apr 2019 18:54:09 +0000 (18:54 +0000)]
Fix SCSI sense data pass through.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

5 years agoSuppress old gcc warning about null format string
lwhsu [Fri, 12 Apr 2019 18:35:14 +0000 (18:35 +0000)]
Suppress old gcc warning about null format string

This is workaround to make head build on gcc using architectures

Sponsored by: The FreeBSD Foundation
MFC-with: r346149

5 years agoFix thread name buffer overflow.
mav [Fri, 12 Apr 2019 18:13:57 +0000 (18:13 +0000)]
Fix thread name buffer overflow.

MFC after: 1 week

5 years agoDo not access mutex memory after unlock.
kib [Fri, 12 Apr 2019 17:27:19 +0000 (17:27 +0000)]
Do not access mutex memory after unlock.

PR: 237195
Reported by: freebsd@hurrikhan.eu
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

5 years agoIgnore doomed vnodes in tmpfs_update_mtime().
kib [Fri, 12 Apr 2019 17:11:50 +0000 (17:11 +0000)]
Ignore doomed vnodes in tmpfs_update_mtime().

Otherwise we might dereference NULL vp->v_data after
VP_TO_TMPFS_NODE().

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week