]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoFix style inconsistencies near our OpenSSL 1.1.x patch.
jkim [Thu, 27 Feb 2020 22:02:00 +0000 (22:02 +0000)]
Fix style inconsistencies near our OpenSSL 1.1.x patch.

4 years agoFix a white space.
jkim [Thu, 27 Feb 2020 20:46:30 +0000 (20:46 +0000)]
Fix a white space.

4 years agoriscv: Add a GENERIC-NODEBUG (copied from amd64)
brooks [Thu, 27 Feb 2020 20:26:37 +0000 (20:26 +0000)]
riscv: Add a GENERIC-NODEBUG (copied from amd64)

Sponsored by: DARPA

4 years agoMerge commit 7214f7a79 from llvm git (by Sam Elliott):
brooks [Thu, 27 Feb 2020 20:08:46 +0000 (20:08 +0000)]
Merge commit 7214f7a79 from llvm git (by Sam Elliott):

  [RISCV] Lower llvm.trap and llvm.debugtrap

  Summary:
  Until this commit, these have lowered to a call to abort().

  `llvm.trap()` now lowers to `unimp`, which should trap on all systems.

  `llvm.debugtrap()` now lowers to `ebreak`, which is exactly what this
  instruction is for.

  Reviewers: asb, luismarques

  Reviewed By: asb

  Tags: #llvm

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

This fixes miscompilation resulting in linking failures with
INVARIANTS disabled.

Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D23857

4 years agoMerge r358406 from the clang1000-import branch:
dim [Thu, 27 Feb 2020 19:59:17 +0000 (19:59 +0000)]
Merge r358406 from the clang1000-import branch:

Fix the following -Werror warning from clang 10.0.0:

sys/arm/arm/identcpu-v6.c:227:5: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                                if (val & CPUV7_CT_CTYPE_RA)
                                ^
sys/arm/arm/identcpu-v6.c:225:4: note: previous statement is here
                        if (val & CPUV7_CT_CTYPE_WB)
                        ^

This was due to an accidentally inserted tab before the if statement.

MFC after: 3 days

4 years agoFix poor performance of ftp(1) due to small SO_SNDBUF and SO_RCVBUF.
hrs [Thu, 27 Feb 2020 19:49:59 +0000 (19:49 +0000)]
Fix poor performance of ftp(1) due to small SO_SNDBUF and SO_RCVBUF.

ftp(1) from vendor/tnftp always tried the following for
every TCP connection:

1. Get the current buffer length of SO_SNDBUF and SO_RCVBUF
   by getsockopt(2).

2. Invoke setsockopt(2) to set them to the same values
   after checking if they are in a range between 8 KiB to 8 MiB.

This behavior broke dynamic buffer sizing enabled by
default (net.inet.tcp.{recv,send}buf_auto sysctls) and
led to a very poor transfer rate.  The fetch(1) utility
does not have this problem.

This change prevents SO_SNDBUF and SO_RCVBUF from configuring
when the buffer auto-sizing is enabled unless the buffer sizes are
explicitly specified.

PR: 240827
Spotted by: Yuichiro NAITO
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D23732

4 years agoFix broken STARTTLS when SharedMemoryKey is enabled.
hrs [Thu, 27 Feb 2020 19:40:29 +0000 (19:40 +0000)]
Fix broken STARTTLS when SharedMemoryKey is enabled.

OpenSSL 1.1 API patch for sendmail had a bug which
prevented sm_RSA_generate_key() function from working.
This function is used to generate a temporary RSA key
for a shared memory region used for TLS processing.
Note that 12.0 and 12.1-RELEASE include this bug.

This affects only if SM_CONF_SHM compile-time
option (enabled by default) and SharedMemoryKey
run-time option (not enabled by default) in a .cf file are
specified.  The latter corresponds to confSHARED_MEMORY_KEY in
a .mc file.

PR: 242861
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D23734

4 years agoMake linuxulator warn about unsupported getsockopt/setsockopt flags.
trasz [Thu, 27 Feb 2020 19:40:20 +0000 (19:40 +0000)]
Make linuxulator warn about unsupported getsockopt/setsockopt flags.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23791

4 years agoAdd MODULE_PNP_INFO() to autoload the rtwn_pci(4) kernel module.
hrs [Thu, 27 Feb 2020 19:35:17 +0000 (19:35 +0000)]
Add MODULE_PNP_INFO() to autoload the rtwn_pci(4) kernel module.

Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D23807

4 years agoSimplify lazy advance with a 64bit atomic cmpset.
jeff [Thu, 27 Feb 2020 19:05:26 +0000 (19:05 +0000)]
Simplify lazy advance with a 64bit atomic cmpset.

This provides the potential to force a lazy (tick based) SMR to advance
when there are blocking waiters by decoupling the wr_seq value from the
ticks value.

Add some missing compiler barriers.

Reviewed by: rlibby
Differential Revision: https://reviews.freebsd.org/D23825

4 years agoAdd workaround for models which do not follow the ACPI specification strictly.
hrs [Thu, 27 Feb 2020 17:13:57 +0000 (17:13 +0000)]
Add workaround for models which do not follow the ACPI specification strictly.
Extra objects are now simply ignored instead of rejecting everything.

4 years agoUse stream_read() to read all 12 bytes of the RFB client version.
jhb [Thu, 27 Feb 2020 16:51:41 +0000 (16:51 +0000)]
Use stream_read() to read all 12 bytes of the RFB client version.

read() can return a short read, whereas stream_read() waits until the
full version string is read.

