]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoExplicitly initialize the memory buffer to store O_ICMP6TYPE opcode.
Andrey V. Elsukov [Tue, 15 Oct 2019 09:50:02 +0000 (09:50 +0000)]
Explicitly initialize the memory buffer to store O_ICMP6TYPE opcode.

By default next_cmd() initializes only first u32 of opcode. O_ICMP6TYPE
opcode has array of bit masks to store corresponding ICMPv6 types.
An opcode that precedes O_ICMP6TYPE, e.g. O_IP6_DST, can have variable
length and during opcode filling it can modify memory that will be used
by O_ICMP6TYPE opcode. Without explicit initialization this leads to
creation of wrong opcode.

Reported by: Boris N. Lytochkin
Obtained from: Yandex LLC
MFC after: 3 days

4 years agoboot1.efi: provide generic exit() and stub getchar()
Toomas Soome [Tue, 15 Oct 2019 08:33:05 +0000 (08:33 +0000)]
boot1.efi: provide generic exit() and stub getchar()

panic() is expecting us to have exit and getchar, lets provide those.

4 years agotests: basic VLAN test
Kristof Provost [Tue, 15 Oct 2019 04:50:08 +0000 (04:50 +0000)]
tests: basic VLAN test

Set up two jails connected by an epair. Create VLAN interfaces in both
jails and check connectivity.

This is a very basic test, but exposed panics during the network stack
epoch work, so this is worth testing.

4 years ago(6/6) Convert pmap to expect busy in write related operations now that all
Jeff Roberson [Tue, 15 Oct 2019 03:51:46 +0000 (03:51 +0000)]
(6/6) Convert pmap to expect busy in write related operations now that all
callers hold it.

This simplifies pmap code and removes a dependency on the object lock.

Reviewed by:    kib, markj
Tested by:      pho
Sponsored by:   Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21596

4 years ago(5/6) Move the VPO_NOSYNC to PGA_NOSYNC to eliminate the dependency on the
Jeff Roberson [Tue, 15 Oct 2019 03:48:22 +0000 (03:48 +0000)]
(5/6) Move the VPO_NOSYNC to PGA_NOSYNC to eliminate the dependency on the
object lock in vm_page_set_validclean().

Reviewed by:    kib, markj
Tested by:      pho
Sponsored by:   Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21595

4 years ago(4/6) Protect page valid with the busy lock.
Jeff Roberson [Tue, 15 Oct 2019 03:45:41 +0000 (03:45 +0000)]
(4/6) Protect page valid with the busy lock.

Atomics are used for page busy and valid state when the shared busy is
held.  The details of the locking protocol and valid and dirty
synchronization are in the updated vm_page.h comments.

Reviewed by:    kib, markj
Tested by:      pho
Sponsored by:   Netflix, Intel
Differential Revision:        https://reviews.freebsd.org/D21594

4 years ago(3/6) Add a shared object busy synchronization mechanism that blocks new page
Jeff Roberson [Tue, 15 Oct 2019 03:41:36 +0000 (03:41 +0000)]
(3/6) Add a shared object busy synchronization mechanism that blocks new page
busy acquires while held.

This allows code that would need to acquire and release a very large number
of page busy locks to use the old mechanism where busy is only checked and
not held.  This comes at the cost of false positives but never false
negatives which the single consumer, vm_fault_soft_fast(), handles.

Reviewed by:    kib
Tested by:      pho
Sponsored by:   Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21592

4 years ago(2/6) Don't release xbusy in vm_page_remove(), defer to vm_page_free_prep().
Jeff Roberson [Tue, 15 Oct 2019 03:38:02 +0000 (03:38 +0000)]
(2/6) Don't release xbusy in vm_page_remove(), defer to vm_page_free_prep().

This persists busy state across operations like rename and replace.

Reviewed by:    kib, markj
Tested by:      pho
Sponsored by:   Netflix, Intel
Differential Revision:  https://reviews.freebsd.org/D21549

4 years agopowerpc/atomic: Fix atomic_cmpset_rel()
Justin Hibbits [Tue, 15 Oct 2019 03:37:21 +0000 (03:37 +0000)]
powerpc/atomic: Fix atomic_cmpset_rel()

Need a release barrier, not an acquire barrier, else bad things happen.

