]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoImplement pci_enable_msi() and pci_disable_msi() in the LinuxKPI.
hselasky [Wed, 14 Aug 2019 09:36:25 +0000 (09:36 +0000)]
Implement pci_enable_msi() and pci_disable_msi() in the LinuxKPI.
This patch makes the DRM graphics driver in ports usable on aarch64.

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

4 years agoAdd missing break statements in r351004.
mav [Wed, 14 Aug 2019 02:02:14 +0000 (02:02 +0000)]
Add missing break statements in r351004.

Surprisingly code still worked, but thanks imp@ for noticing it.

MFC after: 1 week

4 years agogeom_uzip(4), mkuzip(8): Add Zstd image mode
cem [Tue, 13 Aug 2019 23:32:56 +0000 (23:32 +0000)]
geom_uzip(4), mkuzip(8): Add Zstd image mode

The Zstd format bumps the CLOOP major number to 4 to avoid incompatibility
with older systems.  Support in geom_uzip(4) is conditional on the ZSTDIO
kernel option, which is enabled in amd64 GENERIC, but not all in-tree
configurations.

mkuzip(8) was modified slightly to always initialize the nblocks + 1'th
offset in the CLOOP file format.  Previously, it was only initialized in the
case where the final compressed block happened to be unaligned w.r.t.
DEV_BSIZE.  The "Fake" last+1 block change in r298619 means that the final
compressed block's 'blen' was never correct unless the compressed uzip image
happened to be BSIZE-aligned.  This happened in about 1 out of every 512
cases.  The zlib and lzma decompressors are probably tolerant of extra trash
following the frame they were told to decode, but Zstd complains that the
input size is incorrect.

Correspondingly, geom_uzip(4) was modified slightly to avoid trashing the
nblocks + 1'th offset when it is known to be initialized to a good value.
This corrects the calculated final real cluster compressed length to match
that printed by mkuzip(8).

mkuzip(8) was refactored somewhat to reduce code duplication and increase
ease of adding other compression formats.

  * Input block size validation was pulled out of individual compression
    init routines into main().

  * Init routines now validate a user-provided compression level or select
    an algorithm-specific default, if none was provided.

  * A new interface for calculating the maximal compressed size of an
    incompressible input block was added for each driver.  The generic code
    uses it to validate against MAXPHYS as well as to allocate compression
    result buffers in the generic code.

  * Algorithm selection is now driven by a table lookup, to increase ease of
    adding other formats in the future.

mkuzip(8) gained the ability to explicitly specify a compression level with
'-C'.  The prior defaults -- 9 for zlib and 6 for lzma -- are maintained.
The new zstd default is 9, to match zlib.

Rather than select lzma or zlib with '-L' or its absense, respectively, a
new argument '-A <algorithm>' is provided to select 'zlib', 'lzma', or
'zstd'.  '-L' is considered deprecated, but will probably never be removed.

All of the new features were documented in mkuzip.8; the page was also
cleaned up slightly.

Relnotes: yes

4 years agoMake nvd(4) report NGUID or EUI64 as GEOM::lunid.
mav [Tue, 13 Aug 2019 21:49:07 +0000 (21:49 +0000)]
Make nvd(4) report NGUID or EUI64 as GEOM::lunid.

With support for multiple namespaces and multiple ports in NVMe there is
now a need for reliable unique namespace identification alike to SCSI.

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

4 years agoFix build with DRM and INVARIANTS enabled.
jhb [Tue, 13 Aug 2019 21:15:59 +0000 (21:15 +0000)]
Fix build with DRM and INVARIANTS enabled.

The DRM drivers use the lockdep assertion macros with spinlock_t locks
which are backed by mutexes, not sx locks.  This causes compile
failures since you can't use sx_assert with a mutex.  Instead, change
the lockdep macros to use lock_class methods.  This works by assuming
that each LinuxKPI locking primitive embeds a FreeBSD lock as its
first structure and uses a cast to get to the underlying 'struct
lock_object'.

Reviewed by: hselasky
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20992

4 years agoClarify comment that describes how the FS_METACKHASH is managed.
mckusick [Tue, 13 Aug 2019 20:56:44 +0000 (20:56 +0000)]
Clarify comment that describes how the FS_METACKHASH is managed.

MFC after: 3 days

4 years agoRemove deprecated GEOM classes
cem [Tue, 13 Aug 2019 20:06:55 +0000 (20:06 +0000)]
Remove deprecated GEOM classes

Follow-up on r322318 and r322319 and remove the deprecated modules.

Shift some now-unused kernel files into userspace utilities that incorporate
them.  Remove references to removed GEOM classes in userspace utilities.