Submitted by: Ka Ho Ng <khng300_gmail.com>
Reviewed by: grehan
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23591

4 years agoBetter check for floating point type.
imp [Thu, 27 Feb 2020 15:34:30 +0000 (15:34 +0000)]
Better check for floating point type.

Use __riscv_flen instead of __riscv_float_abi_soft. While the latter works for
userland (and one could argue it's more correct), it fails for the kernel. We
compile the kernel with -mabi=lp64 (eg soft float abi) to avoid floating point
instructions in the kernel. We also compile the kernel -march=rv64imafdc for
hard float kernels (eg those with options FPE), but with -march=rv64imac for
softfloat kernels (eg those with FPE). Since we do this, in the kernel (as in
userland) __riscv_flen will be defined for 'riscv64' and not for 'riscv64sf'.

This also removes the -DMACHINE_ARCH hack now that it's no longer needed.

Longer term, we should return the ABI from the sysctl hw.machine_arch like on
amd64 for i386 binaries.

Suggested by: mhorne@
Differential Revision: https://reviews.freebsd.org/D23813

4 years ago_Static_assert is to be preferred to CTASSERT.
imp [Thu, 27 Feb 2020 15:30:13 +0000 (15:30 +0000)]
_Static_assert is to be preferred to CTASSERT.

Document the existing prefernce that _Static_assert be used in preference to the
old CTASSERT we used to use for compile time assertions.

4 years agoRemove FreeBSD 4 support
imp [Thu, 27 Feb 2020 15:25:31 +0000 (15:25 +0000)]
Remove FreeBSD 4 support

4 years agoRemove FreeBSD 7-9 support from oce
imp [Thu, 27 Feb 2020 15:25:26 +0000 (15:25 +0000)]
Remove FreeBSD 7-9 support from oce

Use newer pci_find_cap API now that the need to remap the old API is gone.

4 years agoRemove support for FreeBSD 7 and 8
imp [Thu, 27 Feb 2020 15:25:21 +0000 (15:25 +0000)]
Remove support for FreeBSD 7 and 8

Also, unifdef -DSFXGE_HAVE_DESCRIBE_INTR since it's now always defined.

4 years agoExtend the range of the return value from nsecs_to_jiffies64() to support
hselasky [Thu, 27 Feb 2020 15:21:05 +0000 (15:21 +0000)]
Extend the range of the return value from nsecs_to_jiffies64() to support
Mesa's drm_syncobj usage, in the LinuxKPI.

While at it optimise the jiffies conversion functions to avoid repeated
and constant calculations.

Submitted by: Greg V <greg@unrelenting.technology>
Differential Revision: https://reviews.freebsd.org/D23846
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoremove stray space symbol in r358380
avg [Thu, 27 Feb 2020 14:27:42 +0000 (14:27 +0000)]
remove stray space symbol in r358380

MFC after: 1 week
X-MFC with: r358380

4 years agouse ZFS_MAX_DATASET_NAME_LEN instead of MAXPATHLEN for dataset names
avg [Thu, 27 Feb 2020 14:21:01 +0000 (14:21 +0000)]
use ZFS_MAX_DATASET_NAME_LEN instead of MAXPATHLEN for dataset names

The change affects only FreeBSD specific code as the common code already
mostly uses the more idiomatic and correct ZFS_MAX_DATASET_NAME_LEN.

MFC after: 1 week

4 years agodsl_dataset_promote_sync: populate 'oldname' before using it
avg [Thu, 27 Feb 2020 14:12:43 +0000 (14:12 +0000)]
dsl_dataset_promote_sync: populate 'oldname' before using it

It's very unlikely that zfsvfs_update_fromname() and
zvol_rename_minors() ever did anything during the promote operation as
the old name was not initialized.

MFC after: 1 week

4 years agoMark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (18 of many)
kaktus [Thu, 27 Feb 2020 13:12:14 +0000 (13:12 +0000)]
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (18 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE.  All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Reviewed by: cem
Approved by: csprng, kib (mentor, blanket)
Differential Revision: https://reviews.freebsd.org/D23841

4 years agoUpdate pci_vendors to 2020.02.22
bapt [Thu, 27 Feb 2020 11:23:44 +0000 (11:23 +0000)]
Update pci_vendors to 2020.02.22

MFC after: 2 days

4 years agoA pair of performance improvements.
jeff [Thu, 27 Feb 2020 08:23:10 +0000 (08:23 +0000)]
A pair of performance improvements.

Swap buckets on free as well as alloc so that alloc is always the most
cache-hot data.

When selecting a zone domain for the round-robin bucket cache use the
local domain unless there is a severe imbalance.  This does not affinitize
memory, only locks and queues.

Reviewed by: markj, rlibby
Differential Revision: https://reviews.freebsd.org/D23824

4 years agoAdd a quirk for the WDC Green series of SSDs to disable NCQ TRIM, as this
scottl [Thu, 27 Feb 2020 05:00:21 +0000 (05:00 +0000)]
Add a quirk for the WDC Green series of SSDs to disable NCQ TRIM, as this
avoids silent data corruption.

PR: 225666
Submitted by: anders lundgren
MFC after: 3 days

4 years agoRemove now empty sparc64 directories (oh, and stand/sparc64 files)
imp [Thu, 27 Feb 2020 04:47:12 +0000 (04:47 +0000)]
Remove now empty sparc64 directories (oh, and stand/sparc64 files)

4 years agoRemove libthr, csu, libthread_db and testfloat sparc64 specific directories.
imp [Thu, 27 Feb 2020 04:44:58 +0000 (04:44 +0000)]
Remove libthr, csu, libthread_db and testfloat sparc64 specific directories.

Submitted by: kib@ (libthr)

4 years agoAdd unlocked grab* function variants that use lockless radix code to
jeff [Thu, 27 Feb 2020 02:37:27 +0000 (02:37 +0000)]
Add unlocked grab* function variants that use lockless radix code to
lookup pages.  These variants will fall back to their locked counterparts
if the page is not present.

Discussed with: kib, markj
Differential Revision: https://reviews.freebsd.org/D23449

4 years agoRemove sparc64 source files from rtld-elf
imp [Wed, 26 Feb 2020 23:17:16 +0000 (23:17 +0000)]
Remove sparc64 source files from rtld-elf

These were missed in the prior sweep.

Submitted by: jhb@

4 years agoMFZoL: Relax restriction on zfs_ioc_next_obj() iteration
mav [Wed, 26 Feb 2020 20:38:48 +0000 (20:38 +0000)]
MFZoL: Relax restriction on zfs_ioc_next_obj() iteration

Per the documentation for dnode_next_offset in dnode.c, the "txg"
parameter specifies a lower bound on which transaction the dnode can
be found in. We are interested in all dnodes that are removed between
the first and last transaction in the snapshot. It doesn't need to be
created in that snapshot to correspond to a removed file.

In fact, the behavior of zfs diff in the test case exactly matches
this: the transaction that created the data that was deleted in snapshot
"2" was produced before, in snapshot "1", definitely predating the first
transaction in snapshot "2".

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <Tim Chase <tim@onlight.com>
Closes #2081
zfsonlinux/zfs@7290cd3c4ed19fb3f75b8133db2e36afcdd24beb

MFC after: 1 week

4 years agoWith the planned removal of GIANT (sysctl uses GIANT), make future-proof
cy [Wed, 26 Feb 2020 20:18:38 +0000 (20:18 +0000)]
With the planned removal of GIANT (sysctl uses GIANT), make future-proof
ipfilter by making it sysctl locking mpsafe.

Reviewed by: kaktus
Differential Revision: https://reviews.freebsd.org/D23839

4 years agoReturn ENOTSUP for mmap/mprotect if prot not subset of prot_max
emaste [Wed, 26 Feb 2020 20:03:43 +0000 (20:03 +0000)]
Return ENOTSUP for mmap/mprotect if prot not subset of prot_max

From POSIX,

[ENOTSUP]
    The implementation does not support the combination of accesses
    requested in the prot argument.

This fits the case that prot contains permissions which are not a subset
of prot_max.

Reviewed by: brooks, cem
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23843

4 years agoRemove support for FreeBSD 4-7.
imp [Wed, 26 Feb 2020 19:39:59 +0000 (19:39 +0000)]
Remove support for FreeBSD 4-7.

It's doubtful this driver would still work unchanged there.
Compile tested only because I no longer have ahc/ahd devices.

4 years agoRemove support for FreeBSD 4.x and earlier from agp driver
imp [Wed, 26 Feb 2020 19:39:52 +0000 (19:39 +0000)]
Remove support for FreeBSD 4.x and earlier from agp driver

Compile tested only, but do we still need this driver?

4 years agoAdd HISTORY sections to tree(3), stdarg(3) and sigevent(3)
carlavilla [Wed, 26 Feb 2020 19:16:23 +0000 (19:16 +0000)]
Add HISTORY sections to tree(3), stdarg(3) and sigevent(3)

Submitted by: gbergling_gmail.com
Approved by: bcr@(mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23832

4 years agoRemove support for all pre FreeBSD 11.0 versions from mpr and mps.
imp [Wed, 26 Feb 2020 19:15:08 +0000 (19:15 +0000)]
Remove support for all pre FreeBSD 11.0 versions from mpr and mps.

Remove a number of workarounds for older versions of FreeBSD. FreeBSD stable/10
was branched over 6 years ago. All of these changes date from about that time or
earlier. These workarounds are extensive and get in the way of understanding
the current flow in the driver.

4 years agosrc.conf.5: regen after sparc64 removal
emaste [Wed, 26 Feb 2020 19:12:36 +0000 (19:12 +0000)]
src.conf.5: regen after sparc64 removal

4 years agosrc.opts.mk: drop MIPS special case for disabling BINUTILS_BOOTSTRAP
emaste [Wed, 26 Feb 2020 19:08:23 +0000 (19:08 +0000)]
src.opts.mk: drop MIPS special case for disabling BINUTILS_BOOTSTRAP

Binutils has already been reduced to installing ld only on powerpc32
and as only on amd64.  (Also objdump on every arch supported by binutils
2.17.50.)  Although BINUTILS_BOOTSTRAP serves no purpose on MIPS there
is no reason to have a special case for it.

Sponsored by: The FreeBSD Foundation

4 years agoRemove sparc64 specific parts of libc.
imp [Wed, 26 Feb 2020 18:55:09 +0000 (18:55 +0000)]
Remove sparc64 specific parts of libc.

Also update comments for which architectures use 128 bit long doubles,
as appropriate.

The softfloat specialization routines weren't updated since they
appear to be from an upstream source which we may want to update in
the future to get a more favorable license.

Reviewed by: emaste@
Differential Revision:  https://reviews.freebsd.org/D23658

4 years agoRemove sparc64 specific parts of libm and fix comments
imp [Wed, 26 Feb 2020 18:55:03 +0000 (18:55 +0000)]
Remove sparc64 specific parts of libm and fix comments

Once upon a time, sparc64 was the only ld128 architecture. However,
both aarch64 and riscv are now such architectures. Many of the
comments about how slow multiplication was on old sparc64 processors
are now no longer true. However, since no evaluation has been done for
aarch64 yet, it's unclear if they are still relevant or not. If not,
the code should be changed. If so, the comments should remove the
uncertainty.

Reviewed by: emaste@
Differential Revision: https://reviews.freebsd.org/D23658

4 years agoRemove sparc64 specific parts of rtld-elf.
imp [Wed, 26 Feb 2020 18:49:25 +0000 (18:49 +0000)]
Remove sparc64 specific parts of rtld-elf.

4 years agoRemove sparc64 specific buid-system hacks
imp [Wed, 26 Feb 2020 18:49:20 +0000 (18:49 +0000)]
Remove sparc64 specific buid-system hacks

Remove all the sparc64 hacks and tweaks to the build system. We don't
need them anymore.

4 years agomprotect.2: sort errors alphabetically
emaste [Wed, 26 Feb 2020 18:46:41 +0000 (18:46 +0000)]
mprotect.2: sort errors alphabetically

Reported by: brooks
MFC after: 3 days

4 years agoloader: replace zfs_alloc/zfs_free with malloc/free
tsoome [Wed, 26 Feb 2020 18:12:12 +0000 (18:12 +0000)]
loader: replace zfs_alloc/zfs_free with malloc/free

Use common memory management.

4 years agoMFZoL: Fix resilver writes in vdev_indirect_io_start
mav [Wed, 26 Feb 2020 16:51:45 +0000 (16:51 +0000)]
MFZoL: Fix resilver writes in vdev_indirect_io_start

This patch addresses an issue found in ztest where resilver
write zios that were passed to an indirect vdev would end up
being handled as though they were resilver read zios. This
caused issues where the zio->io_abd would be both read to
and written from at the same time, causing asserts to fail.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8193
zfsonlinux/zfs@5aa95ba0d3502779695341b5f55fa5ba1d3330ff

MFC after: 1 week

4 years agoRemove trailing white space.
imp [Wed, 26 Feb 2020 16:22:28 +0000 (16:22 +0000)]
Remove trailing white space.

4 years agoFix patch mismerge in r358336.
mav [Wed, 26 Feb 2020 16:04:24 +0000 (16:04 +0000)]
Fix patch mismerge in r358336.

MFC after: 1 week

4 years agoMFZoL: Fix issue with scanning dedup blocks as scan ends
mav [Wed, 26 Feb 2020 15:59:46 +0000 (15:59 +0000)]
MFZoL: Fix issue with scanning dedup blocks as scan ends

This patch fixes an issue discovered by ztest where
dsl_scan_ddt_entry() could add I/Os to the dsl scan queues
between when the scan had finished all required work and
when the scan was marked as complete. This caused the scan
to spin indefinitely without ending.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8010
zfsonlinux/zfs@5e0bd0ae056e26de36dee3c199c6fcff8f14ee15

MFC after: 1 week

4 years agoFix the cache type identification
andrew [Wed, 26 Feb 2020 15:56:07 +0000 (15:56 +0000)]
Fix the cache type identification

DIC and IDC are supported when the field bits are set.

Sponsored by: Innovate UK

4 years agoMFZoL: Fix 2 small bugs with cached dsl_scan_phys_t
mav [Wed, 26 Feb 2020 15:47:40 +0000 (15:47 +0000)]
MFZoL: Fix 2 small bugs with cached dsl_scan_phys_t

This patch corrects 2 small bugs where scn->scn_phys_cached was
not properly updated to match the primary copy when it needed to
be. The first resulted in the pause state not being properly
updated and the second resulted in the cached version being
completely zeroed even if the primary was not.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8010
zfsonlinux/zfs@8cb119e3dc0ac6c90b1517fbadc021b7e9741fc6

MFC after: 1 week

4 years agoMFZoL: Fix txg_sync_thread hang in scan_exec_io()
mav [Wed, 26 Feb 2020 15:45:04 +0000 (15:45 +0000)]
MFZoL: Fix txg_sync_thread hang in scan_exec_io()

When scn->scn_maxinflight_bytes has not been initialized it's
possible to hang on the condition variable in scan_exec_io().
This issue was uncovered by ztest and is only possible when
deduplication is enabled through the following call path.

  txg_sync_thread()
    spa_sync()
      ddt_sync_table()
        ddt_sync_entry()
          dsl_scan_ddt_entry()
            dsl_scan_scrub_cb()
              dsl_scan_enqueuei()
                scan_exec_io()
                  cv_wait()

Resolve the issue by always initializing scn_maxinflight_bytes
to a reasonable minimum value.  This value will be recalculated
in dsl_scan_sync() to pick up changes to zfs_scan_vdev_limit
and the addition/removal of vdevs.

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7098
zfsonlinux/zfs@f90a30ad1b32a971f62a540f8944e42f99b254ce

MFC after: 1 week

4 years agoSkip the right test case
lwhsu [Wed, 26 Feb 2020 15:15:55 +0000 (15:15 +0000)]
Skip the right test case

PR: 244172
Sponsored by: The FreeBSD Foundation

4 years agoMove the SYSCTL_ENFORCE_FLAGS to SYSCTL_NODE_WITH_LABEL where it should be
kaktus [Wed, 26 Feb 2020 15:12:38 +0000 (15:12 +0000)]
Move the SYSCTL_ENFORCE_FLAGS to SYSCTL_NODE_WITH_LABEL where it should be
at the beginning.

4 years agoMark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
kaktus [Wed, 26 Feb 2020 14:26:36 +0000 (14:26 +0000)]
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE.  All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Approved by: kib (mentor, blanket)
Commented by: kib, gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D23718

4 years agoThis commit expands tcp_ratelimit to be able to handle cards
rrs [Wed, 26 Feb 2020 13:48:33 +0000 (13:48 +0000)]
This commit expands tcp_ratelimit to be able to handle cards
like the mlx-c5 and c6 that require a "setup" routine before
the tcp_ratelimit code can declare and use a rate. I add the
setup routine to if_var as well as fix tcp_ratelimit to call it.
I also revisit the rates so that in the case of a mlx card
of type c5/6 we will use about 100 rates concentrated in the range
where the most gain can be had (1-200Mbps). Note that I have
tested these on a c5 and they work and perform well. In fact
in an unloaded system they pace right to the correct rate (great
job mlx!). There will be a further commit here from Hans that
will add the respective changes to the mlx driver to support this
work (which I was testing with).

Sponsored by: Netflix Inc.
Differential Revision: ttps://reviews.freebsd.org/D23647

4 years agoTeach the arm64 ident CPU code to print non-ID registers
andrew [Wed, 26 Feb 2020 13:22:23 +0000 (13:22 +0000)]
Teach the arm64 ident CPU code to print non-ID registers

Add support for non-ID registers when printing CPU information. This is
used with the cache type register to print details of the cache on boot.

Sponsored by: Innovate UK

4 years agoTrim trailing white space in comment
gahr [Wed, 26 Feb 2020 12:38:21 +0000 (12:38 +0000)]
Trim trailing white space in comment

Approved by: cognet

4 years agoGeneralise the arm64 ASID allocator.
andrew [Wed, 26 Feb 2020 11:50:24 +0000 (11:50 +0000)]
Generalise the arm64 ASID allocator.

The requirements of an Address Space ID allocator and a Virtual Machine ID
allocator are similar. Generalise the former code so it can be used with
the latter.

Reviewed by: alc (previous version)
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D23831

4 years agoStart to support multiple stages in the arm64 pmap.
andrew [Wed, 26 Feb 2020 11:47:24 +0000 (11:47 +0000)]
Start to support multiple stages in the arm64 pmap.

On arm64 the stage 1 and stage 2 pte formats are similar enough we can
reuse the pmap code for both. As they are only similar and not identical
we need to know if we are managing stage 1 or stage 2 tables.

Add an enum to store this information and a check to make sure it is
set to stage 1 when we manage stage 1 pte fields.

Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D23830

4 years agoAdd more arm64 CTR_EL0 register fields
andrew [Wed, 26 Feb 2020 11:29:03 +0000 (11:29 +0000)]
Add more arm64 CTR_EL0 register fields

While here make the _SIZE macros return the size in bytes, not the log2
of the size

Sponsored by: Innovate UK

4 years agobridge: Move locking defines into if_bridge.c
kp [Wed, 26 Feb 2020 08:47:18 +0000 (08:47 +0000)]
bridge: Move locking defines into if_bridge.c

The locking defines for if_bridge used to live in if_bridgevar.h, but
they're only ever used by the bridge implementation itself (in
if_bridge.c). Moving them into the .c file.

Reported by: philip, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23808

4 years agoRevert r358309 after r358311.
lwhsu [Wed, 26 Feb 2020 04:54:50 +0000 (04:54 +0000)]
Revert r358309 after r358311.

PR: 244393
Sponsored by: The FreeBSD Foundation

4 years agoAdd a note about deleted files in OpenSSH upgrade instructions
emaste [Tue, 25 Feb 2020 22:15:25 +0000 (22:15 +0000)]
Add a note about deleted files in OpenSSH upgrade instructions

4 years ago[PowerPC] [Book-E] Remove obsolete interrupt binding workaround
bdragon [Tue, 25 Feb 2020 22:03:30 +0000 (22:03 +0000)]
[PowerPC] [Book-E] Remove obsolete interrupt binding workaround

Remove an old workaround that is no longer necessary since rS343824.

There used to be a problem with FMan interrupts firing on multiple CPUS
at the same time.

This ended up being due to multicast interrupts being unsupported in the
Freescale PIC (so instead of using a selection algorithm, it would do some
unspecified action, such as interrupting multiple cpus at random.)

Reviewed by: jhibbits
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D23829

4 years agoGeneralize resources freeing in sendfile with different scenarios.
glebius [Tue, 25 Feb 2020 19:29:05 +0000 (19:29 +0000)]
Generalize resources freeing in sendfile with different scenarios.
Now we execute sendfile_iodone() in all possible cases, which
guarantees that vm_object_pip_wakeup() is called and sfio structure
is freed.

At the beginning of sendfile initialize sfio->m to NULL, that would
indicate that the mbuf chain either doesn't exist, or belongs to the
syscall (not to I/O completion).  Fill sfio->m only at a point when
we are positive that there are I/Os ongoing and before releasing
syscall's reference on sfio.

In sendfile_iodone() perform vm_object_pip_wakeup() once last
reference is released, then check for sfio->m.  NULL pointer
indicates that we need only to free the memory.

Reviewed by: jtl, gallatin

4 years agoMake ktls_frame() never fail. Caller must supply correct mbufs.
glebius [Tue, 25 Feb 2020 19:26:40 +0000 (19:26 +0000)]
Make ktls_frame() never fail.  Caller must supply correct mbufs.
This makes sendfile code a bit simplier.

4 years agoSYSCTL_ROOT_NODE should use the SYSCTL_ENFORCE_FLAGS macro too.
kaktus [Tue, 25 Feb 2020 19:12:40 +0000 (19:12 +0000)]
SYSCTL_ROOT_NODE should use the SYSCTL_ENFORCE_FLAGS macro too.

Approved by: kib (mentor, blanket)

4 years agoWhen sendfile_swapin() sweeps through pages in search for a bogus page
glebius [Tue, 25 Feb 2020 19:11:20 +0000 (19:11 +0000)]
When sendfile_swapin() sweeps through pages in search for a bogus page
skip first and last pages.  This is a micro optimisation.

4 years agoMark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (16 of many)
kaktus [Tue, 25 Feb 2020 19:04:39 +0000 (19:04 +0000)]
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (16 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE.

Reviewed by: royger
Approved by: kib (mentor, blanket)
Differential Revision: https://reviews.freebsd.org/D23638

4 years agoFix IBRS for machines with IBRS_ALL capability.
kib [Tue, 25 Feb 2020 17:26:10 +0000 (17:26 +0000)]
Fix IBRS for machines with IBRS_ALL capability.

When turning IBRS mitigation using sysctl, as opposed to loader tunable,
send IPI to tweak MSR on all cores.  Right now code only performed MSR write
onr the CPU where sysctl was run.

Properly report hw.ibrs_active for IBRS_ALL.  Split hw_ibrs_ibpb_active out
from ibrs_active, to keep the current semantic of guiding kernel entry and
exit handlers.

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

4 years agostyle.9: update C99 commentary
emaste [Tue, 25 Feb 2020 17:18:59 +0000 (17:18 +0000)]
style.9: update C99 commentary

Make style.9 read as a current statement of C99 preferences, rather than a
description of ongoing changes to our preferred style.  Alsu use the short
form "ISO C99" on the 2nd and later instances rather than repeating the
unwieldy `ISO/IEC 9899:1999 ("ISO C99")` each time.

Reviewed by: cem, imp, jhb, kib
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23648

4 years agoip6_output: fix regression introduced in r358167 for ipv6 fragmentation
bz [Tue, 25 Feb 2020 15:03:41 +0000 (15:03 +0000)]
ip6_output: fix regression introduced in r358167 for ipv6 fragmentation

When moving the calculations for the optlen into the if (opt) block
which deals with possible extension headers I failed to initialise
unfragpartlen to the ipv6 header length if there were no extension
headers present.  Correct that mistake to make IPv6 fragment length
calculcations work again.

Reported by: hselasky, kp
OKed by: hselasky, kp
MFC after: 3 days
X-MFC with: r358167
PR: 244393

4 years agoUse hid_get_data_unsigned() instead of hid_get_data() when reading the
hselasky [Tue, 25 Feb 2020 12:56:06 +0000 (12:56 +0000)]
Use hid_get_data_unsigned() instead of hid_get_data() when reading the
key-codes from the USB keyboard. Negative key-codes are currently skipped.

While at it use the bit size value provided by the HID location structure
instead of assuming a value of 8.

This fixes a regression issue after r357861.

Reported by: Minoru TANABE <kotanabe3@gmail.com>
PR: 224592
PR: 233884
MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoTemporarily skip failing test case sys.netpfil.pf.fragmentation.v6
lwhsu [Tue, 25 Feb 2020 11:56:54 +0000 (11:56 +0000)]
Temporarily skip failing test case sys.netpfil.pf.fragmentation.v6

PR: 244393
Sponsored by: The FreeBSD Foundation

4 years agoBefore issing the REMOVE_DEVICE command to the firmware, make sure that all
imp [Tue, 25 Feb 2020 04:27:23 +0000 (04:27 +0000)]
Before issing the REMOVE_DEVICE command to the firmware, make sure that all
commands have completed.

It's not OK to force complete any pending commands before we send the
REMOVE_DEVICE. Instead, make sure that all pending commands are complete before
sending that. By trying to second guess the firmware here, we run the risk of
completing commands twice, which leads to corruption.

This removes the forced completion of commands introduced in r218811. So it's a
partial backout of that commit, but replaces it with a more rebust
mechanism. Either these commands will complete due to the TARGET RESET, or they
will timeout and be aborted, but they will all complete.

Add assert that all commands are complete to REMOVE_DEVICE completion
routine. We attempt to assure this programatically, so we shouldn't have any
commands in the queue because we've waited for them all. Any commands that make
it into our action routine after we mark the target in removal will complete
immediately with an error.

When we're removing a target that's not a volume, advertise up the stack that
it's actually gone, as opposed to having a transient selection error we should
retry. Do this both in the action routine, and when we get a notification of an
aborted command. We don't do this for volumes because the driver tries hard not
to advertise to the OS a volume has disappeared.

Apply these changes to both mpr and mps since they are based on quite similar
designs.

Discussed with: scottl@
Differential Revision: https://reviews.freebsd.org/D23768

4 years ago[PowerPC] [Book-E] Fix dpaa interrupt binding.
bdragon [Tue, 25 Feb 2020 03:35:52 +0000 (03:35 +0000)]
[PowerPC] [Book-E] Fix dpaa interrupt binding.

After the network epoch was added, we lost the ability to migrate the
ithread in the middle of dispatch, as being in the network epoch will pin
the current thread (for safety reasons.)

Luckily, we don't actually have to do this workaround in the first place,
as we can just bind it to the correct cpu when we preallocate it.

Pass dev through to XX_PreallocAndBindIntr() and actually bind it to the
cpu like it was supposed to in the first place, instad of leaving it
floating and moving it to the correct cpu the first time it fires.

This fixes panics while bringing up dtsec on my X5000.

Reviewed by: jhibbits
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D23826

4 years agoUnbreak the 32-bit powerpc builds
jhibbits [Tue, 25 Feb 2020 02:42:43 +0000 (02:42 +0000)]
Unbreak the 32-bit powerpc builds

Force unsigned integer usage by casting to vm_offset_t, to avoid integer
overflow, from r358305

4 years agopowerpc/booke: Use a pseudo-DMAP for the device mappings on booke64
jhibbits [Tue, 25 Feb 2020 01:40:22 +0000 (01:40 +0000)]
powerpc/booke: Use a pseudo-DMAP for the device mappings on booke64

Since powerpc64 has such a large virtual address space, significantly larger
than its physical address space, take advantage of this, and create yet
another DMAP-like instance for the device mappings.  In this case, the
device mapping "DMAP" is in the 0x8000000000000000 - 0xc000000000000000
range, so as not to overlap the physical memory DMAP.

This will allow us to add TLB1 entry coalescing in the future, especially
useful for things like the radeonkms driver, which maps parts of the GPU at
a time, but eventually maps all of it, using up a lot of TLB1 entries (~40).

4 years ago[PowerPC] Fix LLD10 linking of ofw loader on ppc
bdragon [Tue, 25 Feb 2020 00:45:09 +0000 (00:45 +0000)]
[PowerPC] Fix LLD10 linking of ofw loader on ppc

Before this change, LLD10 was creating several extra PT_LOAD sections,
which OFW does not understand.

Like we do for the kernel already, specify the program headers manually.

Additionally, to work around a crash in our base ld.bfd, we need to
actually assign something to the output section. LLD does not need this.

One side effect of this change is the removal of the GNU_STACK header.
This is more correct, since we are using a statically-allocated stack and
RWX mappings across the board this early in boot.

Reviewed by: jhibbits, Fangrui Song <i@maskray.me>
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D23778

4 years agoAlthough most of the NIC drivers are epoch ready, due to peer pressure
glebius [Mon, 24 Feb 2020 21:07:30 +0000 (21:07 +0000)]
Although most of the NIC drivers are epoch ready, due to peer pressure
switch over to opt-in instead of opt-out for epoch.

Instead of IFF_NEEDSEPOCH, provide IFF_KNOWSEPOCH. If driver marks
itself with IFF_KNOWSEPOCH, then ether_input() would not enter epoch
when processing its packets.

Now this will create recursive entrance in epoch in >90% network
drivers, but will guarantee safeness of the transition.

Mark several tested drivers as IFF_KNOWSEPOCH.

Reviewed by: hselasky, jeff, bz, gallatin
Differential Revision: https://reviews.freebsd.org/D23674

4 years agosmsc: remove pre-FreeBSD-10 compat support
emaste [Mon, 24 Feb 2020 19:50:28 +0000 (19:50 +0000)]
smsc: remove pre-FreeBSD-10 compat support

Sponsored by: The FreeBSD Foundation

4 years agomuge: fix rxcsum enable test
emaste [Mon, 24 Feb 2020 19:48:29 +0000 (19:48 +0000)]
muge: fix rxcsum enable test

if_capabilities indicates capabilities supported by the hardware;
if_capenable which are enabled.  Note that rx checksum is still disabled
in the driver at compile time.

Submitted by: Johannes <iz-rpi04@hs-karlsruhe.de>
MFC after: 2 weeks

4 years agoFix IPv6 checksums when exthdrs are present.
bz [Mon, 24 Feb 2020 19:12:20 +0000 (19:12 +0000)]
Fix IPv6 checksums when exthdrs are present.

In two places in ip6_output we are doing (delayed) checksum calculations.
The initial logic came from SCTP in r205075,205104 and later I copied
and adjusted it for the TCP|UDP case in r235958.
The problem was that the original SCTP offsets were already wrong for any
case with extension headers present given IPv6 extension headers are not
part of the pseudo checksum calculations.
The later changes do not help in case there is checksum offloading as for
extension headers (incl. fragments) we do currrently never offload as we
have no infrastructure to know whether the NIC can handle these cases.

Correct the offsets for delayed checksum calculations and properly handle
mbuf flags.  In addition harmonize the almost identical duplicate code.

While here eliminate the now unneeded variable hlen and add an always
missing mtod() call in the 1-b and 3 cases after the introduction of
the mb_unmapped_to_ext() calls.

Reported by: Francis Dupont (fdupont isc.org)
PR: 243675
MFC after: 6 days
Reviewed by: markj (earlier version), gallatin
Differential Revision: https://reviews.freebsd.org/D23760

4 years agoSplit out the stage 1 pte bits and add the stage 2 bits
andrew [Mon, 24 Feb 2020 16:45:31 +0000 (16:45 +0000)]
Split out the stage 1 pte bits and add the stage 2 bits

In preperation for adding bhyve support to arm64 we need to split the
stage 1 and stage 2 pte fields to allow future changes to create stage 2
page tables.

MFC after: 1 month
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D23669

4 years agoAdd a soft-float riscv kernel config
imp [Mon, 24 Feb 2020 16:42:44 +0000 (16:42 +0000)]
Add a soft-float riscv kernel config

GENERICSF is just like GENERIC, only creates a soft-float kernel. Omit it from the
universe build for now.

Reviewed by: philip
Differential Revision: https://reviews.freebsd.org/D23812

4 years agoOnly compile clear_fpu state code when we're building with options FPE.
imp [Mon, 24 Feb 2020 16:41:29 +0000 (16:41 +0000)]
Only compile clear_fpu state code when we're building with options FPE.

Soft float kernels build without floating point, and will fail to build if we
try to include floating point code.

Obtained from: kp@

4 years agoCreate ../compile
imp [Mon, 24 Feb 2020 16:41:16 +0000 (16:41 +0000)]
Create ../compile

Give up the battle to keep extra files in $MACHINE/compile to keep the file in
the tree. Instead, create CDIR (usually ../compile) if it doesn't exist when
we're using a default build location (eg, not using -d). If it does, we do
nothing. This only affects people that do old-school builds, but it's bit me a
dozen times since last summer so time to fix the bug.

4 years agodebug_monitor: Avoid setting the PSR_D flag for 32bits binaries.
cognet [Mon, 24 Feb 2020 16:25:11 +0000 (16:25 +0000)]
debug_monitor: Avoid setting the PSR_D flag for 32bits binaries.

In dbg_monitor_exit(), avoid setting the PSR_D bit if the process is
a 32bits binary. PSR_D is an aarch64-only flags, and for aarch32 processes,
it means "run in big endian".
This should make COMPAT_FREEBSD32 run much better on arm64.

4 years agoRework and simplify Tx DMA mapping in ENA
mw [Mon, 24 Feb 2020 15:35:31 +0000 (15:35 +0000)]
Rework and simplify Tx DMA mapping in ENA

Driver working in LLQ mode in some cases can send only few last segments
of the mbuf using DMA engine, and the rest of them are sent to the
device using direct PCI transaction. To map the only necessary data, two DMA
maps were used. That solution was very rough and was causing a bug - if
both maps were used (head_map and seg_map), there was a race in between
two flows on two queues and the device was receiving corrupted
data which could be further received on the other host if the Tx cksum
offload was enabled.

As it's ok to map whole mbuf and then send to the device only needed
segments, the design was simplified to use only single DMA map.

The driver version was updated to v2.1.1 as it's important bug fix.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

4 years agoMark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (15 of many)
kaktus [Mon, 24 Feb 2020 10:51:26 +0000 (10:51 +0000)]
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (15 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

4 years agoMark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (14 of many)
kaktus [Mon, 24 Feb 2020 10:47:18 +0000 (10:47 +0000)]
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (14 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Approved by: kib (mentor, blanket)
Differential Revision: https://reviews.freebsd.org/D23639

4 years agoMark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (13 of many)
kaktus [Mon, 24 Feb 2020 10:45:22 +0000 (10:45 +0000)]
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (13 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Approved by: kib (mentor, blanket)
Differential Revision: https://reviews.freebsd.org/D23635

4 years agoMark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (12 of many)
kaktus [Mon, 24 Feb 2020 10:42:56 +0000 (10:42 +0000)]
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (12 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Approved by: kib (mentor, blanket)
Differential Revision: https://reviews.freebsd.org/D23637

4 years agoMark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (11 of many)
kaktus [Mon, 24 Feb 2020 10:41:22 +0000 (10:41 +0000)]
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (11 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Approved by: kib (mentor, blanket)
Differential Revision: https://reviews.freebsd.org/D23636

4 years agoarm64: rockchip: rk808: Only init regulator not enabled
manu [Mon, 24 Feb 2020 10:40:35 +0000 (10:40 +0000)]
arm64: rockchip: rk808: Only init regulator not enabled

If a regulator is already enabled, do not set its value to the minimum
supported on the board.
This fixes booting on rock64 where we set some regulator to the minimal value
while the IPs needs more based on what the bootloader configured.

MFC after: 1 week

4 years agoarm64: rockchip: rk_i2c: Bump to DELAY to 1000
manu [Mon, 24 Feb 2020 10:38:38 +0000 (10:38 +0000)]
arm64: rockchip: rk_i2c: Bump to DELAY to 1000

In polling mode with use DELAY to wait for interrupts. The value was
too low for RK3328.

MFC after: 1 week

4 years agoMark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (10 of many)
kaktus [Mon, 24 Feb 2020 10:37:56 +0000 (10:37 +0000)]
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (10 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Approved by: kib (mentor, blanket)
Differential Revision: https://reviews.freebsd.org/D23629

4 years agoMark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (8 of many)
kaktus [Mon, 24 Feb 2020 10:35:58 +0000 (10:35 +0000)]
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (8 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Approved by: kib (mentor, blanket)
Differential Revision: https://reviews.freebsd.org/D23628

4 years agoMark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (8 of many)
kaktus [Mon, 24 Feb 2020 10:33:51 +0000 (10:33 +0000)]
Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (8 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Approved by: kib (mentor, blanket)
Differential Revision: https://reviews.freebsd.org/D23627

4 years agoAlways check return value from acpi_GetInteger() after r358219.
hselasky [Mon, 24 Feb 2020 09:31:30 +0000 (09:31 +0000)]
Always check return value from acpi_GetInteger() after r358219.
If a failure happens reading the lid state, assume the lid is opened.

Suggested by: cem @
Differential Revision: https://reviews.freebsd.org/D23724
PR: 240881
MFC after: 1 week
Sponsored by: Mellanox Technologies