4 years ago(1/6) Replace busy checks with acquires where it is trival to do so.
Jeff Roberson [Tue, 15 Oct 2019 03:35:11 +0000 (03:35 +0000)]
(1/6) Replace busy checks with acquires where it is trival to do so.

This is the first in a series of patches that promotes the page busy field
to a first class lock that no longer requires the object lock for
consistency.

Reviewed by: kib, markj
Tested by: pho
Sponsored by: Netflix, Intel
Differential Revision: https://reviews.freebsd.org/D21548

4 years agoarm: allwinner: Add np and nmm clock file to the build
Emmanuel Vadot [Mon, 14 Oct 2019 22:29:20 +0000 (22:29 +0000)]
arm: allwinner: Add np and nmm clock file to the build

MFC after: 1 month

4 years agoarm64: Add Synopsys DWC3 driver
Emmanuel Vadot [Mon, 14 Oct 2019 22:27:33 +0000 (22:27 +0000)]
arm64: Add Synopsys DWC3 driver

This add a driver for the Synopsys DWC3 driver found on multiple SoCs.
It only supports host mode for now.

MFC after: 1 month

4 years agoarm64: allwinner: Add aw_dwc3 driver
Emmanuel Vadot [Mon, 14 Oct 2019 22:22:19 +0000 (22:22 +0000)]
arm64: allwinner: Add aw_dwc3 driver

This is a simplebus like driver that just deal with clocks and resets
and attach the dwc3 child node.

MFC after: 1 month

4 years agoarm64: allwinner: Add support for the usb3 phy
Emmanuel Vadot [Mon, 14 Oct 2019 21:58:46 +0000 (21:58 +0000)]
arm64: allwinner: Add support for the usb3 phy

The usb 3 controller in the H6 SoC have a dedicated phy.
Add support for it.
Mostly imported from NetBSD

MFC after: 1 month

4 years agoarm64: allwinner: aw_usbphy: Add support for H6 PHY
Emmanuel Vadot [Mon, 14 Oct 2019 21:56:41 +0000 (21:56 +0000)]
arm64: allwinner: aw_usbphy: Add support for H6 PHY

MFC after: 1 month

4 years agoarm64: allwinner: Add H6 GPIO/Pinctrl driver
Emmanuel Vadot [Mon, 14 Oct 2019 21:55:45 +0000 (21:55 +0000)]
arm64: allwinner: Add H6 GPIO/Pinctrl driver

This adds support for Allwinner H6 GPIO and pinctrl driver for
both the main pinctrl unit and the 'r_' one.

MFC after: 1 month

4 years agoarm64: allwinner: Add Allwinner H6 Support
Emmanuel Vadot [Mon, 14 Oct 2019 21:53:53 +0000 (21:53 +0000)]
arm64: allwinner: Add Allwinner H6 Support

This adds support for H6 SoC.
Add a CCU driver for H6 that support all PLLs and most of the clocks
that we are intersted in for now (i2c, mmc, usb, etc ...)

MFC after: 1 month

4 years agoarm: allwinner: Disable the clock before changing it's freq
Emmanuel Vadot [Mon, 14 Oct 2019 21:50:44 +0000 (21:50 +0000)]
arm: allwinner: Disable the clock before changing it's freq

You aren't supposed to changing the freq of a clock when it is
enable so disable the clock before changing the freq and then
re-enable it.

MFC after: 1 month

4 years agoarm64: allwinner: Add aw_clk_nmm clock
Emmanuel Vadot [Mon, 14 Oct 2019 21:49:07 +0000 (21:49 +0000)]
arm64: allwinner: Add aw_clk_nmm clock

This is a clock type present on Allwinner H6 where the formula is :
f = fparent * n / m0 / m1

MFC after: 1 month

4 years agoarm64: allwinner: Add new clock aw_clk_np
Emmanuel Vadot [Mon, 14 Oct 2019 21:47:20 +0000 (21:47 +0000)]
arm64: allwinner: Add new clock aw_clk_np

This is a clock type present in Allwinner H6 where the formula is :
f = fparent * N / P

MFC after: 1 month

4 years agoaw_ccung: Add more debug printfs
Emmanuel Vadot [Mon, 14 Oct 2019 21:45:15 +0000 (21:45 +0000)]
aw_ccung: Add more debug printfs

