]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoFix various, mostly minor errors in man pages like:
Benedict Reuschling [Sun, 3 May 2020 10:15:58 +0000 (10:15 +0000)]
Fix various, mostly minor errors in man pages like:
- Abbreviated month name in .Dd
- position of HISTORY section
- alphabetical ordering within SEE ALSO section
- adding .Ed before .Sh DESCRIPTION
- remove trailing whitespaces
- Line break after a sentence stop
- Use BSD OS macros instead of hardcoded strings

No .Dd bumps as there was no actual content change made
in any of these pages.

Submitted by: Gordon Bergling gbergling_gmail.com
Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D24591

4 years agoAdd HISTORY sections to build(7), crypto(7),
Benedict Reuschling [Sun, 3 May 2020 09:54:19 +0000 (09:54 +0000)]
Add HISTORY sections to build(7), crypto(7),
ffs(7), growfs(7), and diskless(8).

Submitted by: Gordon Bergling gbergling_gmail.com
Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D24271

4 years agoWe need to hold the periph lock when we release the ccb (and when we
Warner Losh [Sun, 3 May 2020 04:22:27 +0000 (04:22 +0000)]
We need to hold the periph lock when we release the ccb (and when we
run it). Make sure that we do. Simplify the flow a bit, and fix a
comment since we do need to do these things.

Noticed by: cperciva (not sure why my invariants kernel didn't trigger)

4 years agoipfw: whitespace fix in SCTP_ABORT_ASSOCIATION case statement comment
Ed Maste [Sun, 3 May 2020 03:44:16 +0000 (03:44 +0000)]
ipfw: whitespace fix in SCTP_ABORT_ASSOCIATION case statement comment

Submitted by: Neel Chauhan <neel AT neelc DOT org>
Reviewed by: rgrimes, tuexen
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24602

4 years agoStep 4.2: start divorce of M_EXT and M_EXTPG
Gleb Smirnoff [Sun, 3 May 2020 00:37:16 +0000 (00:37 +0000)]
Step 4.2: start divorce of M_EXT and M_EXTPG

They have more differencies than similarities. For now there is lots
of code that would check for M_EXT only and work correctly on M_EXTPG
buffers, so still carry M_EXT bit together with M_EXTPG. However,
prepare some code for explicit check for M_EXTPG.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoMechanically rename MBUF_EXT_PGS_ASSERT() to M_ASSERTEXTPG() to match
Gleb Smirnoff [Sun, 3 May 2020 00:27:41 +0000 (00:27 +0000)]
Mechanically rename MBUF_EXT_PGS_ASSERT() to M_ASSERTEXTPG() to match
classical M_ASSERTPKTHDR.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 4.1: mechanically rename M_NOMAP to M_EXTPG
Gleb Smirnoff [Sun, 3 May 2020 00:21:11 +0000 (00:21 +0000)]
Step 4.1: mechanically rename M_NOMAP to M_EXTPG

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 3: anonymize struct mbuf_ext_pgs and move all its fields into mbuf
Gleb Smirnoff [Sun, 3 May 2020 00:12:56 +0000 (00:12 +0000)]
Step 3: anonymize struct mbuf_ext_pgs and move all its fields into mbuf
        within m_epg namespace.
All edits except the 'struct mbuf' declaration and mb_dupcl() were done
mechanically with sed:

s/->m_ext_pgs.nrdy/->m_epg_nrdy/g
s/->m_ext_pgs.hdr_len/->m_epg_hdrlen/g
s/->m_ext_pgs.trail_len/->m_epg_trllen/g
s/->m_ext_pgs.first_pg_off/->m_epg_1st_off/g
s/->m_ext_pgs.last_pg_len/->m_epg_last_len/g
s/->m_ext_pgs.flags/->m_epg_flags/g
s/->m_ext_pgs.record_type/->m_epg_record_type/g
s/->m_ext_pgs.enc_cnt/->m_epg_enc_cnt/g
s/->m_ext_pgs.tls/->m_epg_tls/g
s/->m_ext_pgs.so/->m_epg_so/g
s/->m_ext_pgs.seqno/->m_epg_seqno/g
s/->m_ext_pgs.stailq/->m_epg_stailq/g

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 2.5: Stop using 'struct mbuf_ext_pgs' in the kernel itself.
Gleb Smirnoff [Sun, 3 May 2020 00:08:05 +0000 (00:08 +0000)]
Step 2.5: Stop using 'struct mbuf_ext_pgs' in the kernel itself.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoMake MBUF_EXT_PGS_ASSERT_SANITY() a macro, so that it prints file:line.
Gleb Smirnoff [Sun, 3 May 2020 00:03:39 +0000 (00:03 +0000)]
Make MBUF_EXT_PGS_ASSERT_SANITY() a macro, so that it prints file:line.
While here, stop using struct mbuf_ext_pgs.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 2.4: Stop using 'struct mbuf_ext_pgs' in drivers.
Gleb Smirnoff [Sat, 2 May 2020 23:58:20 +0000 (23:58 +0000)]
Step 2.4: Stop using 'struct mbuf_ext_pgs' in drivers.

Reviewed by: gallatin, hselasky
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 2.3: Rename mbuf_ext_pg_len() to m_epg_pagelen() that
Gleb Smirnoff [Sat, 2 May 2020 23:52:35 +0000 (23:52 +0000)]
Step 2.3: Rename mbuf_ext_pg_len() to m_epg_pagelen() that
          uses mbuf argument.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 2.2:
Gleb Smirnoff [Sat, 2 May 2020 23:46:29 +0000 (23:46 +0000)]
Step 2.2:
o Shrink sglist(9) functions to work with multipage mbufs down from
  four functions to two.
o Don't use 'struct mbuf_ext_pgs *' as argument, use struct mbuf.
o Rename to something matching _epg.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 2.1: Build TLS workqueue from mbufs, not struct mbuf_ext_pgs.
Gleb Smirnoff [Sat, 2 May 2020 23:38:13 +0000 (23:38 +0000)]
Step 2.1: Build TLS workqueue from mbufs, not struct mbuf_ext_pgs.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoGet rid of the mbuf self-pointing pointer.
Gleb Smirnoff [Sat, 2 May 2020 22:56:22 +0000 (22:56 +0000)]
Get rid of the mbuf self-pointing pointer.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStart moving into EPG_/epg_ namespace. There is only one flag, but
Gleb Smirnoff [Sat, 2 May 2020 22:49:14 +0000 (22:49 +0000)]
Start moving into EPG_/epg_ namespace.  There is only one flag, but
next commit brings in second flag, so let them already be in the
future namespace.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoIn mb_unmapped_compress() we don't need mbuf structure to keep data,
Gleb Smirnoff [Sat, 2 May 2020 22:44:23 +0000 (22:44 +0000)]
In mb_unmapped_compress() we don't need mbuf structure to keep data,
but we need buffer of MLEN bytes.  This isn't just a simplification,
but important fixup, because previous commit shrinked sizeof(struct
mbuf) down below MSIZE, and instantiating an mbuf on stack no longer
provides enough data.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoContinuation of multi page mbuf redesign from r359919.
Gleb Smirnoff [Sat, 2 May 2020 22:39:26 +0000 (22:39 +0000)]
Continuation of multi page mbuf redesign from r359919.

The following series of patches addresses three things:

Now that array of pages is embedded into mbuf, we no longer need
separate structure to pass around, so struct mbuf_ext_pgs is an
artifact of the first implementation. And struct mbuf_ext_pgs_data
is a crutch to accomodate the main idea r359919 with minimal churn.

Also, M_EXT of type EXT_PGS are just a synonym of M_NOMAP.

The namespace for the newfeature is somewhat inconsistent and
sometimes has a lengthy prefixes. In these patches we will
gradually bring the namespace to "m_epg" prefix for all mbuf
fields and most functions.

Step 1 of 4:

 o Anonymize mbuf_ext_pgs_data, embed in m_ext
 o Embed mbuf_ext_pgs
 o Start documenting all this entanglement

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoFix various Coverity-detected errors in nvme driver
David Bright [Sat, 2 May 2020 20:47:58 +0000 (20:47 +0000)]
Fix various Coverity-detected errors in nvme driver

This fixes several Coverity-detected errors in the nvme driver.

CIDs addressed: 100834410093771009380119374013054701403975,
1403980

Reviewed by: imp@, vangyzen@
MFC after: 5 days
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D24532

4 years agoResolve conflict between the fusefs(5) and mac_bsdextended(4) tests
Alan Somers [Sat, 2 May 2020 20:14:59 +0000 (20:14 +0000)]
Resolve conflict between the fusefs(5) and mac_bsdextended(4) tests

mac_bsdextended(4), when enabled, causes ordinary operations to send many
more VOP_GETATTRs to file system. The fusefs tests expectations aren't
written with those in mind. Optionally expecting them would greatly
obfuscate the fusefs tests. Worse, certain fusefs functionality (like
attribute caching) would be impossible to test if the tests couldn't expect
an exact number of GETATTR operations.

This commit resolves that conflict by making two changes:

1. The fusefs tests will now check for mac_bsdextended, and skip if it's
   enabled.
2. The mac_bsdextended tests will now check whether the module is enabled, not
   merely loaded. If it's loaded but disabled, the tests will automatically
   enable it for the duration of the tests.

With these changes, a CI system can achieve best coverage by loading both
fusefs and mac_bsdextended at boot, and setting
security.mac.bsdextended.enabled=0

PR: 244229
Reported by: lwhsu
Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24577

4 years agokern_exec.c: Produce valid code ifndef SYS_PROTO_H
Conrad Meyer [Sat, 2 May 2020 18:54:25 +0000 (18:54 +0000)]
kern_exec.c: Produce valid code ifndef SYS_PROTO_H

Reported by: Coccinelle

4 years agoActually remove support for Triple DES, not just the warning.
John Baldwin [Sat, 2 May 2020 17:18:32 +0000 (17:18 +0000)]
Actually remove support for Triple DES, not just the warning.

Missed in r360562.

4 years agoCleanup LUN addition/removal.
Alexander Motin [Sat, 2 May 2020 16:54:59 +0000 (16:54 +0000)]
Cleanup LUN addition/removal.

 - Make ctl_add_lun() synchronous.  Asynchronous addition was used by
Copan's proprietary code long ago and never for upstream FreeBSD.
 - Move LUN enable/disable calls from backends to CTL core.
 - Serialize LUN modification and partially removal to avoid double frees.
 - Slightly unify backends code.

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

4 years agoDocument removal of deprecated algorithms from /dev/crypto.
John Baldwin [Sat, 2 May 2020 14:23:55 +0000 (14:23 +0000)]
Document removal of deprecated algorithms from /dev/crypto.

4 years agoRemove support for the algorithms deprecated in r348876.
John Baldwin [Sat, 2 May 2020 14:20:32 +0000 (14:20 +0000)]
Remove support for the algorithms deprecated in r348876.

This removes support for the following algorithms:
- ARC4
- Blowfish
- CAST128
- DES
- 3DES
- MD5-HMAC
- Skipjack

Since /dev/crypto no longer supports 3DES, stop testing the 3DES KAT
vectors in cryptotest.py.

Reviewed by: cem (previous version)
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D24346

4 years agoDon't pass bogus keys down for NULL algorithms.
John Baldwin [Sat, 2 May 2020 01:00:29 +0000 (01:00 +0000)]
Don't pass bogus keys down for NULL algorithms.

The changes in r359374 added various sanity checks in sessions and
requests created by crypto consumers in part to permit backend drivers
to make assumptions instead of duplicating checks for various edge
cases.  One of the new checks was to reject sessions which provide a
pointer to a key while claiming the key is zero bits long.

IPsec ESP tripped over this as it passes along whatever key is
provided for NULL, including a pointer to a zero-length key when an
empty string ("") is used with setkey(8).  One option would be to
teach the IPsec key layer to not allocate keys of zero length, but I
went with a simpler fix of just not passing any keys down and always
using a key length of zero for NULL algorithms.

PR: 245832
Reported by: CI

4 years agoPrint the fs last-mounted time too.
Chuck Silvers [Sat, 2 May 2020 00:10:25 +0000 (00:10 +0000)]
Print the fs last-mounted time too.

Reviewed by: mckusick
Approved by: mckusick (mentor)
Sponsored by: Netflix

4 years agoDocument removal of deprecated IPsec algorithms.
John Baldwin [Sat, 2 May 2020 00:08:44 +0000 (00:08 +0000)]
Document removal of deprecated IPsec algorithms.

4 years agoRemove support for IPsec algorithms deprecated in r348205 and r360202.
John Baldwin [Sat, 2 May 2020 00:06:58 +0000 (00:06 +0000)]
Remove support for IPsec algorithms deprecated in r348205 and r360202.

Examples of depecrated algorithms in manual pages and sample configs
are updated where relevant.  I removed the one example of combining
ESP and AH (vs using a cipher and auth in ESP) as RFC 8221 says this
combination is NOT RECOMMENDED.

Specifically, this removes support for the following ciphers:
- des-cbc
- 3des-cbc
- blowfish-cbc
- cast128-cbc
- des-deriv
- des-32iv
- camellia-cbc

This also removes support for the following authentication algorithms:
- hmac-md5
- keyed-md5
- keyed-sha1
- hmac-ripemd160

Reviewed by: cem, gnn (older verisons)
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D24342

4 years agoUse the HSM SBI extension to halt CPUs
Mitchell Horne [Fri, 1 May 2020 21:59:47 +0000 (21:59 +0000)]
Use the HSM SBI extension to halt CPUs

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

4 years agoUse the HSM SBI extension to start APs
Mitchell Horne [Fri, 1 May 2020 21:58:19 +0000 (21:58 +0000)]
Use the HSM SBI extension to start APs

The addition of the HSM SBI extension to OpenSBI introduces a new
breaking change: secondary harts will remain parked in the firmware,
until they are brought up explicitly via sbi_hsm_hart_start(). Add
the call to do this, sending the secondary harts to mpentry.

If the HSM extension is not present, secondary harts are assumed to be
released by the firmware, as is the case for OpenSBI =< v0.6 and BBL.

In the case that the HSM call fails we exclude the CPU, notify the
user, and allow the system to proceed with booting.

Reviewed by: markj (older version)
Differential Revision: https://reviews.freebsd.org/D24497

4 years agoAdd support for HSM SBI extension
Mitchell Horne [Fri, 1 May 2020 21:55:51 +0000 (21:55 +0000)]
Add support for HSM SBI extension

The Hardware State Management (HSM) extension provides a set of SBI
calls that allow the supervisor software to start and stop hart
execution.

The HSM extension has been implemented in OpenSBI and is present in
the v0.7 release.

[1] https://github.com/riscv/riscv-sbi-doc/blob/master/riscv-sbi.adoc

Reviewed by: br
Differential Revision: https://reviews.freebsd.org/D24496

4 years agoMake mpentry independent of _start
Mitchell Horne [Fri, 1 May 2020 21:52:29 +0000 (21:52 +0000)]
Make mpentry independent of _start

APs enter the kernel at the same point as the BSP, the _start routine.
They then jump to mpentry, but not before storing the kernel's physical
load address in the s9 register. Extract this calculation into its own
routine, so that APs can be instructed to enter directly from mpentry.

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

4 years agoAdd KASSERT to ensure sane nsid.
Warner Losh [Fri, 1 May 2020 21:24:19 +0000 (21:24 +0000)]
Add KASSERT to ensure sane nsid.

All callers are currently filtering bad nsid to this function,
however, we'll have undefined behavior if that's not true. Add the
KASSERT to prevent that.

4 years agoRename ns notification function...
Warner Losh [Fri, 1 May 2020 21:24:15 +0000 (21:24 +0000)]
Rename ns notification function...

This function is called whenever the namespace is added, deleted or
changes. Update the name to reflect that. No functional change.

4 years agoDocument the passthru commands.
Warner Losh [Fri, 1 May 2020 20:29:51 +0000 (20:29 +0000)]
Document the passthru commands.

Reviewed by: bcr@ (earlier version)
Differential Revision: https://reviews.freebsd.org/D24639

4 years agoVarious improvements to this man page:
Warner Losh [Fri, 1 May 2020 20:29:46 +0000 (20:29 +0000)]
Various improvements to this man page:

o Be consistent about device-id and namespace-id
o Use consistent arg markup for these
o document you can use disk names too
o document nsid command better
o document the idenntify command
o add a couple of examples.

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

4 years agoRedo r360540 to retain the ifndef sparc code, not delete it.
Warner Losh [Fri, 1 May 2020 18:36:48 +0000 (18:36 +0000)]
Redo r360540 to retain the ifndef sparc code, not delete it.

Also undo the BROKEN stuff, since it was based on the same misreading.

Noticed by: Jens Schweikhardt

4 years agoSpell LOADER correctly so we test lua build.
Warner Losh [Fri, 1 May 2020 17:50:26 +0000 (17:50 +0000)]
Spell LOADER correctly so we test lua build.

4 years agoRemove more stray sparc64 ifdefs.
Warner Losh [Fri, 1 May 2020 17:50:21 +0000 (17:50 +0000)]
Remove more stray sparc64 ifdefs.

Also, dmabuf appears to only be set for sparc64 case, but there was a
comment at its only use that says it was broken for some apple
adapters. #ifdef it all of that out now that nothing sets it.

4 years agoCatch up to arm/arm and sparc64 removal.
Warner Losh [Fri, 1 May 2020 17:17:01 +0000 (17:17 +0000)]
Catch up to arm/arm and sparc64 removal.

4 years agoWhen we have an invalid build option, don't rm -rf the current
Warner Losh [Fri, 1 May 2020 17:16:57 +0000 (17:16 +0000)]
When we have an invalid build option, don't rm -rf the current
directory.

Add a quick sanity check to objdir before using it.  It must start
with /. If there was a make error getting it, report that and continue
with the next target. If there was anything else, bail out.

4 years ago[PowerPC] Set fixed boot1.elf load address
Brandon Bergren [Fri, 1 May 2020 16:56:36 +0000 (16:56 +0000)]
[PowerPC] Set fixed boot1.elf load address

Due to the way claiming works, we need to ensure on AIM OFW machines that
we don't have overlapping ranges on any step of the load.

Load boot1.elf at 0x38000 so it will not overlap with anything even if the
entire PReP partition gets loaded by OFW.

Tested on an iBook G4, a PowerBook G4, a PowerMac G5, and qemu pseries.
(qemu pseries is broken without this patch due to the high address used
by lld10.)

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

4 years agoRemove sparc relocation support from reloc_elf.c.
Brandon Bergren [Fri, 1 May 2020 16:47:54 +0000 (16:47 +0000)]
Remove sparc relocation support from reloc_elf.c.

It got missed in the sparc64 removal.

4 years agocorrect procctl(PROC_PROTMAX_STATUS _NOFORCE return
Ed Maste [Fri, 1 May 2020 14:30:59 +0000 (14:30 +0000)]
correct procctl(PROC_PROTMAX_STATUS _NOFORCE return

Previously procctl(PROC_PROTMAX_STATUS, ... used the PROC_ASLR_NOFORCE
macro for the "system-wide configured policy" status, instead of
PROC_PROTMAX_NOFORCE.

They both have a value of 3, so no functional change.

Sponsored by: The FreeBSD Foundation

4 years agoFix typo in r360492:
Benedict Reuschling [Fri, 1 May 2020 11:36:39 +0000 (11:36 +0000)]
Fix typo in r360492:

appeard -> appeared

Reported by: trasz (via IRC)

4 years agoImplement more PCI-express bandwidth functions in the LinuxKPI.
Hans Petter Selasky [Fri, 1 May 2020 10:32:42 +0000 (10:32 +0000)]
Implement more PCI-express bandwidth functions in the LinuxKPI.

Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoImplement mutex_lock_killable() in the LinuxKPI.
Hans Petter Selasky [Fri, 1 May 2020 10:28:21 +0000 (10:28 +0000)]
Implement mutex_lock_killable() in the LinuxKPI.

Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoImplement DIV64_U64_ROUND_UP() in the LinuxKPI.
Hans Petter Selasky [Fri, 1 May 2020 10:25:07 +0000 (10:25 +0000)]
Implement DIV64_U64_ROUND_UP() in the LinuxKPI.

Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoImplement more lockdep macros in the LinuxKPI.
Hans Petter Selasky [Fri, 1 May 2020 10:18:07 +0000 (10:18 +0000)]
Implement more lockdep macros in the LinuxKPI.

Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoImplement kstrtou64() in the LinuxKPI.
Hans Petter Selasky [Fri, 1 May 2020 10:14:45 +0000 (10:14 +0000)]
Implement kstrtou64() in the LinuxKPI.

Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoFix a number of the following issues in man4:
Benedict Reuschling [Fri, 1 May 2020 10:02:38 +0000 (10:02 +0000)]
Fix a number of the following issues in man4:
- Inconsistencies in .Dd like abbreviated month names,
"th" after numbers, or leading zeros
- No line breaks after a sentence stop
- Whitespace at the end of the line
- Use macros for BSD OS names instead of hardcoded names
- CAVEATS instead of CAVEAT in section name

No actual content change in terms of additions were made, so
no bump of the .Dd for these man pages.
All of these issues were found and fixed by Gordon Bergling.

Submitted by:     gbergling_gmail.com
Approved by:     bcr
Differential Revision: https://reviews.freebsd.org/D24648

4 years agoAdd RISC-V interpreter example
Mitchell Horne [Fri, 1 May 2020 01:31:19 +0000 (01:31 +0000)]
Add RISC-V interpreter example

Now that RISC-V support has landed in qemu-user-static, add to the list
of examples in the binmiscctl(8) manpage.

Reviewed by: kevans
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D24646

4 years agoMFV: r360512
Jung-uk Kim [Fri, 1 May 2020 01:26:36 +0000 (01:26 +0000)]
MFV: r360512

Merge ACPICA 20200430.

4 years agoFactor some code out of nfsm_dissct() into separate functions.
Rick Macklem [Fri, 1 May 2020 00:36:14 +0000 (00:36 +0000)]
Factor some code out of nfsm_dissct() into separate functions.

Factoring some of the code in nfsm_dissct() out into separate functions
allows these functions to be used elsewhere in the NFS mbuf handling code.
Other uses of these functions will be done in future commits.
It also makes it easier to add support for ext_pgs mbufs, which is needed
for nfs-over-tls under development in base/projects/nfs-over-tls.

Although the algorithm in nfsm_dissct() is somewhat re-written by this
patch, the semantics of nfsm_dissct() should not have changed.

4 years agoImport ACPICA 20200430.
Jung-uk Kim [Thu, 30 Apr 2020 23:40:36 +0000 (23:40 +0000)]
Import ACPICA 20200430.

4 years agoRemove the SYMVER build option.
John Baldwin [Thu, 30 Apr 2020 22:08:40 +0000 (22:08 +0000)]
Remove the SYMVER build option.

This option was added as a transition aide when symbol versioning was
first added.  It was enabled by default in 2007 and is supported even
by the old GPLv2 binutils.  Trying to disable it currently fails to
build in libc and at this point it isn't worth fixing the build.

Reported by: Michael Dexter
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D24637

4 years agogeli tests require OpenSSL - exclude them under WITHOUT_OPENSSL
Ed Maste [Thu, 30 Apr 2020 21:09:01 +0000 (21:09 +0000)]
geli tests require OpenSSL - exclude them under WITHOUT_OPENSSL

PR: 245931
Submitted by: The FreeBSD Foundation

4 years agoFix three bugs highlighted by review:
Warner Losh [Thu, 30 Apr 2020 21:08:59 +0000 (21:08 +0000)]
Fix three bugs highlighted by review:

- maxio should be dp->d_maxsize. This is often MAXPHYS, but not always
  (especially if MAXPHYS is > 1MB).
- Unlock the periph before returning. We don't need to relock it to
  release the ccb.
- Make sure we release the ccb in error paths.

Reviewed by: cperciva

4 years agosrc.conf.5: regen after WITHOUT_OPENSSL dep changes
Ed Maste [Thu, 30 Apr 2020 21:08:22 +0000 (21:08 +0000)]
src.conf.5: regen after WITHOUT_OPENSSL dep changes

4 years agolualoader: config: improve readConfFiles, rename to readConf
Kyle Evans [Thu, 30 Apr 2020 21:04:39 +0000 (21:04 +0000)]
lualoader: config: improve readConfFiles, rename to readConf

The previous interface was pretty bad, and required the caller to get some
implementation details correct that it really shouldn't need to (e.g.
loader_conf_files handling) and pass in an empty table for it to use.

The new and much improved interface, readConf, is much less of a hack;
hiding these implementation details and just doing the right thing.
config.lua will now use it to process /boot/defaults/loader.conf and the
subsequent loader_conf_files from there, and read-conf will also use it.

This improvement submitted by Olivier (cited below), loader_conf_files
handling from the original patch was changed to just clobber it before
processing and not bother restoring it after the fact following r360505
where it's now guaranteed to evade the loader environment.

PR: 244640
Submitted by: Olivier Certner (olivier freebsd free fr>

4 years agolualoader: config: add a table for restricted environment vars
Kyle Evans [Thu, 30 Apr 2020 20:58:58 +0000 (20:58 +0000)]
lualoader: config: add a table for restricted environment vars

This new table should be used for transient values that don't need to end up
in the loader environment. Generally, these will be things that are internal
details that really aren't needed or interesting outside of the config
module (e.g. if we changed how ${module}_* directives work, they might use
this instead).

To start, populate it with loader_conf_files. Any specific value of
loader_conf_files isn't all that interesting; if we're going to export it,
we should really instead export a loader_conf_files that indicates all of
the configuration files we processed. This will be used to reduce
bookkeeping overhead in a future commit that cleans up readConfFiles.

4 years agoStyle(9) nit: put function name at start of line.
Warner Losh [Thu, 30 Apr 2020 20:58:38 +0000 (20:58 +0000)]
Style(9) nit: put function name at start of line.

4 years agoMove / reword a comment.
Warner Losh [Thu, 30 Apr 2020 20:58:33 +0000 (20:58 +0000)]
Move / reword a comment.

Explain what we're doing with mapping CAM's notion of a LUN to NVMe's
notion of a namespace.

4 years agoRemove stray blank line.
Warner Losh [Thu, 30 Apr 2020 19:48:55 +0000 (19:48 +0000)]
Remove stray blank line.

This was accidentally added in r360483.

4 years agosrc.opts.mk: add WITHOUT_OPENSSL dependencies
Ed Maste [Thu, 30 Apr 2020 18:11:56 +0000 (18:11 +0000)]
src.opts.mk: add WITHOUT_OPENSSL dependencies

A number of components require OpenSSL and fail to build if it is not
enabled.  As a first phase force these off under WITHOUT_OPENSSL.  A
second phase should make these more fine-grained, allowing the component
to build but without OpenSSL.

PR: 245931
Sponsored by: The FreeBSD Foundation

4 years agoig4iic_acpi_probe: remove set but unused variable
Andriy Gapon [Thu, 30 Apr 2020 15:45:01 +0000 (15:45 +0000)]
ig4iic_acpi_probe: remove set but unused variable

MFC after: 1 week

4 years agoIncrease the iflib txq callout mutex name length to 32 bytes.
Mark Johnston [Thu, 30 Apr 2020 15:39:04 +0000 (15:39 +0000)]
Increase the iflib txq callout mutex name length to 32 bytes.

With a length of 16, the name ("<if name>:TX(<qid>):callout") typically
gets truncated.

PR: 245712
Reported by: ghuckriede@blackberry.com
MFC after: 1 week

4 years agoAdd a new manual page for unionfs(5), written by
Benedict Reuschling [Thu, 30 Apr 2020 12:02:13 +0000 (12:02 +0000)]
Add a new manual page for unionfs(5), written by
Gordon Bergling. Hook it up to the build by adding
it to the Makefile.

Submitted by:     gbergling_gmail.com
Approved by:     bcr
Differential Revision: https://reviews.freebsd.org/D24589

4 years agoAdd HISTORY sections to disk(9), driver(9), and
Benedict Reuschling [Thu, 30 Apr 2020 11:17:29 +0000 (11:17 +0000)]
Add HISTORY sections to disk(9), driver(9), and
epoch(9).

In one instance, remove a trailing whitespace while here.

Submitted by: gbergling_gmail.com
Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D24243

4 years agoIntroduce a lower bound of 2 MSS to TCP Cubic.
Richard Scheffenegger [Thu, 30 Apr 2020 11:11:28 +0000 (11:11 +0000)]
Introduce a lower bound of 2 MSS to TCP Cubic.

Running TCP Cubic together with ECN could end up reducing cwnd down to 1 byte, if the
receiver continously sets the ECE flag, resulting in very poor transmission speeds.

In line with RFC6582 App. B, a lower bound of 2 MSS is introduced, as well as a typecast
to prevent any potential integer overflows during intermediate calculation steps of the
adjusted cwnd.

Reported by: Cheng Cui
Reviewed by: tuexen (mentor)
Approved by: tuexen (mentor)
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D23353

4 years agoloader.conf(5): document that loader_conf_files may be clobbered
Kyle Evans [Thu, 30 Apr 2020 02:50:58 +0000 (02:50 +0000)]
loader.conf(5): document that loader_conf_files may be clobbered

A future change in lualoader may take some liberties with the
loader_conf_files in the name of efficiency; namely, it may start omitting
it from the loader environment entirely so that it doesn't need to worry
about maintaining any specific value.

This variable has historically been incredibly volatile anyways, as it may
get set to completely different values in any given configuration file to
trigger a load of more files.

Document now that we may not maintain it in the future, but perhaps we'll
reserve the right to change our minds and eventually formally export all of
the loader configuration files that were read using this variable.

MFC after: 3 days

4 years agoMake sure that we get the sbuf resources we need.
Warner Losh [Thu, 30 Apr 2020 00:43:11 +0000 (00:43 +0000)]
Make sure that we get the sbuf resources we need.

Since we're calling sbuf_new with NOWAIT, make sure it can allocate a
buffer to use. Don't print anything if we can't get it.

Noticed by: rpokala

4 years agoImplement the NVME_GET_NSID and NVME_PASSTHROUGH_CMD ioctls
Warner Losh [Thu, 30 Apr 2020 00:43:07 +0000 (00:43 +0000)]
Implement the NVME_GET_NSID and NVME_PASSTHROUGH_CMD ioctls

With these two ioctls implemented in the nda driver, nvmecontrol now
works with nda just like it does with nvd. It eliminates the need to
jump through odd hoops to get this data.

4 years agoReturn the nvmeX device associated with the ndaX device.
Warner Losh [Thu, 30 Apr 2020 00:43:02 +0000 (00:43 +0000)]
Return the nvmeX device associated with the ndaX device.

Add the nvmeX device to the XPT_PATH_INQ nvme specific
information. while one could figure this out by looking up the
domain:bus:slot:function, it's a lot easier to have the SIM set it
directly since the sim knows this.

4 years agoGenerate a devctl event for interesting events
Warner Losh [Thu, 30 Apr 2020 00:27:19 +0000 (00:27 +0000)]
Generate a devctl event for interesting events

When we reset the controller, and when the controller tells us about a
critical warning, send an event.

4 years agosrc.conf.5: regen after 359736, ZONEINFO_OLD_TIMEZONES_SUPPORT removal
Ed Maste [Thu, 30 Apr 2020 00:14:14 +0000 (00:14 +0000)]
src.conf.5: regen after 359736, ZONEINFO_OLD_TIMEZONES_SUPPORT removal

4 years agoPrevent premature shrinking of the scaled receive window
Richard Scheffenegger [Wed, 29 Apr 2020 22:01:33 +0000 (22:01 +0000)]
Prevent premature shrinking of the scaled receive window
which can cause a TCP client to use invalid or stale TCP sequence numbers for ACK packets.

Packets with old sequence numbers are ignored and not used to update the send window size.
This might cause the TCP session to hang indefinitely under some circumstances.

Reported by: Cui Cheng
Reviewed by: tuexen (mentor), rgrimes (mentor)
Approved by: tuexen (mentor), rgrimes (mentor)
MFC after: 3 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D24515

4 years agoConvert more rtentry field accesses into nhop fields accesses.
Alexander V. Chernikov [Wed, 29 Apr 2020 21:54:09 +0000 (21:54 +0000)]
Convert more rtentry field accesses into nhop fields accesses.

Continue routing subsystem conversion to nhop objects defined in r359823.
Use fields from nhop structure instead of "struct rtentry" fields.
This is one of the last changes prior to removing rt_ifp, rt_ifa,
 rt_gateway and rt_mtu from struct rtentry.

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

4 years agoCorrectly set up the initial TCP congestion window in all cases,
Richard Scheffenegger [Wed, 29 Apr 2020 21:48:52 +0000 (21:48 +0000)]
Correctly set up the initial TCP congestion window in all cases,
by not including the SYN bit sequence space in cwnd related calculations.
Snd_und is adjusted explicitly in all cases, outside the cwnd update, instead.

This fixes an off-by-one conformance issue with regular TCP sessions not
using Appropriate Byte Counting (RFC3465), sending one more packet during
the initial window than expected.

PR: 235256
Reviewed by: tuexen (mentor), rgrimes (mentor)
Approved by: tuexen (mentor), rgrimes (mentor)
MFC after: 3 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D19000

4 years agodtrace tests: Support globbing for excludes
Bryan Drewery [Wed, 29 Apr 2020 21:12:32 +0000 (21:12 +0000)]
dtrace tests: Support globbing for excludes

Downstream this makes skipping tests like common/ip/tst.*sctp*.ksh simpler.

Reviewed by: vangyzen, cem, markj
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D24608

4 years agoAdd nhop to the ifa_rtrequest() callback.
Alexander V. Chernikov [Wed, 29 Apr 2020 19:28:56 +0000 (19:28 +0000)]
Add nhop to the ifa_rtrequest() callback.

With the upcoming multipath changes described in D24141,
 rt->rt_nhop can potentially point to a nexthop group instead of
 an individual nhop.
To simplify caller handling of such cases, change ifa_rtrequest() callback
 to pass changed nhop directly.

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

4 years agoMove ARM specific flags to arm/Makefile.inc
Michal Meloun [Wed, 29 Apr 2020 16:05:50 +0000 (16:05 +0000)]
Move ARM specific flags to arm/Makefile.inc

Requested by: kib
MFC with: r360463

4 years agoFix style(9). Strip write only variables.
Michal Meloun [Wed, 29 Apr 2020 14:36:50 +0000 (14:36 +0000)]
Fix style(9). Strip write only variables.
Not a functional change.

MFC after: 1 week

4 years agoExport tracing facility of GIC500 ITS block.
Michal Meloun [Wed, 29 Apr 2020 14:31:25 +0000 (14:31 +0000)]
Export tracing facility of GIC500 ITS block.
Possibility of tracing of processing message based interrupts is very
useful for debugging of PCIe driver, mainly for its MSI part.

MFC after: 1 week

4 years agoSkip bectl jail test if jail not installed (WITHOUT_JAIL).
Olivier Cochard [Wed, 29 Apr 2020 14:15:21 +0000 (14:15 +0000)]
Skip bectl jail test if jail not installed (WITHOUT_JAIL).

Approved by: kevans
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D24613

4 years agoDon't try to set frequendcy for enumerated but newer started CPUs.
Michal Meloun [Wed, 29 Apr 2020 14:14:15 +0000 (14:14 +0000)]
Don't try to set frequendcy for enumerated but newer started CPUs.

Openfirmare enumerates and installs the driver for all processors,
regardless of whether they will be started later (because of power
constrains for example).

MFC after: 3 weeks

4 years agoDon't allow to use FPU inside of rtld library.
Michal Meloun [Wed, 29 Apr 2020 14:06:42 +0000 (14:06 +0000)]
Don't allow to use FPU inside of rtld library.
Clang10 may use FPU instructions for optimizing operations with
memory blocks. But we don't want to do lengthy save/restore of all
FPU registers across each rtld_start() call.

MFC after: 3 week

4 years agoDon't try to re-initialize already preseted regulator.
Michal Meloun [Wed, 29 Apr 2020 13:45:21 +0000 (13:45 +0000)]
Don't try to re-initialize already preseted regulator.

Don't set initial voltage for regulators having their voltage already
in allowed range. As side effect of this change, we don't try to set
initial voltage for fixed voltage regulators - these don't have impemented
voltage set  method so their initialization has always failed.

MFC after: 3 weeks

4 years agoMultiple fixes for rockchip iodomain driver:
Michal Meloun [Wed, 29 Apr 2020 13:43:15 +0000 (13:43 +0000)]
Multiple fixes for rockchip iodomain driver:
- always initialize selector of voltage signaling standard.
  Various versions of U-boot leaves voltage signaling standard settings
  for PMUIO2 domain in different state.  Always initialize it
  into expected state.
- start the driver as early as possible, the IO domains should be
  initialized before other drivers are attached.
- rename RK3399 register to its name founds in TRM.

This is the second part of fixes for serial port corruption observed after
DT 5.6 import.

Reviewed by: manu
MFC after: 1 week

4 years agoliblua: ensure that "require" will fail in bootstrap flua
Ed Maste [Wed, 29 Apr 2020 13:41:32 +0000 (13:41 +0000)]
liblua: ensure that "require" will fail in bootstrap flua

We do not want to support bootstrapping lua modules, so ensure that
require will fail by providing a nonexistent path.

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

4 years agoAdd HISTORY section to domain(9).
Benedict Reuschling [Wed, 29 Apr 2020 11:46:01 +0000 (11:46 +0000)]
Add HISTORY section to domain(9).

Submitted by: gbergling_gmail.com
Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D24150

4 years agoWhen copying and pasting the code in the EXAMPLE
Benedict Reuschling [Wed, 29 Apr 2020 11:25:04 +0000 (11:25 +0000)]
When copying and pasting the code in the EXAMPLE
section, it would result in the following error:

"ngctl: send msg: Invalid argument"

The reason for this is the missing whitespace to
separate the arguments. When adding the whitespace,
the example works as intended.

Submitted by:     lutz_donnerhacke.de
Approved by:     bcr
Differential Revision: https://reviews.freebsd.org/D23773

4 years agoUse universe-toolchain config(8)
Bryan Drewery [Wed, 29 Apr 2020 02:18:39 +0000 (02:18 +0000)]
Use universe-toolchain config(8)

This is a temporary hack to aid with config(8) changing in r360443.
It will not work for all cases.

env PATH is used because universe-toolchain is only built when worlds
are built, and then only if clang is needed, so it may not exist.

universe-toolchain needs to be expanded to always be built, inspected to
remove non-cross-build-safe tools, used for buildworld/buildkernel,
and potentially incremental build support.

Sponsored by: Dell EMC

4 years agosh: Assert INTOFF rather than applying it in ck*
Jilles Tjoelker [Tue, 28 Apr 2020 20:34:27 +0000 (20:34 +0000)]
sh: Assert INTOFF rather than applying it in ck*

As I noted in https://reviews.freebsd.org/D22756, INTOFF should be in effect
when calling ckmalloc/ckrealloc/ckfree to avoid memory leaks and double
frees. Therefore, change the functions to check if INTOFF is in effect
instead of applying it.

Reviewed by: bdrewery
Differential Revision: https://reviews.freebsd.org/D24599

4 years agoMove route-specific ddb commands to route/route_ddb.c
Alexander V. Chernikov [Tue, 28 Apr 2020 20:00:17 +0000 (20:00 +0000)]
Move route-specific ddb commands to route/route_ddb.c

Currently functionality resides in rtsock.c, which is a controlling
 interface, partially external to the routing subsystem.
Additionally, DDB-supporting functionality is > 100SLOC, which deserves
 a separate file.

Given that, move this functionality to a newly-created net/route/ subdir.

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D24561

4 years agoMove route_temporal.c and route_var.h to net/route.
Alexander V. Chernikov [Tue, 28 Apr 2020 19:14:09 +0000 (19:14 +0000)]
Move route_temporal.c and route_var.h to net/route.

Nexthop objects implementation, defined in r359823,
 introduced sys/net/route directory intended to hold all
 routing-related code. Move recently-introduced route_temporal.c and
 private route_var.h header there.

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

4 years agoRevert r360445
Bryan Drewery [Tue, 28 Apr 2020 18:53:49 +0000 (18:53 +0000)]
Revert r360445

I did not intend to commit this yet as more work is needed for
non-amd64 kernels.

4 years agoMove struct rtentry definition to nhop_var.h.
Alexander V. Chernikov [Tue, 28 Apr 2020 18:42:30 +0000 (18:42 +0000)]
Move struct rtentry definition to nhop_var.h.

One of the goals of the new routing KPI defined in r359823
 is to entirely hide`struct rtentry` from the consumers.
It will allow to improve routing subsystem internals and deliver
 features much faster.

This is one of the last changes, effectively moving struct rtentry
 definition to a net/route_var.h header, internal to the routing subsystem.

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

4 years agoctfmerge: Assert that there is enough room for types.
Bryan Drewery [Tue, 28 Apr 2020 16:09:28 +0000 (16:09 +0000)]
ctfmerge: Assert that there is enough room for types.

Sponsord by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D24537