Reviewed by: imp (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D21249

4 years agosys/{x86,amd64}: remove one of doubled ;s
emaste [Tue, 13 Aug 2019 19:39:36 +0000 (19:39 +0000)]
sys/{x86,amd64}: remove one of doubled ;s

MFC after: 1 week

4 years agoping: use the monotonic clock to measure durations
asomers [Tue, 13 Aug 2019 19:27:23 +0000 (19:27 +0000)]
ping: use the monotonic clock to measure durations

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21245

4 years agoping6: use the monotonic clock to measure durations
asomers [Tue, 13 Aug 2019 19:24:17 +0000 (19:24 +0000)]
ping6: use the monotonic clock to measure durations

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21226

4 years agoping: fix data type of a variable for a packet sequence number
asomers [Tue, 13 Aug 2019 16:25:23 +0000 (16:25 +0000)]
ping: fix data type of a variable for a packet sequence number

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21244

4 years agoConsistently use the byteorder functions in the correct direction
asomers [Tue, 13 Aug 2019 16:22:43 +0000 (16:22 +0000)]
Consistently use the byteorder functions in the correct direction

Though ntohs and htons are functionally identical, they have different meanings.Using the correct one helps to document the code.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21219

4 years agofusefs: skip some tests when unsafe aio is disabled
asomers [Tue, 13 Aug 2019 15:52:28 +0000 (15:52 +0000)]
fusefs: skip some tests when unsafe aio is disabled

MFC after:      15 days
MFC-With:       r350665
Sponsored by:   The FreeBSD Foundation

4 years agor350976 accidentally removed nvram device. Restore it.
imp [Tue, 13 Aug 2019 15:50:47 +0000 (15:50 +0000)]
r350976 accidentally removed nvram device. Restore it.

4 years agofusefs: add SVN Keywords to the test files
asomers [Tue, 13 Aug 2019 15:49:40 +0000 (15:49 +0000)]
fusefs: add SVN Keywords to the test files

Reported by: SVN pre-commit hooks
MFC after: 15 days
MFC-With: r350665
Sponsored by: The FreeBSD Foundation

4 years agoRemove some more leftover rlogin man page xrefs
emaste [Tue, 13 Aug 2019 15:41:36 +0000 (15:41 +0000)]
Remove some more leftover rlogin man page xrefs

rcmds were removed in r32435 and these three man pages can trivially
drop the references.

There's still a reference in pts.4 because it describes a mode
(TIOCPKT_NOSTOP), and only lists rlogin/rlogind as examples of programs
that use that mode.  To update later.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoAdd PNP_INFO to the gpiopps driver.
ian [Tue, 13 Aug 2019 15:38:05 +0000 (15:38 +0000)]
Add PNP_INFO to the gpiopps driver.

4 years agoping6: Fix data type of a variable for a packet sequence number
asomers [Tue, 13 Aug 2019 15:30:29 +0000 (15:30 +0000)]
ping6: Fix data type of a variable for a packet sequence number

Submitted by:   Ján Sučan <sucanjan@gmail.com>
MFC after:      2 weeks
Sponsored by:   Google, inc. (Google Summer of Code 2019)
Differential Revision:  https://reviews.freebsd.org/D21218

4 years agoFlowtables were removed in r321618, remove stray reference here.
imp [Tue, 13 Aug 2019 15:28:22 +0000 (15:28 +0000)]
Flowtables were removed in r321618, remove stray reference here.

4 years agovx(4) was removed in r347921. Remove stray reference.
imp [Tue, 13 Aug 2019 15:28:18 +0000 (15:28 +0000)]
vx(4) was removed in r347921. Remove stray reference.

4 years agonsp(4) was removed in r339571. Remove stray reference.
imp [Tue, 13 Aug 2019 15:28:11 +0000 (15:28 +0000)]
nsp(4) was removed in r339571. Remove stray reference.

4 years agocrunch: remove rsh and rlogin from example config file
emaste [Tue, 13 Aug 2019 15:23:14 +0000 (15:23 +0000)]
crunch: remove rsh and rlogin from example config file

rcmds removed in r324351.

Historical references in the README are maintained.  There's a paragraph
describing a "980K crunched 'fixit'" that references rsh and rlogin.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agofe(4) driver has been removed from the tree in r347914. Remove stray reference.
imp [Tue, 13 Aug 2019 15:16:42 +0000 (15:16 +0000)]
fe(4) driver has been removed from the tree in r347914. Remove stray reference.

4 years agoRegen src.conf.5 after r350980 (remove rsh/rlogin references)
emaste [Tue, 13 Aug 2019 14:57:04 +0000 (14:57 +0000)]
Regen src.conf.5 after r350980 (remove rsh/rlogin references)

Also pick up changes to LLVM_TARGET_RISCV, NAND, NVME, OPENM

Sponsored by: The FreeBSD Foundation

4 years agoRemove rlogin/rsh references from src.conf(5) WITHOUT_BLACKLIST_SUPPORT
emaste [Tue, 13 Aug 2019 14:51:16 +0000 (14:51 +0000)]
Remove rlogin/rsh references from src.conf(5) WITHOUT_BLACKLIST_SUPPORT

rcmds were removed in r324351

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoRemove rsh/rlogin references from security man page
emaste [Tue, 13 Aug 2019 14:47:24 +0000 (14:47 +0000)]
Remove rsh/rlogin references from security man page

More extensive changes to this page are certainly needed, but at least
remove references to binaries that no longer exist.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agonvme has been moved to 'files' so shouldn't be here anymore. It works on
imp [Tue, 13 Aug 2019 13:41:46 +0000 (13:41 +0000)]
nvme has been moved to 'files' so shouldn't be here anymore. It works on
powerpc64 and arm64 these days as well as amd64/i386.

4 years agoed(4) has been removed from the tree, but these were forgotten in r347911.
imp [Tue, 13 Aug 2019 13:28:12 +0000 (13:28 +0000)]
ed(4) has been removed from the tree, but these were forgotten in r347911.

4 years agoSave ip_ttl value and restore it after checksum calculation.
ae [Tue, 13 Aug 2019 12:47:53 +0000 (12:47 +0000)]
Save ip_ttl value and restore it after checksum calculation.

Since ipvoly is used for checksum calculation, part of original IP
header is zeroed. This part includes ip_ttl field, that can be used
later in IP_MINTTL socket option handling.

PR: 239799
MFC after: 1 week

4 years agoPlace back in the dependency on HPTS via module depends versus
rrs [Tue, 13 Aug 2019 12:41:15 +0000 (12:41 +0000)]
Place back in the dependency on HPTS via module depends versus
a fatal error in compiling. This was taken out by mistake
when I mis-merged from the 18q22p2 sources of rack in NF. Opps.

Reported by: sbruno

4 years agoMove scheduler state into the per-cpu area where it can be allocated on the
jeff [Tue, 13 Aug 2019 04:54:02 +0000 (04:54 +0000)]
Move scheduler state into the per-cpu area where it can be allocated on the
correct NUMA domain.

Reviewed by: markj, gallatin
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D19315

4 years agoFix the driver name in ads111x.4, and hook the manpage up to the build.
ian [Tue, 13 Aug 2019 03:49:53 +0000 (03:49 +0000)]
Fix the driver name in ads111x.4, and hook the manpage up to the build.

The driver was originally written with the name ads1115, but at the last
minute it got renamed to ads111x to reflect its support for many related
chips, but I forgot to update the manpage to match the renaming before
committing it all.

4 years agoAdd deprecation notice to snd_maestro(4).
pfg [Tue, 13 Aug 2019 01:25:07 +0000 (01:25 +0000)]
Add deprecation notice to snd_maestro(4).

As suggested in:
https://wiki.freebsd.org/WhatsGoing/FreeBSD13

this old driver is buggy and no one is working on it so we should deprecate
it for the next release.

MFC after: 3 days
Diferential Revision: https://reviews.freebsd.org/D21139

4 years agoAdd deprecation notice to snd_ds1(4).
pfg [Tue, 13 Aug 2019 01:24:43 +0000 (01:24 +0000)]
Add deprecation notice to snd_ds1(4).

As suggested in:
https://wiki.freebsd.org/WhatsGoing/FreeBSD13

We will be dropping the snd_ds1 driver. The driver is known to be buggy
and no one has been working on it for years now.
Users of old Yamaha cards may have luck with the OSS drivers instead.

MFC after: 3 days
Diferential Revision: https://reviews.freebsd.org/D21138

4 years agoFix powerpc LINT build
imp [Mon, 12 Aug 2019 23:25:21 +0000 (23:25 +0000)]
Fix powerpc LINT build

tcpratelimit isn't supported as there's now atomic_add_64, so add it to the exclusion list
Add comment for why PPC_PROBE_CHIPSET is on the list
Remove UKBD_DFLT_KEYMAP now that ukbd works on all platforms.

4 years agoukbdmap.h rule was identical on all platforms, so move them into sys/conf/files.
imp [Mon, 12 Aug 2019 23:25:14 +0000 (23:25 +0000)]
ukbdmap.h rule was identical on all platforms, so move them into sys/conf/files.

This allows us to remove 'nodevice ukbd' from the arm64 NOTES file.

4 years agoCreate files.x86
imp [Mon, 12 Aug 2019 22:58:56 +0000 (22:58 +0000)]
Create files.x86

files.x86 is for the parts of the system that are common to both i386 and amd64
due too their nature. First up, to get the ball rolling, is fdc, the floppy disk
support. It works only on amd64 and i386 these days, and that's unlikely to
change.

Reviewed by: jhb, cem (earlier versrions)
Differential Revision: https://reviews.freebsd.org/D21210

4 years agoFloppy driver really only works on x86
imp [Mon, 12 Aug 2019 22:58:50 +0000 (22:58 +0000)]
Floppy driver really only works on x86

Move the floppy driver to the x86 specific notes file.

Reviewed by: jhb, manu, jhibbits, emaste
Differential Revision: https://reviews.freebsd.org/D21208

4 years agoMove sc out of the global file
imp [Mon, 12 Aug 2019 22:58:44 +0000 (22:58 +0000)]
Move sc out of the global file

x86 needs sc, as does sparc64. powerpc doesn't use it by default, but some old
powermac notebooks do not work with vt yet for reasons unknonw. Even so, I've
removed it from powerpc LINT. It's not in daily use there, and the intent is to
100% switch to vt now that it works for that platform to limit support burden.

All the other architectures omit some or all of the screen savers from their
lint config. Move them to the x86 NOTES files and remove the exclusions. This
reduces slightly the number of savers sparc64 compiles, but since they are in
GENERIC, the overage is adequate and if someone reaelly wants to sort them out
in sparc64 they can sweat the details and the testing.

Reviewed by: jhb (earlier version), manu (earlier version), jhibbits
Differential Revision: https://reviews.freebsd.org/D21233

4 years agoStart to split out the really x86 specific NOTES from the global notes file.
imp [Mon, 12 Aug 2019 22:58:13 +0000 (22:58 +0000)]
Start to split out the really x86 specific NOTES from the global notes file.
Start with COMPAT_43, since it's really only relevant to x86.

Reviewed by: jhb@
Differential Revision: https://reviews.freebsd.org/D21203

4 years agoMissed part of r350523.
mav [Mon, 12 Aug 2019 21:51:47 +0000 (21:51 +0000)]
Missed part of r350523.

MFC after: 3 days

4 years agoIncrease YPMAXRECORD to 16M to be compatible with Linux.
kib [Mon, 12 Aug 2019 20:27:33 +0000 (20:27 +0000)]
Increase YPMAXRECORD to 16M to be compatible with Linux.

Since YP protocol definition uses the constant to declare
variable-size opaque byte strings, the change should be binary
compatible with existing installations which do not expose keys or
values larger than 1024 bytes.

All uses of local variables with YPMAXRECORD sizes were removed to
avoid insane stack use.  On the other hand, variables with static
lifetime should be fine and only result in increased VA use.

Glibc made same change, increasing the allowed length for keys and
values in YP to 16M, in 2013.

Reviewed by: markj
Discussed with: ian
Sponsored by: Mellanox Technologies
MFC after: 3 weeks
Differential revision: https://reviews.freebsd.org/D20900

4 years agoFix style and clarify comment
luporl [Mon, 12 Aug 2019 19:44:57 +0000 (19:44 +0000)]
Fix style and clarify comment

Fix code style in proc.h and clarify comment about empty structs.

4 years ago[ppc] avoid empty mdproc struct
luporl [Mon, 12 Aug 2019 17:18:20 +0000 (17:18 +0000)]
[ppc] avoid empty mdproc struct

Avoid empty structs, that have undefined behavior in C99 and
make compilers complain about it
(empty struct has size 0 in C, size 1 in C++).

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

4 years ago[PPC64] Save FPU registers before enabling VSX
luporl [Mon, 12 Aug 2019 12:51:47 +0000 (12:51 +0000)]
[PPC64] Save FPU registers before enabling VSX

Fixed trap handler logic, in order to make it save FPU registers,
if FPU is enabled, before enabling VSX. Without this change, FPU
register contents were being lost when set before VSX was enabled.

4 years agoMFV r350896: 6585 sha512, skein, and edonr have an unenforced dependency on extensibl...
avg [Mon, 12 Aug 2019 11:42:16 +0000 (11:42 +0000)]
MFV r350896: 6585 sha512, skein, and edonr have an unenforced dependency on extensible dataset

illumos/illumos-gate@892586e8a147c02d7f4053cc405229a13e796928
https://github.com/illumos/illumos-gate/commit/892586e8a147c02d7f4053cc405229a13e796928

https://www.illumos.org/issues/6585
  In any pool without the extensible dataset feature flag already enabled,
  creating a dataset with dedup set to use one of the new checksums would result
  in the following panic as soon as any data was added:
  panic[cpu0]/thread=ffffff0006761c40: feature_get_refcount(spa, feature,
  &refcount) != 48 (0x30 != 0x30), file: ../../common/fs/zfs/zfeature.c line 390

  ffffff0006761830 fffffffffba8fbdd ()
  ffffff0006761890 zfs:feature_do_action+11a ()
  ffffff00067618c0 zfs:spa_feature_incr+1e ()
  ffffff0006761920 zfs:dmu_object_zapify+b7 ()
  ffffff00067619b0 zfs:dsl_dataset_activate_feature+97 ()
  ffffff0006761a20 zfs:dsl_dataset_sync+ba ()
  ffffff0006761ab0 zfs:dsl_pool_sync+153 ()
  ffffff0006761b70 zfs:spa_sync+26e ()
  ffffff0006761c20 zfs:txg_sync_thread+227 ()
  ffffff0006761c30 unix:thread_start+8 ()
  Inspection showed that feature->fi_feature was 7, which is the value of
  SPA_FEATURE_EXTENSIBLE_DATASET in the spa_feature enum.
  Testing shows that the panic can be prevented by explicitly setting extensible
  dataset as a dependency for the sha512, edonr, and skein feature flags.
  Alternatively, the new checksums code could possibly be changed to obviate the
  need for the dependency.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Richard Laager <rlaager@wiktel.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: ilovezfs <ilovezfs@icloud.com>

Note that FreeBSD does not support ednor yet.

MFC after: 2 weeks

4 years agoinstall.1: Add missing arguments to option descriptions
0mp [Mon, 12 Aug 2019 10:57:56 +0000 (10:57 +0000)]
install.1: Add missing arguments to option descriptions

While here:
- Remove deprecated Tn macros.
- Do not use macros with the -width option.

Reviewed by: bcr
Approved by: doc (bcr)
Differential Revision: https://reviews.freebsd.org/D21173

4 years agoa stop gap fix for a race between dnode_hold and dnode_sync_free
avg [Mon, 12 Aug 2019 10:30:00 +0000 (10:30 +0000)]
a stop gap fix for a race between dnode_hold and dnode_sync_free

The race was introduced in r337669, the large dnode feature import from
ZoL.  The problem was debugged by ZoL developers and then,
independently, on FreeBSD.

The fix is an early proposal by Brian Behlendorf:
https://github.com/behlendorf/zfs/commit/50f32ed74e42aa28522e9681fb8ae55239fa33a7
This fix never went into ZoL.  A larger change that was committed later
included a different solution because of the re-worked code.

Ideally, we want to revert this fix and re-synchronize FreeBSD large
dnode code with that in illumos (or newer ZoL).  illumos has a later
import of the feature from ZoL that does not have the bug.

PR: 236480
Obtained from: Brian Behlendorf <behlendorf1@llnl.gov>
Submitted by: ncrogers@gmail.com (patch adaptation)
Reported by: ncrogers@gmail.com
Tested by: ncrogers@gmail.com,
Dennis Noordsij <dennis.noordsij@alumni.helsinki.fi>,
Julien Cigar <julien@perdition.city>
MFC after: 10 days

4 years agoAllow ZVOL bookmarks to be listed recursively
avg [Mon, 12 Aug 2019 10:00:32 +0000 (10:00 +0000)]
Allow ZVOL bookmarks to be listed recursively

Many thanks to cryx-freebsd@h3q.com for reporting the problem and
submitting a fix.  I have chosen to take an equivalent but textually
different patch from ZoL just to avoid increasing divergence between
OpenZFS flavours.

ZoL commit: zfsonlinux/zfse33da554c5daf0103b093f44ab5b90ad6c064c3f
Author: loli10K <ezomori.nozomu@gmail.com>
Date: Wed Sep 7 19:34:20 2016 +0200
PR: 197821
Submitted by: cryx-freebsd@h3q.com (alternative version)
Reported by: cryx-freebsd@h3q.com
Obtained from: ZoL
MFC after: 1 week

4 years agortwn_pci: add device ID for RTL8192CE.
avos [Mon, 12 Aug 2019 08:01:21 +0000 (08:01 +0000)]
rtwn_pci: add device ID for RTL8192CE.

PR: 239795
Submitted by: James Parsons <james.m.parsons@protonmail.com>
MFC after: 1 week
Relnotes: yes

4 years agopowerpc: Unify pmap definitions between AIM and Book-E
jhibbits [Mon, 12 Aug 2019 03:03:56 +0000 (03:03 +0000)]
powerpc: Unify pmap definitions between AIM and Book-E

This is part 2 of r347078, pulling the page directory out of the Book-E
pmap.  This breaks KBI for anything that uses struct pmap (such as vm_map)
so any modules that access this must be rebuilt.

4 years agoInitialize the frentry (the control block that defines a rule) checksum
cy [Mon, 12 Aug 2019 02:42:47 +0000 (02:42 +0000)]
Initialize the frentry (the control block that defines a rule) checksum
to zero. Matching checksums save time and effort by mitigating the need
for full rule compare.

MFC after: 3 days

4 years agoCalculate the number interface array elements using the new FR_NUM macro
cy [Sun, 11 Aug 2019 23:54:52 +0000 (23:54 +0000)]
Calculate the number interface array elements using the new FR_NUM macro
instead of the hard-coded value of 4. This is a precursor to increasing
the number of interfaces speficied in "on {interface, ..., interface}".
Note that though this feature is coded in ipf_y.y, it is partially
supported in the ipfilter kld, meaning it does not work yet (and is yet
to be documented in ipf.5 too).

MFC after: 2 weeks

4 years agor272552 applied the patch from ipfilter upstream fil.c r1.129 to fix
cy [Sun, 11 Aug 2019 23:54:49 +0000 (23:54 +0000)]
r272552 applied the patch from ipfilter upstream fil.c r1.129 to fix
broken ipfilter rule matches (upstream bug #554). The upstream patch
was incomplete, it resolved all but one rule compare issue. The issue
fixed here is when "{to, reply-to, dup-to} interface" are used in
conjuncion with "on interface". The match was only made if the on keyword
was specified in the same order in each case referencing the same rule.
This commit fixes this.

The reason for this is that interface name strings and comment keyword
comments are stored in a a variable length field starting at fr_names
in the frentry struct. These strings are placed into this variable length
in the order they are encountered by ipf_y.y and indexed through index
pointers in fr_ifnames, fr_comment or one of the frdest struct fd_name
fields. (Three frdest structs are within frentry.) Order matters and
this patch takes this into account.

While in here it was discovered that though ipfilter is designed to
support multiple interface specifiations per rule (up to four), this
undocumented (the man page makes no mention of it) feature does not work.
A todo is to fix the multiple interfaces feature at a later date. To
understand the design decision as to why only four were intended, it is
suspected that the decision was made because Sun workstations and PCs
rarely if ever exceeded four NICs at the time, this is not true in 2019.

PR: 238796
Reported by: WHR <msl0000023508@gmail.com>
MFC after: 2 weeks

4 years agoRevert r350841. I didn't realize that on this chip, reading the interrupt
ian [Sun, 11 Aug 2019 23:19:56 +0000 (23:19 +0000)]
Revert r350841.  I didn't realize that on this chip, reading the interrupt
status register clears pending interrupts.  By moving that code out of the
interrupt handler into a taskqueue task, I effectively created an interrupt
storm by returning from the handler with the interrupt source still active.

We'll have to find a different solution for this driver's need to sleep
in an ithread context.

4 years agocompat/linux: Remove obsoleted and somewhat confusing comments related to COMPAT_43.
kib [Sun, 11 Aug 2019 19:17:29 +0000 (19:17 +0000)]
compat/linux: Remove obsoleted and somewhat confusing comments related to COMPAT_43.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21200

4 years agoOnly enable COMPAT_43 changes for syscalls ABI for a.out processes.
kib [Sun, 11 Aug 2019 19:16:07 +0000 (19:16 +0000)]
Only enable COMPAT_43 changes for syscalls ABI for a.out processes.

Reviewed by: imp, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D21200

4 years agowait(2): clarify reparenting of children of the exiting process.
kib [Sun, 11 Aug 2019 15:47:48 +0000 (15:47 +0000)]
wait(2): clarify reparenting of children of the exiting process.

Point to the existence of reapers and mention that init is the default
reaper.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agowait(2): split long line by using .Fo/.Fa instead of .Ft.
kib [Sun, 11 Aug 2019 15:44:36 +0000 (15:44 +0000)]
wait(2): split long line by using .Fo/.Fa instead of .Ft.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agoping6: Remove unnecessary level of indirection from dnsdecode() parameter
asomers [Sun, 11 Aug 2019 15:36:18 +0000 (15:36 +0000)]
ping6: Remove unnecessary level of indirection from dnsdecode() parameter

The `sp' pointer doesn't need to be modified in the caller of
dnsdecode().

This fixes -Wcast-qual error (`must have all intermediate pointers
const qualified to be safe') when compiled with WARNS=6.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21215

4 years agoping6: Add missing static keyword for a global variable
asomers [Sun, 11 Aug 2019 15:27:34 +0000 (15:27 +0000)]
ping6: Add missing static keyword for a global variable

This fixes -Wmissing-variable-declarations error when compiled with
WARNS=6.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21214

4 years agoping6: Revoke root privilege earlier
asomers [Sun, 11 Aug 2019 15:22:53 +0000 (15:22 +0000)]
ping6: Revoke root privilege earlier

It can be done just after the sockets have been created.

Submitted by: Ján Sučan <sucanjan@gmail.com>
MFC after: 2 weeks
Sponsored by: Google, inc. (Google Summer of Code 2019)
Differential Revision: https://reviews.freebsd.org/D21213

4 years agoUpgrade to Bzip2 version 1.0.8.
delphij [Sun, 11 Aug 2019 06:26:03 +0000 (06:26 +0000)]
Upgrade to Bzip2 version 1.0.8.

MFC after: 3 days

4 years agoRemove use of intr_config_hook from the am335x_pmic and tda19988 drivers.
ian [Sat, 10 Aug 2019 20:08:37 +0000 (20:08 +0000)]
Remove use of intr_config_hook from the am335x_pmic and tda19988 drivers.
Long ago this was needed, but now low-level i2c controller drivers cleverly
defer attachment of the bus until interrupts are enabled (if they require
interrupts to function), so that every i2c slave device doesn't have to.

4 years agoThe am335x_ehrpwm driver now requires the pwmbus_if interface, add it.
ian [Sat, 10 Aug 2019 20:05:15 +0000 (20:05 +0000)]
The am335x_ehrpwm driver now requires the pwmbus_if interface, add it.

4 years agoAllow the sdhci timeout sysctl var to be set as a tunable. Also, add a
ian [Sat, 10 Aug 2019 20:03:14 +0000 (20:03 +0000)]
Allow the sdhci timeout sysctl var to be set as a tunable.  Also, add a
missing newline in a warning printf.

4 years agoallwinner: Add support to min/max in aw_clk_frac
manu [Sat, 10 Aug 2019 19:02:50 +0000 (19:02 +0000)]
allwinner: Add support to min/max in aw_clk_frac

The Fractionals clock in Allwinner device have some min/max frequencies
that they can do.
Add support for it.

4 years agoRemove some duplicate code that end up in r350844
manu [Sat, 10 Aug 2019 18:58:25 +0000 (18:58 +0000)]
Remove some duplicate code that end up in r350844

4 years agoallwinner: Add a new clock aw_clk_m
manu [Sat, 10 Aug 2019 18:50:37 +0000 (18:50 +0000)]
allwinner: Add a new clock aw_clk_m

We used the aw_clk_nm clock for clock with only one divider factor
and used a fake multiplier factor. This cannot work properly as we
end up writing the "fake" factor to the register (and so always set
the LSB to 1).
Create a new clock for those.
The reason for not using the clk_div clock is because those clocks are
a bit special. Since they are (almost) all related to video we also need
to set the parent clock (the main PLL) to a frequency that they can support.
As the main PLL have some minimal frequency that they can support we need to
be able to set the main PLL to a multiple of the desired frequency.
Let say you want to have a 71Mhz pixel clock (typical for a 1280x800 display)
and the main PLL cannot go under 192Mhz, you need to set it to 3 times the
desired frequency and set the divider to 3 on the hdmi clock.
So this also introduce the CLK_SET_ROUND_MULTIPLE flag that allow for this kind
of scenario.

4 years ago.gitignore: Add LINT kernel configurations generated into SRCDIR
cem [Sat, 10 Aug 2019 18:22:22 +0000 (18:22 +0000)]
.gitignore: Add LINT kernel configurations generated into SRCDIR

4 years agoallwinner: Rework the BUS_PASS on drivers
manu [Sat, 10 Aug 2019 17:58:30 +0000 (17:58 +0000)]
allwinner: Rework the BUS_PASS on drivers

- Put all clock and control unit driver in BUS_PASS_RESOURCE except
  for the DE2 CCU as it needs the main CCU to be available.
- Use BUS_PASS_CPU for a20_cpu_cfg as it makes more sense.
- For aw_syscon use SCHEDULER pass as we need it early for drivers
  that attach in BUS_PASS_SUPPORTDEV
- For the rest we can use BUS_PASS_SUPPORTDEV

4 years agoWhen responding to an interrupt in the am335x_pmic driver, use a taskqueue
ian [Sat, 10 Aug 2019 17:48:11 +0000 (17:48 +0000)]
When responding to an interrupt in the am335x_pmic driver, use a taskqueue
thread to do the work that involves i2c IO, which sleeps while the IO is
in progress.

4 years agoGarbage collect the no-longer-necessary MAX_IIC_DATA_SIZE (there is not a
ian [Sat, 10 Aug 2019 17:28:14 +0000 (17:28 +0000)]
Garbage collect the no-longer-necessary MAX_IIC_DATA_SIZE (there is not a
buffer allocated at that fixed size anymore).

4 years agoSwitch the am335x_pmic driver to using iicdev_readfrom/writeto.
ian [Sat, 10 Aug 2019 17:14:35 +0000 (17:14 +0000)]
Switch the am335x_pmic driver to using iicdev_readfrom/writeto.

PR: 239697
Submitted by: Chuhong Yuan

4 years agotests/sys/opencrypto: enable armv8crypto on aarch64
ngie [Sat, 10 Aug 2019 15:53:42 +0000 (15:53 +0000)]
tests/sys/opencrypto: enable armv8crypto on aarch64

This change makes required modifications in runtests to also only require the
aesni module on Intel (i386/amd64) platforms, as it is an Intel specific
module.

MFC after: 1 month
MFC to: ^/stable/12 (support not present on ^/stable/11)
Submitted by: Greg V <greg@unrelenting.technology>
Differential Revision: https://reviews.freebsd.org/D21018

4 years agoThese are no longer a thing, remove them.
imp [Sat, 10 Aug 2019 04:15:36 +0000 (04:15 +0000)]
These are no longer a thing, remove them.

We don't need to omit ep and ex from LINT since they have been removed from the
tree.

4 years agoDon't add -Wno-class-memaccess with older gcc.
brooks [Fri, 9 Aug 2019 23:50:57 +0000 (23:50 +0000)]
Don't add -Wno-class-memaccess with older gcc.

This is a gcc 8.0+ warning which needed to be silenced on for the riscv
build.  amd64-xtoolchain-gcc still uses gcc 6.4.0 and does not understand
this flag.

Reviewed by: asomers
Feedback from: imp
Differential Revision: https://reviews.freebsd.org/D21195

4 years agoImplement _umtx_op_err.S on powerpc / powerpc64.
bdragon [Fri, 9 Aug 2019 20:16:38 +0000 (20:16 +0000)]
Implement _umtx_op_err.S on powerpc / powerpc64.

As per r177853, we need to avoid using errno inside user mutex code, since
 signal handlers can interfere with it and mess up libthr internal state.

So, implement _umtx_op_err() instead, which makes a raw syscall and
returns the error value directly instead of using errno.

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

4 years agoloader: add error check for vdev_indirect calls
tsoome [Fri, 9 Aug 2019 19:09:05 +0000 (19:09 +0000)]
loader: add error check for vdev_indirect calls

We can error out due to memory allocation errors, we can not recover from
those and need to get out.

4 years agoAdd missing new line in several log messages.
ae [Fri, 9 Aug 2019 08:58:09 +0000 (08:58 +0000)]
Add missing new line in several log messages.

PR: 239694
MFC after: 1 week

4 years agoIn m_pulldown(), before trying to prepend bytes to the subsequent mbuf,
jtl [Fri, 9 Aug 2019 05:18:59 +0000 (05:18 +0000)]
In m_pulldown(), before trying to prepend bytes to the subsequent mbuf,
ensure that the subsequent mbuf contains the remainder of the bytes
the caller sought. If this is not the case, fall through to the code
which gathers the bytes in a new mbuf.

This fixes a bug where m_pulldown() could fail to gather all the desired
bytes into consecutive memory.

PR: 238787
Reported by: A reddit user
Discussed with: emaste
Obtained from: NetBSD
MFC after: 3 days

4 years agoautofs: Fix autounmountd's printing of mount time.
jhibbits [Fri, 9 Aug 2019 02:20:26 +0000 (02:20 +0000)]
autofs: Fix autounmountd's printing of mount time.

time_t should be printed as intmax_t.  Even though duration should be short, the
correct way to print is intmax_t, not long.

Reported by: ian,imp

4 years agotools/tools/crypto: cryptokeytest: Fix build with newer OpenSSL
cem [Fri, 9 Aug 2019 02:11:47 +0000 (02:11 +0000)]
tools/tools/crypto: cryptokeytest: Fix build with newer OpenSSL

Also, drag into this decade.

4 years agoFlesh out the STANDARDS and AUTHORS sections in the du(1) man page.
markj [Thu, 8 Aug 2019 21:16:15 +0000 (21:16 +0000)]
Flesh out the STANDARDS and AUTHORS sections in the du(1) man page.

PR: 239722
Submitted by: Gordon Bergling <gbergling@gmail.com>
MFC after: 3 days

4 years agoUpdate RFC references in the whois(1) man page.
markj [Thu, 8 Aug 2019 21:15:02 +0000 (21:15 +0000)]
Update RFC references in the whois(1) man page.

PR: 239720
Submitted by: Gordon Bergling <gbergling@gmail.com>
MFC after: 3 days

4 years agoAdd a reference to the NFSv3 RFC.
markj [Thu, 8 Aug 2019 21:08:13 +0000 (21:08 +0000)]
Add a reference to the NFSv3 RFC.

PR: 239721
Submitted by: Gordon Bergling <gbergling@gmail.com>
MFC after: 3 days

4 years agoFix formatting.
markj [Thu, 8 Aug 2019 20:56:52 +0000 (20:56 +0000)]
Fix formatting.

PR: 239726
Submitted by: Gordon Bergling <gbergling@gmail.com>
MFC after: 3 days

4 years agoStopgap fix for gcc platforms.
imp [Thu, 8 Aug 2019 20:09:36 +0000 (20:09 +0000)]
Stopgap fix for gcc platforms.

Our in-tree gcc doesn't have a no-tree-vectorize optimization knob, so we get a
warning that it's unused. This causes the build to fail on all our gcc platforms.
Add a quick version check as a stop-gap measure to get CI building again.

4 years agoRemove some harmless cruft from vn_generic_copy_file_range().
rmacklem [Thu, 8 Aug 2019 20:07:38 +0000 (20:07 +0000)]
Remove some harmless cruft from vn_generic_copy_file_range().

An earlier version of the patch had code that set "error" between
line#s 2797-2799. When that code was moved, the second check for "error != 0"
could never be true and the check became harmless cruft.
This patch removes the cruft, mainly to make Coverity happy.

Reported by: asomers, cem

4 years agoFix copy_file_range(2) for an unlikely race during hole finding.
rmacklem [Thu, 8 Aug 2019 19:53:07 +0000 (19:53 +0000)]
Fix copy_file_range(2) for an unlikely race during hole finding.

Since the VOP_IOCTL(FIOSEEKDATA/FIOSEEKHOLE) calls are done with the
vnode unlocked, it is possible for another thread to do:
- truncate(), lseek(), write()
between the two calls and create a hole where FIOSEEKDATA returned the
start of data.
For this case, VOP_IOCTL(FIOSEEKHOLE) will return the same offset for
the hole location. This could result in an infinite loop in the copy
code, since copylen is set to 0 and the copy doesn't advance.
Usually, this race is avoided because of the use of rangelocks, but the
NFS server does not do range locking and could do a sequence like the
above to create the hole.

This patch checks for this case and makes the hole search fail, to avoid
the infinite loop.

At this time, it is an open question as to whether or not the NFS server
should do range locking to avoid this race.

4 years agoloader: support com.delphix:removing
tsoome [Thu, 8 Aug 2019 18:08:13 +0000 (18:08 +0000)]
loader: support com.delphix:removing

We should support removing vdev from boot pool. Update loader zfs reader
to support com.delphix:removing.

Reviewed by: allanjude
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18901

4 years agoFirst pass at a LINT for arm64.
imp [Thu, 8 Aug 2019 17:55:19 +0000 (17:55 +0000)]
First pass at a LINT for arm64.

Create a rough and ready NOTES file from GENERIC, remove the duplication from
sys/conf/NOTES and add relevant no* directives to make this compile.

Reviewed by: jhb, manu (earlier versions that differed only in comments)
Differential Revision: https://reviews.freebsd.org/D21184

4 years agoMake arm64 32-bit mode compile with COMPAT_43
imp [Thu, 8 Aug 2019 17:48:07 +0000 (17:48 +0000)]
Make arm64 32-bit mode compile with COMPAT_43

The COMPAT_43 option isn't quite like the other compat options, and arm64 makes
attempts to support it in 64-bit mode. In 32-bit compat mode, however, two
syscall implementations that COMPAT_FREEBSD32 assumes will be there are
missing. Provide implementations for these: ofreebsd32_sigreturn (which we'll
never encounter, so implement it as nosys as is done in kern_sig.c) and
ofreebsd32_getpagesize, where we'll always return 4096 since that's the only
PAGE_SIZE we support, similar to how the ia32 implementation does things.

Reviewed by: manu@
Differential Revision: https://reviews.freebsd.org/D21192

4 years agoVerify files loaded in chain command.
mw [Thu, 8 Aug 2019 17:03:30 +0000 (17:03 +0000)]
Verify files loaded in chain command.

The chain command can be used to chain load another binary.
If veriexec is enabled we should verify it first.
Note that on EFI systems the verification was already done
through firmware, assuming that Secure Boot was enabled there.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: sjg
MFC after: 1 week
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D20952

4 years agoUpdate to Zstandard 1.4.2
cem [Thu, 8 Aug 2019 16:54:22 +0000 (16:54 +0000)]
Update to Zstandard 1.4.2

The full release notes for 1.4.1 (skipped) and 1.4.2 can be found on Github:

  https://github.com/facebook/zstd/releases/tag/v1.4.1
  https://github.com/facebook/zstd/releases/tag/v1.4.2

These are mostly minor updates; 1.4.1 purportedly brings something like 7%
faster decompression speed.

Relnotes: yes

4 years agoFix mac_veriexec_parser build after r347938
mw [Thu, 8 Aug 2019 16:51:49 +0000 (16:51 +0000)]
Fix mac_veriexec_parser build after r347938

In r347938 the definition of mac_veriexec_metadata_add_file
so adjust the argument list accordingly.

Submitted by: Kornel Duleba <mindal@semihalf.com>

4 years agoFix stack grow for init.
kib [Thu, 8 Aug 2019 16:48:19 +0000 (16:48 +0000)]
Fix stack grow for init.

During early stages of kern_exec(), including strings copyout,
p_textvp for init is NULL.  This prevented stack grow from working for
init execution.

Without stack gap enabled, initial stack segment size is enough for
strings passed by kernel to init.  With the gap enabled, the used
address might fall out of the initial segment, which kills init.

Exclude initproc from the check for contexts which should not cause
stack grow in the target map.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoUpdate comment explaining create_init().
kib [Thu, 8 Aug 2019 16:42:53 +0000 (16:42 +0000)]
Update comment explaining create_init().

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agomips: Fix register target for SP setting in libproc
jhibbits [Thu, 8 Aug 2019 16:37:32 +0000 (16:37 +0000)]
mips: Fix register target for SP setting in libproc

Copy-paste-o from r233042
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D21188

4 years agoimport zstd 1.4.2
cem [Thu, 8 Aug 2019 15:37:56 +0000 (15:37 +0000)]
import zstd 1.4.2