No functional changes

MFC after: 1 month

4 years agoDisconnect powerpc from the default tinderbox for now.
John Baldwin [Mon, 14 Oct 2019 21:22:42 +0000 (21:22 +0000)]
Disconnect powerpc from the default tinderbox for now.

The wrong toolchain was set in MAKE_PARAMS_powerpc, however, there are
some other issues preventing powerpc from building in tinderbox:

1) There is no powerpc-gcc and powerpc-xtoolchain-gcc port that
   provides an external 32-bit powerpc GCC toolchain.

2) On other targets, the same toolchain can build all of the
   architectures for a given target.  MIPS achieves this by always
   setting -mabi and -EB/-EL explicitly instead of relying on the
   compiler's default architecture.  PowerPC might be able to do the
   same thing, but as of today, powerpc-gcc would be required for
   powerpc and powerpcspe and powerpc64-gcc would be required for
   powerpc64.  Our existing logic for make universe does not permit
   per-MACHINE_ARCH toolchains.

I tried hacking TARGETS_powerpc to only include powerpc64 when
powerpc64-gcc was present, and while that skipped the 32-bit worlds,
it tried to build all the kernels.

Reported by: jeff
Discussed with: imp

4 years agoif_delmulti() is never called without ifp argument, assert this instead
Gleb Smirnoff [Mon, 14 Oct 2019 21:18:37 +0000 (21:18 +0000)]
if_delmulti() is never called without ifp argument, assert this instead
of doing a useless search through interfaces.

4 years agox86: Use canonical spelling of MOVDIR64B feature/instruction
Conrad Meyer [Mon, 14 Oct 2019 20:55:01 +0000 (20:55 +0000)]
x86: Use canonical spelling of MOVDIR64B feature/instruction

The former spelling probably confused MOVDIR64B with MOVDIRI64.

MOVDIR_64B is the 64-*byte* direct store instruction; MOVDIR_I64 is the
64-*bit* direct store instruction (underscores added here for clarity; they are
not part of the canonical instruction name).

No functional change.

Sponsored by: Dell EMC Isilon

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:33:14 +0000 (20:33 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: philip

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:32:28 +0000 (20:32 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoSeparate out SCTP related dtrace code.
Michael Tuexen [Mon, 14 Oct 2019 20:32:11 +0000 (20:32 +0000)]
Separate out SCTP related dtrace code.
This is based on work done by markj@.

Discussed with: markj@
MFC after: 3 days

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:32:08 +0000 (20:32 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:31:57 +0000 (20:31 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:31:43 +0000 (20:31 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:31:28 +0000 (20:31 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:30:44 +0000 (20:30 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:30:30 +0000 (20:30 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:30:06 +0000 (20:30 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:29:50 +0000 (20:29 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:29:32 +0000 (20:29 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:29:14 +0000 (20:29 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:26:53 +0000 (20:26 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:26:17 +0000 (20:26 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:23:16 +0000 (20:23 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:22:25 +0000 (20:22 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: hselasky

4 years agoConvert if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:21:02 +0000 (20:21 +0000)]
Convert if_foreach_llmaddr() KPI.

Reviewed by: erj

4 years agoConvert to if_foreach_llmaddr() KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 20:18:36 +0000 (20:18 +0000)]
Convert to if_foreach_llmaddr() KPI.

Reviewed by: gallatin

4 years agoFix powerpc/powerpcspe builds
Leandro Lupori [Mon, 14 Oct 2019 19:06:17 +0000 (19:06 +0000)]
Fix powerpc/powerpcspe builds

Revision 353489 introduced some new function calls in common powerpc code,
but these must be called only on powerpc64.

4 years agoRemove the aarch64 libclang_rt.profile library from llvm 8.0.1.
John Baldwin [Mon, 14 Oct 2019 18:31:11 +0000 (18:31 +0000)]
Remove the aarch64 libclang_rt.profile library from llvm 8.0.1.

Reported by: np

4 years agoRemove an unused parameter from get_new_keyid().
John Baldwin [Mon, 14 Oct 2019 18:02:56 +0000 (18:02 +0000)]
Remove an unused parameter from get_new_keyid().

4 years agoCorrect a transcription error that broke GENERIC introduced in r353496.
Doug Moore [Mon, 14 Oct 2019 17:51:57 +0000 (17:51 +0000)]
Correct a transcription error that broke GENERIC introduced in r353496.

4 years agoMove the definition of _vm_map_assert_consistent so that it can use
Doug Moore [Mon, 14 Oct 2019 17:15:42 +0000 (17:15 +0000)]
Move the definition of _vm_map_assert_consistent so that it can use
vm_map_free_{left,right} rather than re-implementing them.  Use the
VM_MAP_FOREACH macro where applicable.  Fix some indentation.

Suggested by: kib (in a comment on D21964)
Tested by: pho (as part of D21964)
Differential Revision: https://reviews.freebsd.org/D22011

4 years agoUse epoch(9) directly instead of obsoleted KPI.
Gleb Smirnoff [Mon, 14 Oct 2019 16:37:41 +0000 (16:37 +0000)]
Use epoch(9) directly instead of obsoleted KPI.

4 years agoipfw(4) rule matching always happens in network epoch.
Gleb Smirnoff [Mon, 14 Oct 2019 16:37:00 +0000 (16:37 +0000)]
ipfw(4) rule matching always happens in network epoch.

4 years agoFix the driver attachment in cases when the external resource devices
Ruslan Bukin [Mon, 14 Oct 2019 15:52:59 +0000 (15:52 +0000)]
Fix the driver attachment in cases when the external resource devices
(resets, regulators, clocks) are not available.

Rely on a system initialization done by a bootloader in that cases.

This fixes operation on Terasic DE10-Pro (an Intel Stratix 10
development kit).

Sponsored by: DARPA, AFRL

4 years agoin6ifa_llaonifp() is never called from fast path, so do not require
Gleb Smirnoff [Mon, 14 Oct 2019 15:33:53 +0000 (15:33 +0000)]
in6ifa_llaonifp() is never called from fast path, so do not require
epoch being entered.

4 years agoAdd missing port to the list of needed tools in the README file
Eugene Grosbein [Mon, 14 Oct 2019 14:31:21 +0000 (14:31 +0000)]
Add missing port to the list of needed tools in the README file
describing locale rebuild process:

devel/apache-ant

4 years agoif_hw_tsomaxsegsize needs to be initialized to zero, just
Randall Stewart [Mon, 14 Oct 2019 13:10:29 +0000 (13:10 +0000)]
if_hw_tsomaxsegsize needs to be initialized to zero, just
like in bbr.c and tcp_output.c

4 years ago[PPC64] Initial kernel minidump implementation
Leandro Lupori [Mon, 14 Oct 2019 13:04:04 +0000 (13:04 +0000)]
[PPC64] Initial kernel minidump implementation

Based on POWER9BSD implementation, with all POWER9 specific code removed and
addition of new methods in PPC64 MMU interface, to isolate platform specific
code. Currently, the new methods are implemented on pseries and PowerNV
(D21643).

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D21551

4 years agoRename sctp_dtrace_declare.h to sctp_kdtrace.h for consistentcy.
Michael Tuexen [Mon, 14 Oct 2019 13:02:49 +0000 (13:02 +0000)]
Rename sctp_dtrace_declare.h to sctp_kdtrace.h for consistentcy.

MFC after: 3 days

4 years agoSort the id_aa64*_fields arrays to be in alphanumerical order.
Andrew Turner [Mon, 14 Oct 2019 09:29:56 +0000 (09:29 +0000)]
Sort the id_aa64*_fields arrays to be in alphanumerical order.

Sponsored by: DARPA, AFRL

4 years agoFix some "RB_" -> "ARB_" copy and paste nits for text sourced from tree(3).
Lawrence Stewart [Mon, 14 Oct 2019 05:26:42 +0000 (05:26 +0000)]
Fix some "RB_" -> "ARB_" copy and paste nits for text sourced from tree(3).

4 years agoSince EPOCH_TRACE had been moved to opt_global.h, we don't need to waste
Gleb Smirnoff [Mon, 14 Oct 2019 04:17:56 +0000 (04:17 +0000)]
Since EPOCH_TRACE had been moved to opt_global.h, we don't need to waste
extra space in struct thread.

4 years agoRevert r353313. It is not needed with r353357 and is actually incorrect.
Gleb Smirnoff [Mon, 14 Oct 2019 04:10:00 +0000 (04:10 +0000)]
Revert r353313. It is not needed with r353357 and is actually incorrect.

4 years agoFix sample check in hwpmc
Matt Macy [Sun, 13 Oct 2019 22:26:55 +0000 (22:26 +0000)]
Fix sample check in hwpmc

Don't drop samples with callchain pending

Tested by: mjg@

Submitted by: Rajeeb Barman at amd.com
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D17011

4 years agoAdd missing include which breaks builds without VIMAGE.
Michael Tuexen [Sun, 13 Oct 2019 19:58:37 +0000 (19:58 +0000)]
Add missing include which breaks builds without VIMAGE.
The bug was introduced by me in r353480.

Reported by: Michael Butler
MFC after: 3 days

4 years agopowerpc/pmap: Tighten condition for removing tracked pages in Book-E pmap
Justin Hibbits [Sun, 13 Oct 2019 19:33:00 +0000 (19:33 +0000)]
powerpc/pmap: Tighten condition for removing tracked pages in Book-E pmap

There are cases where there's no vm_page_t structure for a given physical
address, such as the CCSR.  In this case, trying to obtain the
md.page_tracked struct member would lead to a NULL dereference, and panic.
Tighten this up by checking for kernel_pmap AND that the page structure
actually exists before dereferencing.  The flag can only be set when it's
tracked in the kernel pmap anyway.

MFC after: 3 weeks

4 years agoUse an event handler to notify the SCTP about IP address changes
Michael Tuexen [Sun, 13 Oct 2019 18:17:08 +0000 (18:17 +0000)]
Use an event handler to notify the SCTP about IP address changes
instead of calling an SCTP specific function from the IP code.
This is a requirement of supporting SCTP as a kernel loadable module.
This patch was developed by markj@, I tweaked a bit the SCTP related
code.

Submitted by: markj@
MFC after: 3 days

4 years agoAdd myself (samm) to calendar.freebsd
Oleksii Samorukov [Sun, 13 Oct 2019 18:03:23 +0000 (18:03 +0000)]
Add myself (samm) to calendar.freebsd

Approved by:    araujo (mentor), krion (mentor)
Differential Revision:  https://reviews.freebsd.org/D21985

4 years agoMove SCTP DTrace probe definitions into a .c file.
Mark Johnston [Sun, 13 Oct 2019 16:14:04 +0000 (16:14 +0000)]
Move SCTP DTrace probe definitions into a .c file.

Previously they were defined in a header which was included exactly
once.  Change this to follow the usual practice of putting definitions
in C files.  No functional change intended.

Discussed with: tuexen
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agotmpfs: use MNTK_NOMSYNC
Mateusz Guzik [Sun, 13 Oct 2019 15:42:41 +0000 (15:42 +0000)]
tmpfs: use MNTK_NOMSYNC

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

4 years agopseudofs: use MNTK_NOMSYNC
Mateusz Guzik [Sun, 13 Oct 2019 15:42:25 +0000 (15:42 +0000)]
pseudofs: use MNTK_NOMSYNC

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

4 years agonullfs: use MNTK_NOMSYNC
Mateusz Guzik [Sun, 13 Oct 2019 15:42:04 +0000 (15:42 +0000)]
nullfs: use MNTK_NOMSYNC

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

4 years agodevfs: use MNTK_NOMSYNC
Mateusz Guzik [Sun, 13 Oct 2019 15:41:47 +0000 (15:41 +0000)]
devfs: use MNTK_NOMSYNC

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

4 years agozfs: use MNTK_NOMSYNC
Mateusz Guzik [Sun, 13 Oct 2019 15:41:30 +0000 (15:41 +0000)]
zfs: use MNTK_NOMSYNC

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

4 years agovfs: add MNTK_NOMSYNC
Mateusz Guzik [Sun, 13 Oct 2019 15:40:34 +0000 (15:40 +0000)]
vfs: add MNTK_NOMSYNC

On many filesystems the traversal is effectively a no-op. Add a way to avoid
the overhead.

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

4 years agovfs: return free vnode batches in sync instead of vfs_msync
Mateusz Guzik [Sun, 13 Oct 2019 15:39:11 +0000 (15:39 +0000)]
vfs: return free vnode batches in sync instead of vfs_msync

It is a more natural fit. vfs_msync only deals with active vnodes.

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

4 years agovlan_config() isn't always called in epoch context.
Gleb Smirnoff [Sun, 13 Oct 2019 15:15:09 +0000 (15:15 +0000)]
vlan_config() isn't always called in epoch context.

Reported by: kp

4 years agoRemove line not needed.
Michael Tuexen [Sun, 13 Oct 2019 09:35:03 +0000 (09:35 +0000)]
Remove line not needed.

Submitted by: markj@
MFC after: 3 days

4 years agoRestore nofaulting operations after r352807
Konstantin Belousov [Sun, 13 Oct 2019 06:56:45 +0000 (06:56 +0000)]
Restore nofaulting operations after r352807

The TDP_NOFAULTING flag should be checked in vm_fault(), not in
vm_fault_trap().  Otherwise kernel accesses to userspace, like
vn_io_fault(), enter vm locking when it should not.

Reported and tested by: pho
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D21992

4 years agoFix the botched field ordering in the last commit. While here, fix
Scott Long [Sun, 13 Oct 2019 05:11:53 +0000 (05:11 +0000)]
Fix the botched field ordering in the last commit.  While here, fix
whitespace, and also reorder the fields so they are easier to read on
an 80 column display (the lines wrapped even before these changes).
Also fix non-standard nomenclature in the Caps code, and update the
man page.

Reported by: rpokala

4 years agoDon't cover in6_ifattach() with network epoch, as it may call into
Gleb Smirnoff [Sun, 13 Oct 2019 04:25:16 +0000 (04:25 +0000)]
Don't cover in6_ifattach() with network epoch, as it may call into
network drivers ioctls, that may sleep.

PR: 241223

4 years agoFix the build after r353458.
Mark Johnston [Sun, 13 Oct 2019 00:08:17 +0000 (00:08 +0000)]
Fix the build after r353458.

MFC with: r353458
Sponsored by: The FreeBSD Foundation

4 years agoFix read past end of struct in ncsw glue code.
Brandon Bergren [Sat, 12 Oct 2019 23:16:17 +0000 (23:16 +0000)]
Fix read past end of struct in ncsw glue code.

The logic in XX_IsPortalIntr() was reading past the end of XX_PInfo.
This was causing it to erroneously return 1 instead of 0 in some
circumstances, causing a panic on the AmigaOne X5000 due to mixing
exclusive and nonexclusive interrupts on the same interrupt line.

Since this code is only called a couple of times during startup, use
a simple double loop instead of the complex read-ahead single loop.

This also fixes a bug where it would never check cpu=0 on type=1.

Approved by: jhibbits (mentor)
Differential Revision: https://reviews.freebsd.org/D21988

4 years agoAdd a missing include of opt_sctp.h.
Mark Johnston [Sat, 12 Oct 2019 23:01:16 +0000 (23:01 +0000)]
Add a missing include of opt_sctp.h.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoAdd a missing include of opt_sctp.h.
Mark Johnston [Sat, 12 Oct 2019 22:58:33 +0000 (22:58 +0000)]
Add a missing include of opt_sctp.h.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoChange from the non-standard nomenclature of "chip" and "card" to the
Scott Long [Sat, 12 Oct 2019 22:27:57 +0000 (22:27 +0000)]
Change from the non-standard nomenclature of "chip" and "card" to the
standard nomenclature of "device" and "vendor" with the "sub" variants.
This changes the printed format, so anything that scrapes and parses
this will need to be adapted.  No compatibility shims are provided,
but this will not be MFC'd.

Reviewed by: jhb, emaste, gtetlow
Approved by: jhb, emaste, gtetlow

4 years ago[PowerPC] force applications linked with lib CSU to have .got
Justin Hibbits [Sat, 12 Oct 2019 20:53:40 +0000 (20:53 +0000)]
[PowerPC] force applications linked with lib CSU to have .got

Summary:
This forces applications linked with lib CSU to have a .got, fixing binaries
linked with LLD9 after secure-plt was enabled on FreeBSD.

Submitted by: Alfredo Dal'Ava Junior (alfredo.junior_eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D21476

4 years agoAllocate device softc from the device domain.
Alexander Motin [Sat, 12 Oct 2019 19:03:07 +0000 (19:03 +0000)]
Allocate device softc from the device domain.

Since we are trying to bind device interrupt threads to the device domain,
it should have sense to make memory often accessed by them local. If domain
is not known, fall back to round-robin.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

4 years agoA comment in subr_devmap.c mentions that devmap_print_table() should
Philip Paeps [Sat, 12 Oct 2019 18:18:11 +0000 (18:18 +0000)]
A comment in subr_devmap.c mentions that devmap_print_table() should
be called on bootverbose.  Do so on RISV-V too.

Submitted by: Nicholas O'Brien <nickisobrien_gmail.com>
Reviewed by: imp, kp
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D21998

4 years agoEnsure that local variables are reset to their initial value when
Michael Tuexen [Sat, 12 Oct 2019 17:57:03 +0000 (17:57 +0000)]
Ensure that local variables are reset to their initial value when
dealing with error cases in a loop over all remote addresses.
This issue was found and reported by OSS_Fuzz in:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18080
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18086
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18121
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18163

MFC after: 3 days

4 years agoCentralize adding OBJCOPY=${XOBJCOPY} to LIB32WMAKEFLAGS.
Brooks Davis [Fri, 11 Oct 2019 21:28:02 +0000 (21:28 +0000)]
Centralize adding OBJCOPY=${XOBJCOPY} to LIB32WMAKEFLAGS.

Reviewed by: emaste, imp
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21983

4 years agocoredump_phnum_test: handle full file system gracefully
Eric van Gyzen [Fri, 11 Oct 2019 21:23:46 +0000 (21:23 +0000)]
coredump_phnum_test: handle full file system gracefully

Skip the test if the file system is full.  That's out of scope
of this test.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

4 years agodevfs_vptocnp(): correct the component name when node is not at top.
Konstantin Belousov [Fri, 11 Oct 2019 18:41:24 +0000 (18:41 +0000)]
devfs_vptocnp(): correct the component name when node is not at top.

Node' cdp.si_name is the full path as provided by make_dev(9), it
should not be returned by VOP_VPTOCNP() when only the last component
is requested.  Use the dirent entry instead.

With this note, handling of VDIR and VCHR nodes only differs in
handling of root vnode, which simplifies and unifies the logic.

Reported by: Li, Zhichao1 <Zhichao_Li1@Dell.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoPlug the rest of undef behavior places that were missed in r337456.
Konstantin Belousov [Fri, 11 Oct 2019 18:37:02 +0000 (18:37 +0000)]
Plug the rest of undef behavior places that were missed in r337456.

There are three more places in msdosfs_fat.c which might shift one
into the sign bit.  While there, fix formatting of KASSERTs.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoRemove an unneeded include of opt_sctp.h.
Mark Johnston [Fri, 11 Oct 2019 17:23:23 +0000 (17:23 +0000)]
Remove an unneeded include of opt_sctp.h.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agomountroot: run statfs after mounting devfs
Kristof Provost [Fri, 11 Oct 2019 17:04:38 +0000 (17:04 +0000)]
mountroot: run statfs after mounting devfs

The usual flow for mounting a file system is to VFS_MOUNT() and then
immediately VFS_STATFS().

That's not done in vfs_mountroot_devfs(), which means the
mp->mnt_stat.f_iosize field is not correctly populated, which in turn
causes us to mark valid aio operations as unsafe (because the io size is
set to 0), ultimately causing the aio_test:md_waitcomplete test to fail.

Reviewed by: mckusick
MFC after: 1 week
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D21897

4 years agofix up r353340, don't assume that fcmpset has strong semantics
Andriy Gapon [Fri, 11 Oct 2019 17:01:02 +0000 (17:01 +0000)]
fix up r353340, don't assume that fcmpset has strong semantics

fcmpset can have two kinds of semantics, weak and strong.
For practical purposes, strong semantics means that if fcmpset fails
then the reported current value is always different from the expected
value.  Weak semantics means that the reported current value may be the
same as the expected value even though fcmpset failed.  That's a so
called "sporadic" failure.

I originally implemented atomic_cas expecting strong semantics, but many
platforms actually have weak one.

Reported by: pkubaj (not confirmed if same issue)
Discussed with: kib, mjg
MFC after: 19 days
X-MFC with: r353340

4 years agoCall devmap_bootstrap in RISC-V machine dependent code to actually create
Philip Paeps [Fri, 11 Oct 2019 16:28:46 +0000 (16:28 +0000)]
Call devmap_bootstrap in RISC-V machine dependent code to actually create
the static device mappings.

While RISC-V support was added to subr_devmap.c in r298631, it was never
actually initialised in the machine dependent code.

Submitted by: Nicholas O'Brien <nickisobrien_gmail.com>
Reviewed by: br, kp
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D21975

4 years agoIncrease the default VMSIZE for raw, qcow2, vhd, and vmdk virtual
Glen Barber [Fri, 11 Oct 2019 16:01:30 +0000 (16:01 +0000)]
Increase the default VMSIZE for raw, qcow2, vhd, and vmdk virtual
machine images due to 'filesystem full' failures.

Sponsored by: Rubicon Communications, LLC (Netgate)

4 years agoMFZol: Fix performance of "zfs recv" with many deletions
Alan Somers [Fri, 11 Oct 2019 14:59:28 +0000 (14:59 +0000)]
MFZol: Fix performance of "zfs recv" with many deletions

This patch fixes 2 issues with the DMU free throttle implemented
in dmu_free_long_range(). The first issue is that get_next_chunk()
was calculating the number of L1 blocks the free would dirty
incorrectly. In some cases involving extremely large files, this
code would greatly overestimate the number of affected L1 blocks,
causing excessive calls to txg_wait_open(). This patch corrects
the calculation.

The second issue is that the free throttle uses the total number
of free'd blocks in all (open, quiescing, and syncing) txgs to
determine whether to throttle. This causes large frees (such as
those created by the first issue) to cause 4 txg syncs before
any further frees were allowed to proceed. This patch ensures
that the accounting is done entirely in a per-txg fashion, so
that frees from a given txg don't affect those that immediately
follow it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
zfsonlinux/zfs@f4c594da94d856c422512a54e48070f890b2685b

Freeing throttle should account for holes

Deletion throttle currently does not account for holes in a file.
This means that it can activate when it shouldn't.
To fix it we switch the throttle to be based on the number of
L1 blocks we will have to dirty when freeing

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alek Pinchuk <apinchuk@datto.com>
zfsonlinux/zfs@65282ee9e06b130f1f0169baf5d9bf0dd8fc1ef9

Submitted by: Alek Pinchuk <pinchuk.alek@gmail.com>
Reviewed by: allanjude
MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D21895

4 years agoamd64 pmap: handle fictitious mappigns with addresses beyond pv_table
Mateusz Guzik [Fri, 11 Oct 2019 14:57:47 +0000 (14:57 +0000)]
amd64 pmap: handle fictitious mappigns with addresses beyond pv_table

There are provisions to do it already with pv_dummy, but new locking code
did not account for it. Previous one did not have the problem because
it hashed the address into the lock array.

While here annotate common vars with __read_mostly and __exclusive_cache_line.

Reported by: Thomas Laus
Tesetd by: jkim, Thomas Laus
Fixes: r353149 ("amd64 pmap: implement per-superpage locks")
Sponsored by: The FreeBSD Foundation

4 years agogcore: Add powerpc64 32-bit gcore support
Justin Hibbits [Fri, 11 Oct 2019 14:17:31 +0000 (14:17 +0000)]
gcore: Add powerpc64 32-bit gcore support

Summary: Add the necessary bits for taking 32-bit gcore coredumps on powerpc64.

Reviewed by: luporl
Differential Revision: https://reviews.freebsd.org/D21954

4 years agogcore: Add aarch64 32-bit core support
Justin Hibbits [Fri, 11 Oct 2019 14:15:50 +0000 (14:15 +0000)]
gcore: Add aarch64 32-bit core support

Summary: Add trivial 32-bit arm cores on aarch64 support for gcore.  This
doesn't handle fpregs.

Reviewed by: #arm, andrew
Sponsored by: Juniper Networks, Inc
Differential Revision: https://reviews.freebsd.org/D21947