]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agopkgbase: remove logic for _profile packages
Kyle Evans [Mon, 2 Mar 2020 15:58:50 +0000 (15:58 +0000)]
pkgbase: remove logic for _profile packages

We don't produce these anymore as of r356797, remove the remnant in
generate-ucl.sh that accounted for them. This isn't strictly necessary, but
future work is needed for the various packages that can be generated on a
lib build.

Namely, we may produce -development packages for private/internal libs that
should be installed but won't have the base FreeBSD-libfoo pkg to depend on
because it's internal (e.g. liby, libpmcstat, libifconfig) but we want the
headers installed. It may be a better move to just shove these into
-runtime-development instead, but if not then we've just simplified the
cases that need to take private/internal libs into account.

4 years agosys/: Document few more sysctls.
Pawel Biernacki [Mon, 2 Mar 2020 15:30:52 +0000 (15:30 +0000)]
sys/: Document few more sysctls.

Submitted by: Antranig Vartanian <antranigv@freebsd.am>
Reviewed by: kaktus
Commented by: jhb
Approved by: kib (mentor)
Sponsored by: illuria security
Differential Revision: https://reviews.freebsd.org/D23759

4 years agoAdd a space missed in r358545
Andrew Turner [Mon, 2 Mar 2020 14:36:15 +0000 (14:36 +0000)]
Add a space missed in r358545

Sponsored by: Innovate UK

4 years agoelfctl: tiny style(9) cleanup, use bool where appropriate
Ed Maste [Mon, 2 Mar 2020 14:34:26 +0000 (14:34 +0000)]
elfctl: tiny style(9) cleanup, use bool where appropriate

4 years agoGenerate the offsets for struct arm64_bootparams and use it in locore.S
Andrew Turner [Mon, 2 Mar 2020 14:06:50 +0000 (14:06 +0000)]
Generate the offsets for struct arm64_bootparams and use it in locore.S

This removes one place with hard coded offsets in locore.S

Sponsored by: Innovate UK

4 years agoRemove old contrib/libstdc++, unused since r358454
Ed Maste [Mon, 2 Mar 2020 14:04:09 +0000 (14:04 +0000)]
Remove old contrib/libstdc++, unused since r358454

Sponsored by: The FreeBSD Foundation

4 years agoExpose the ACPI power button, sleep button and LID state as evdev's.
Hans Petter Selasky [Mon, 2 Mar 2020 09:45:06 +0000 (09:45 +0000)]
Expose the ACPI power button, sleep button and LID state as evdev's.

This allows libinput to disable touchpads when the lid is closed and
various desktop environments can show power-off dialogs when the power
button is pressed. While the latter is doable with devd a
cross-platform solution is nicer.

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

4 years agoMFV r358511,r358532:
Martin Matuska [Mon, 2 Mar 2020 08:44:58 +0000 (08:44 +0000)]
MFV r358511,r358532:

Sync libarchive with vendor.

Relevant vendor changes:
  Issue #1257: Add testcase for ZIPX files with LZMA_STREAM_END marker
  PR #1331: cpio.5: fix hard link description
  Issue #1335: archive_read.c: fix UBSan warning about undefined behavior
  Issue #1338: XAR reader: fix UBSan warning about undefined behavior
  Issue #1339: bsdcpio_test: fix datatype in from_hex()
  Issue #1341: Safe writes: delete temporary file if rename fails.
  Issue #1341: Safe writes: improve error handling

MFC after: 1 week

4 years agoelfctl: initialize features
Kyle Evans [Mon, 2 Mar 2020 04:22:38 +0000 (04:22 +0000)]
elfctl: initialize features

GCC points out a couple levels down in convert_to_features that this may be
used uninitialized. Indeed, this is true- initialize it to NULL so that we
at least deref a null pointer.

4 years agoif_edsc: generate an arbitrary MAC address
Kyle Evans [Mon, 2 Mar 2020 02:45:57 +0000 (02:45 +0000)]
if_edsc: generate an arbitrary MAC address

When generating an cloned interface instance in edsc_clone_create(),
generate a MAC address from the FF OUI with ether_gen_addr(). This allows us
to have unique local-link addresses. Previously, the MAC address was zero.

Submitted by: Neel Chauhan <neel AT neelc DOT org>
Differential Revision: https://reviews.freebsd.org/D23842

4 years agoMove ELF feature note tool to usr.bin/elfctl
Ed Maste [Mon, 2 Mar 2020 02:36:41 +0000 (02:36 +0000)]
Move ELF feature note tool to usr.bin/elfctl

elfctl is a tool for modifying the NT_FREEBSD_FEATURE_CTL ELF note,
which contains a set of flags for enabling or disabling vulnerability
mitigations and other features.

Reviewed by: csjp, kib
MFC after: 2 weeks
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23910

4 years agoUpdate vendor/libarchive/dist to git 85b9f665b6a2d4397fdd38992152d011265e374b
Martin Matuska [Mon, 2 Mar 2020 02:12:53 +0000 (02:12 +0000)]
Update vendor/libarchive/dist to git 85b9f665b6a2d4397fdd38992152d011265e374b

Relevant vendor changes:
  Issue #1257: Add testcase for ZIPX files with LZMA_STREAM_END marker
  PR #1331: cpio.5: fix hard link description
  Issue #1335: archive_read.c: fix UBSan warning about undefined behavior
  Issue #1338: XAR reader: fix UBSan warning about undefined behavior
  Issue #1339: bsdcpio_test: fix datatype in from_hex()
  Issue #1341: Safe writes: delete temporary file if rename fails

4 years agoRemove BROOKTREE_ALLOC_PAGES now that bktr is now gone.
Warner Losh [Mon, 2 Mar 2020 00:23:31 +0000 (00:23 +0000)]
Remove BROOKTREE_ALLOC_PAGES now that bktr is now gone.

4 years agoRemove obsolete old-freebsd version compat shim.
Warner Losh [Sun, 1 Mar 2020 23:01:51 +0000 (23:01 +0000)]
Remove obsolete old-freebsd version compat shim.

4 years agoRemove pre-FreeBSD 11 compat code.
Warner Losh [Sun, 1 Mar 2020 23:01:47 +0000 (23:01 +0000)]
Remove pre-FreeBSD 11 compat code.

4 years agoRemove stale FreeBSD_version checks.
Warner Losh [Sun, 1 Mar 2020 23:01:37 +0000 (23:01 +0000)]
Remove stale FreeBSD_version checks.

4 years agoRemove comment about Blackthorn winds, apparently imported from 4.4BSD
Greg Lehey [Sun, 1 Mar 2020 22:10:37 +0000 (22:10 +0000)]
Remove comment about Blackthorn winds, apparently imported from 4.4BSD
Lite.  Nowadays it's trivial to find the explanation, such as at
https://www.deseret.com/2000/2/27/19493013/blackthorn-winds-make-bushes-bud.
It doesn't seem appropriate to replace it with an explanation.

4 years agoAvoid doubly wiring a newly allocated page in vm_page_grab_valid().
Mark Johnston [Sun, 1 Mar 2020 22:09:11 +0000 (22:09 +0000)]
Avoid doubly wiring a newly allocated page in vm_page_grab_valid().

This fixes a regression from r358363.

Reported by: manu, jbeich
Tested by: jbeich

4 years agovfs: stop taking additional refs on root vnode during lookup
Mateusz Guzik [Sun, 1 Mar 2020 21:54:28 +0000 (21:54 +0000)]
vfs: stop taking additional refs on root vnode during lookup

They are spurious since introduction of struct pwd, which provides them
implicitly.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23885

4 years agofd: move vnodes out of filedesc into a dedicated structure
Mateusz Guzik [Sun, 1 Mar 2020 21:53:46 +0000 (21:53 +0000)]
fd: move vnodes out of filedesc into a dedicated structure

The new structure is copy-on-write. With the assumption that path lookups are
significantly more frequent than chdirs and chrooting this is a win.

This provides stable root and jail root vnodes without the need to reference
them on lookup, which in turn means less work on globally shared structures.
Note this also happens to fix a bug where jail vnode was never referenced,
meaning subsequent access on lookup could run into use-after-free.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23884

4 years agofd: make fgetvp_rights work without the filedesc lock
Mateusz Guzik [Sun, 1 Mar 2020 21:50:13 +0000 (21:50 +0000)]
fd: make fgetvp_rights work without the filedesc lock

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D23883

4 years agovm: add debug to uma_zone_set_smr
Mateusz Guzik [Sun, 1 Mar 2020 21:49:16 +0000 (21:49 +0000)]
vm: add debug to uma_zone_set_smr

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

4 years agoFinish removal of bktr
Warner Losh [Sun, 1 Mar 2020 20:37:42 +0000 (20:37 +0000)]
Finish removal of bktr

Remove the old ioctl .h files
Remove copying/linking ioctl .h files in instasllworld
Remove bktr from lint
Add now-removed files with ObsoleteFiles

4 years agoreadelf: add PROTMAX_DISABLE and STKGAP_DISABLE
Ed Maste [Sun, 1 Mar 2020 20:25:57 +0000 (20:25 +0000)]
readelf: add PROTMAX_DISABLE and STKGAP_DISABLE

From r349609 (PROTMAX_DISABLE) and r354790 (STKGAP_DISABLE).  Commited
upstream (in a slightly different form) as r3831.

Sponsored by: The FreeBSD Foundation

4 years agocontrolelf: fix indentation for larger flags
Ed Maste [Sun, 1 Mar 2020 20:19:38 +0000 (20:19 +0000)]
controlelf: fix indentation for larger flags

Sponsored by: The FreeBSD Foundation

4 years agoRemove bktr(4)
Warner Losh [Sun, 1 Mar 2020 19:15:03 +0000 (19:15 +0000)]
Remove bktr(4)

Remove the brooktree driver as discussed on arch@. Bump FreeBSD version to
1300082, though I doubt anything will care.

Relnote: yes

4 years agoFix build.
Xin LI [Sun, 1 Mar 2020 18:55:59 +0000 (18:55 +0000)]
Fix build.

4 years agoRemove noise that once upon a time allowed netback to build on FreeBSD 6. The
Warner Losh [Sun, 1 Mar 2020 18:18:11 +0000 (18:18 +0000)]
Remove noise that once upon a time allowed netback to build on FreeBSD 6. The
network layer has evolved since then, and this won't compile there.

4 years agoRemove FreeBSD 8 support from virtio.
Warner Losh [Sun, 1 Mar 2020 18:18:07 +0000 (18:18 +0000)]
Remove FreeBSD 8 support from virtio.

The sbuf API has evolved since 8, as have many others. The other API sweeps
didn't make the changes conditional, so this is now noise.

4 years agoRemove support for FreeBSD 4-7 from the iscsi initiator.
Warner Losh [Sun, 1 Mar 2020 18:18:01 +0000 (18:18 +0000)]
Remove support for FreeBSD 4-7 from the iscsi initiator.

Also, inline/remove now empty or trivial macros. CAM has evolved enough this
code couldn't work there anyway, and the API sweeep commits made since then were
made unconditional.

4 years agoRemove conditional code for FreeBSD 8 and earlier frmo cxgb.
Warner Losh [Sun, 1 Mar 2020 18:17:56 +0000 (18:17 +0000)]
Remove conditional code for FreeBSD 8 and earlier frmo cxgb.

4 years agoFinish removing support from old versions
Warner Losh [Sun, 1 Mar 2020 18:17:51 +0000 (18:17 +0000)]
Finish removing support from old versions

Eliminate code for old versions, inline pci_find_cap instead of relying on
compat ifdef.

This commit should have been combined with r358488 before pushing it in.

4 years agoRemove FreeBSD 7-10 support from bxe driver.
Warner Losh [Sun, 1 Mar 2020 17:46:28 +0000 (17:46 +0000)]
Remove FreeBSD 7-10 support from bxe driver.

Use new PCIER and PCIEM names in the driver rather than relying on old, compat
shims.

4 years agoRemove support for FreeBSD 8 systems. These workarounds and ways of rescanning
Warner Losh [Sun, 1 Mar 2020 17:27:35 +0000 (17:27 +0000)]
Remove support for FreeBSD 8 systems. These workarounds and ways of rescanning
devices are no longer done.

4 years agoRemove all the compatibility hacks for systems that predate FreeBSD 8. Some of
Warner Losh [Sun, 1 Mar 2020 17:27:30 +0000 (17:27 +0000)]
Remove all the compatibility hacks for systems that predate FreeBSD 8. Some of
these look to be cut and pasted from other drivers since this driver was
committed to FreeBSD 7-current and MFC'd to FreeBSD 6. The ones for FreeBSD 4
and 5 likely never were working...

4 years agoRemove compatibility code for changing sysctl definitions for pre FreeBSD 9
Warner Losh [Sun, 1 Mar 2020 17:27:25 +0000 (17:27 +0000)]
Remove compatibility code for changing sysctl definitions for pre FreeBSD 9
versions. These are just noise these days.

4 years agoRemove FreeBSD 7 conditional code... We've had a lot of other changes since then
Warner Losh [Sun, 1 Mar 2020 16:45:54 +0000 (16:45 +0000)]
Remove FreeBSD 7 conditional code... We've had a lot of other changes since then
and al_eth appears only in the Annapurna ARM designs which arrived in the tree
after that.

4 years agolinuxulator: Map scheduler priorities to Linux priorities.
Tijl Coosemans [Sun, 1 Mar 2020 13:12:04 +0000 (13:12 +0000)]
linuxulator: Map scheduler priorities to Linux priorities.

On Linux the valid range of priorities for the SCHED_FIFO and SCHED_RR
scheduling policies is [1,99].  For SCHED_OTHER the single valid priority is
0.  On FreeBSD it is [0,31] for all policies.  Programs are supposed to
query the valid range using sched_get_priority_(min|max), but of course some
programs assume the Linux values are valid.

This commit adds a tunable compat.linux.map_sched_prio.  When enabled
sched_get_priority_(min|max) return the Linux values and sched_setscheduler
and sched_(get|set)param translate between FreeBSD and Linux values.

Because there are more Linux levels than FreeBSD levels, multiple Linux
levels map to a single FreeBSD level, which means pre-emption might not
happen as it does on Linux, so the tunable allows to disable this behaviour.
It is enabled by default because I think it is unlikely that anyone runs
real-time software under Linux emulation on FreeBSD that critically relies
on correct pre-emption.

This fixes FMOD, a commercial sound library used by several games.

PR: 240043
Tested by: Alex S <iwtcex@gmail.com>
Reviewed by: dchagin
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D23790

4 years agoRemove stale definitions. The removed definitions are not used right
Michael Tuexen [Sun, 1 Mar 2020 12:34:27 +0000 (12:34 +0000)]
Remove stale definitions. The removed definitions are not used right
now and are incompatible with the correct ones in RFC 3168.

Submitted by: Richard Scheffenegger
Differential Revision: https://reviews.freebsd.org/D23903

4 years agoAdd -N option to powerd(8) to ignore "nice" time.
Colin Percival [Sat, 29 Feb 2020 22:31:23 +0000 (22:31 +0000)]
Add -N option to powerd(8) to ignore "nice" time.

With powerd_flags="-N", this makes powerd(8) exclude "nice" time when
computing the CPU utilization.  This makes it possible to prevent
CPU-intensive "background" processes from spinning up the CPU.

Note that only *userland* CPU usage belonging to "nice" processes is
excluded; we do not track whether time spent in the kernel is on behalf
of nice or non-nice processes, so kernel-intensive nice processes can
still result in the CPU being sped up.

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

4 years agoRemove support for varios versions from FreeBSD 4 to 8.
Warner Losh [Sat, 29 Feb 2020 22:16:27 +0000 (22:16 +0000)]
Remove support for varios versions from FreeBSD 4 to 8.

There's no way arcmsr will still work on those versions. Cleanup really old code
that's no longer needed.

4 years agoadd deprecation notice for bktr driver.
Warner Losh [Sat, 29 Feb 2020 21:50:08 +0000 (21:50 +0000)]
add deprecation notice for bktr driver.

We plan to remove bktr(4) in FreeBSD 13. Document that here.

Relnotes: yes

4 years agoCI: print wired page count on boot
Ed Maste [Sat, 29 Feb 2020 19:59:21 +0000 (19:59 +0000)]
CI: print wired page count on boot

This is a first step in tracking kernel memory use over time.

4 years agoCurrently kernel audit events for jail_set(2), jail_get(2), jail_attach(2),
Christian S.J. Peron [Sat, 29 Feb 2020 19:17:24 +0000 (19:17 +0000)]
Currently kernel audit events for jail_set(2), jail_get(2), jail_attach(2),
jail_remove(2) and finally setloginclass(2) are not being converted and
committed into userspace. Add the cases for these syscalls and make sure
they are being converted properly.

Reviewed by: bz, kevans
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23882

4 years agoEnsure that arm64 thread structures are allocated from the direct map.
Mark Johnston [Sat, 29 Feb 2020 18:41:48 +0000 (18:41 +0000)]
Ensure that arm64 thread structures are allocated from the direct map.

Otherwise we can fail to handle translation faults on curthread, leading
to a panic.

Reviewed by: alc, rlibby
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23895

4 years agoregen src.conf.5 for r358468, GPL_DTC removal
Ed Maste [Sat, 29 Feb 2020 17:24:02 +0000 (17:24 +0000)]
regen src.conf.5 for r358468, GPL_DTC removal

4 years agoretire in-tree GPL dtc devicetree compiler
Ed Maste [Sat, 29 Feb 2020 17:10:54 +0000 (17:10 +0000)]
retire in-tree GPL dtc devicetree compiler

Now that we no longer have GCC 4.2.1 in the tree and can assume FreeBSD
is being built with a C++11 compiler available, we can use BSDL dtc
unconditionally and retire the GPL dtc.

GPL dtc now has FreeBSD CI support via Cirrus-CI to help ensure it
continues to build/work on FreeBSD and is available in the ports tree
if needed.

The copy of (copyfree licensed) libfdt that we actually use is in
sys/contrib/libfdt so the extra copy under contrib/dtc/libfdt can be
removed along with the rest of the GPL dtc.

Reviewed by: kevans, ian, imp, manu, theraven
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23192

4 years agoFix the following -Werror warning from clang 10.0.0:
Dimitry Andric [Sat, 29 Feb 2020 14:11:27 +0000 (14:11 +0000)]
Fix the following -Werror warning from clang 10.0.0:

sys/arm64/arm64/identcpu.c:1170:5: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
                                break;
                                ^
sys/arm64/arm64/identcpu.c:1168:4: note: previous statement is here
                        if (fv[j].desc[0] != '\0')
                        ^

The break should be after the if statement, indented one level less.

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D23871

4 years agoremove contrib/gperf
Ed Maste [Sat, 29 Feb 2020 13:25:38 +0000 (13:25 +0000)]
remove contrib/gperf

gperf was used only as a build tool for GCC, and is not needed after
r358454.

Sponsored by: The FreeBSD Foundation

4 years agoFix test cases after r358448
Li-Wen Hsu [Sat, 29 Feb 2020 13:24:41 +0000 (13:24 +0000)]
Fix test cases after r358448

sbin.pfctl.pfctl_test.pf0087
sbin.pfctl.pfctl_test.selfpf0087

MFC with: r358448
Sponsored by: The FreeBSD Foundation

4 years agosrc.opts.mk: simplify Clang and lld bootstrap defaults
Ed Maste [Sat, 29 Feb 2020 13:15:01 +0000 (13:15 +0000)]
src.opts.mk: simplify Clang and lld bootstrap defaults

With the retirement of GCC 4.2.1 we can assume the host compiler supports
C++11, and can simplify the Clang and LLD defaults.  Clang and lld are now
enabled by default everywhere, and are used as the bootstrap compiler and
linker for all targets except MIPS.

Sponsored by: The FreeBSD Foundation

4 years agoregen src.conf.5 after r358460, LLVM_LIBUNWIND option retirement
Ed Maste [Sat, 29 Feb 2020 12:46:02 +0000 (12:46 +0000)]
regen src.conf.5 after r358460, LLVM_LIBUNWIND option retirement

4 years agoretire the LLVM_LIBUNWIND option
Ed Maste [Sat, 29 Feb 2020 12:43:43 +0000 (12:43 +0000)]
retire the LLVM_LIBUNWIND option

LLVM's libunwind is used on all FreeBSD-supported CPU architectures and
is a required component.

Reviewed by: brooks (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23123

4 years agoRemove contrib/gcc and contrib/gcclibs
Ed Maste [Sat, 29 Feb 2020 12:40:27 +0000 (12:40 +0000)]
Remove contrib/gcc and contrib/gcclibs

GCC 4.2.1 was disconnected from FreeBSD in r358454.

Sponsored by: The FreeBSD Foundation

4 years agoregen src.conf.5 after r358454, GCC 4.2.1 retirement
Ed Maste [Sat, 29 Feb 2020 03:43:18 +0000 (03:43 +0000)]
regen src.conf.5 after r358454, GCC 4.2.1 retirement

4 years agoremove GCC 4.2.1 build infrastructure
Ed Maste [Sat, 29 Feb 2020 03:25:51 +0000 (03:25 +0000)]
remove GCC 4.2.1 build infrastructure

As described in Warner's email message[1] to the FreeBSD-arch mailing
list we have reached GCC 4.2.1's retirement date.  At this time all
supported architectures either use in-tree Clang, or rely on external
toolchain (i.e., a contemporary GCC version from ports).

GCC 4.2.1 was released July 18, 2007 and was imported into FreeBSD later
that year, in r171825.  GCC has served us well, but version 4.2.1 is
obsolete and not used by default on any architecture in FreeBSD.  It
does not support modern C and does not support arm64 or RISC-V.

Thanks to everyone responsible for maintaining, updating, and testing
GCC in the FreeBSD base system over the years.

So long, and thanks for all the fish.

[1] https://lists.freebsd.org/pipermail/freebsd-arch/2020-January/019823.html

PR: 228919
Reviewed by: brooks, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23124

4 years agoProvide a lock free alternative to resolve bogus pages. This is not likely
Jeff Roberson [Fri, 28 Feb 2020 21:42:48 +0000 (21:42 +0000)]
Provide a lock free alternative to resolve bogus pages.  This is not likely
to be much of a perf win, just a nice code simplification.

Reviewed by: markj, kib
Differential Revision: https://reviews.freebsd.org/D23866

4 years agommc: dwmmc: Fix off by one error
Emmanuel Vadot [Fri, 28 Feb 2020 21:31:40 +0000 (21:31 +0000)]
mmc: dwmmc: Fix off by one error

The IVAR_MAX_DATA is supposed to have the number of descriptor X the mmc
block size and desc_count contain all this information + 1.

Reported by: phk
MFC after: 1 week

4 years agoDefine SCTL_MASK32 when COMPAT_FREEBSD32 is defined.
Brooks Davis [Fri, 28 Feb 2020 21:13:15 +0000 (21:13 +0000)]
Define SCTL_MASK32 when COMPAT_FREEBSD32 is defined.

Remove the list of architectures and depend on COMPAT_FREEBSD32 which is
defined (if relevent) in opt_global.h and thus defined everywhere in
the kernel.

This is a minor change in behavior in that 32-bit compat for sysctls now
depends on COMPAT_FREEBSD32 rather than on the potential for 32-bit
compat support. The prior arrangement may have been part of an attempt
to allow 32-bit compat to be loadable, but such attempts are doomed to
failure (due to the fact that ioctls have no meaning without the
associated file descriptor) without vastly more refactoring and some
sort of COMPAT_FREEBSD32_SUPPORT option.

Reviewed by: jhb
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D23748

4 years ago/etc/services: attempt to bring the database to this century 1/2.
Pedro F. Giffuni [Fri, 28 Feb 2020 20:43:35 +0000 (20:43 +0000)]
/etc/services: attempt to bring the database to this century 1/2.

This is the result of splitting r358153 in two, in order to avoid a build
system bug and being able to merge the change to previous releases..

Document better this file, updating the URL to the IANA registry and closely
match the official services.

For system ports (0 to 1023) we now try to follow the registry closely, noting
some historical differences where applicable.

As a side effect: drop references to unofficial Kerberos IV which was EOL'ed
on Oct 2006[1]. While it is conceivable some people may still use it in some
very old FreeBSD machines that can't be replaced easily, the use of it is
considered a security risk. Also drop the unofficial netatalk, which we
supported long ago in the kernel but was dropped long ago.

Leave for now smtps, even though it conflicts with IANA's submissions.
The change should have very little visibility, if any, but should be a
step closer to the current IANA database.

[1] https://web.mit.edu/kerberos/krb4-end-of-life.html

MFC after: 2 weeks

4 years agoConvert a few triviail consumers to the new unlocked grab API.
Jeff Roberson [Fri, 28 Feb 2020 20:34:30 +0000 (20:34 +0000)]
Convert a few triviail consumers to the new unlocked grab API.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D23847

4 years agoUse unlocked grab for uipc_shm/tmpfs.
Jeff Roberson [Fri, 28 Feb 2020 20:33:28 +0000 (20:33 +0000)]
Use unlocked grab for uipc_shm/tmpfs.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D23865

4 years agoSupport the NOCREAT flag for grab_valid_unlocked.
Jeff Roberson [Fri, 28 Feb 2020 20:32:35 +0000 (20:32 +0000)]
Support the NOCREAT flag for grab_valid_unlocked.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D23865

4 years agoSimplify vref() code in object_reference. The local temporary is no longer
Jeff Roberson [Fri, 28 Feb 2020 20:30:53 +0000 (20:30 +0000)]
Simplify vref() code in object_reference.  The local temporary is no longer
necessary.  Fix formatting errors.

Reported by: mjg
Discussed with: kib

4 years agoEliminate object locking in zfs where possible with the new lockless grab
Jeff Roberson [Fri, 28 Feb 2020 20:29:53 +0000 (20:29 +0000)]
Eliminate object locking in zfs where possible with the new lockless grab
APIs.

Reviewed by: kib, markj, mmacy
Differential Revision: https://reviews.freebsd.org/D23848

4 years agoamd64 pmap.c: minor codegen optimization in flag access
Ryan Libby [Fri, 28 Feb 2020 18:32:40 +0000 (18:32 +0000)]
amd64 pmap.c: minor codegen optimization in flag access

Following previous revision, apply the same minor optimization to
hand-rolled atomic_fcmpset_128 in pmap.c.

Reviewed by: kib, markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D23870

4 years agoamd64 atomic.h: minor codegen optimization in flag access
Ryan Libby [Fri, 28 Feb 2020 18:32:36 +0000 (18:32 +0000)]
amd64 atomic.h: minor codegen optimization in flag access

Previously the pattern to extract status flags from inline assembly
blocks was to use setcc in the block to write the flag to a register.
This was suboptimal in a few ways:
 - It would lead to code like: sete %cl; test %cl; jne, i.e. a flag
   would just be loaded into a register and then reloaded to a flag.
 - The setcc would force the block to use an additional register.
 - If the client code didn't care for the flag value then the setcc
   would be entirely pointless but could not be eliminated by the
   optimizer.

A more modern inline asm construct (since gcc 6 and clang 9) allows for
"flag output operands", where a C variable can be written directly from
a flag.  The optimizer can then use this to produce direct code where
the flag does not take a trip through a register.

In practice this makes each affected operation sequence shorter by five
bytes of instructions.  It's unlikely this has a measurable performance
impact.

Reviewed by: kib, markj, mjg
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D23869

4 years agoFix r358436 to not declare kernel symbols when _KERNEL is not defined.
Mark Johnston [Fri, 28 Feb 2020 17:38:31 +0000 (17:38 +0000)]
Fix r358436 to not declare kernel symbols when _KERNEL is not defined.

Reported by: Jenkins, Michael Butler
Pointy hat: markj

4 years agosy_call_t and systrace_args_func_t need to be visible to userspace.
Mark Johnston [Fri, 28 Feb 2020 17:23:53 +0000 (17:23 +0000)]
sy_call_t and systrace_args_func_t need to be visible to userspace.

Reported by: Jenkins

4 years agoDo not load dtraceall.ko if dtrace.ko is already loaded.
Mark Johnston [Fri, 28 Feb 2020 17:05:27 +0000 (17:05 +0000)]
Do not load dtraceall.ko if dtrace.ko is already loaded.

This was the intent of the existing code, but instead it would
unconditionally load dtraceall.ko because of a stale errno value.

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

4 years agoFix standalone builds of systrace.ko after r357912.
Mark Johnston [Fri, 28 Feb 2020 17:05:04 +0000 (17:05 +0000)]
Fix standalone builds of systrace.ko after r357912.

Sponsored by: The FreeBSD Foundation

4 years agoClear systrace_args_func when systrace probes are disabled.
Mark Johnston [Fri, 28 Feb 2020 17:04:36 +0000 (17:04 +0000)]
Clear systrace_args_func when systrace probes are disabled.

This function pointer is invalidated when systrace.ko is unloaded.

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

4 years agoAdd a blocking counter KPI.
Mark Johnston [Fri, 28 Feb 2020 16:05:18 +0000 (16:05 +0000)]
Add a blocking counter KPI.

refcount(9) was recently extended to support waiting on a refcount to
drop to zero, as this was needed for a lockless VM object
paging-in-progress counter.  However, this adds overhead to all uses of
refcount(9) and doesn't really match traditional refcounting semantics:
once a counter has dropped to zero, the protected object may be freed at
any point and it is not safe to dereference the counter.

This change removes that extension and instead adds a new set of KPIs,
blockcount_*, for use by VM object PIP and busy.

Reviewed by: jeff, kib, mjg
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23723

4 years agoAdd Denverton UART PCI ID
Justin Hibbits [Fri, 28 Feb 2020 15:59:35 +0000 (15:59 +0000)]
Add Denverton UART PCI ID

MFC after: 3 days
Sponsored by: Juniper Networks, Inc

4 years agodts: Update our copy for arm, arm64 and riscv dts to Linux 5.5
Emmanuel Vadot [Fri, 28 Feb 2020 15:42:51 +0000 (15:42 +0000)]
dts: Update our copy for arm, arm64 and riscv dts to Linux 5.5

MFC after: 2 months

4 years agoDTS: Update the device-tree files to Linux 5.5
Emmanuel Vadot [Fri, 28 Feb 2020 15:14:48 +0000 (15:14 +0000)]
DTS: Update the device-tree files to Linux 5.5

4 years agomld6: initialize oifp to avoid bogus results/panics in edge cases
Bjoern A. Zeeb [Fri, 28 Feb 2020 11:16:41 +0000 (11:16 +0000)]
mld6: initialize oifp to avoid bogus results/panics in edge cases

In certain cases (probably not during normal operation but observed in
the lab during development) ip6_ouput() could return without error
and ifpp (&oifp) not updated.
Given oifp was never initialized we would take the later branch
as oifp was not NULL, and when calling icmp6_ifstat_inc() we would
panic dereferencing a garbage pointer.
For code stability initialize oifp to NULL before first use to always
have a deterministic value and not rely on a called function to behave
and always and for ever do the work for us as we hope for.

MFC after: 3 days
Sponsored by: Netflix

4 years agoarm: zynq: An SPI driver for Zynq platforms
Emmanuel Vadot [Fri, 28 Feb 2020 10:57:23 +0000 (10:57 +0000)]
arm: zynq: An SPI driver for Zynq platforms

Submitted by: Thomas Skibo
Differential Revision: https://reviews.freebsd.org/D23319

4 years agobsdinstall: remove the Italian mirror
Philip Paeps [Fri, 28 Feb 2020 03:39:00 +0000 (03:39 +0000)]
bsdinstall: remove the Italian mirror

ftp.it.FreeBSD.org has been down for several years.

PR:             244481
Reported by:    xgeoplasma6@gmail.com
MFC after:      3 days

4 years agobsdconfig: remove the Italian mirror
Philip Paeps [Fri, 28 Feb 2020 03:38:57 +0000 (03:38 +0000)]
bsdconfig: remove the Italian mirror

ftp.it.FreeBSD.org has been down for several years.

PR:             244481
Reported by:    xgeoplasma6@gmail.com
MFC after:      3 days

4 years agoThis is a FALLTHROUGH for sure. no need for xxx comment.
Warner Losh [Fri, 28 Feb 2020 01:18:11 +0000 (01:18 +0000)]
This is a FALLTHROUGH for sure. no need for xxx comment.

4 years agoRemove duplicated ATA_CHECK_POWER_MODE
Warner Losh [Fri, 28 Feb 2020 01:02:01 +0000 (01:02 +0000)]
Remove duplicated ATA_CHECK_POWER_MODE

4 years agoRename TOE TLS stats from [rt]x_tls_* to [rt]x_toe_tls_*.
John Baldwin [Fri, 28 Feb 2020 00:42:27 +0000 (00:42 +0000)]
Rename TOE TLS stats from [rt]x_tls_* to [rt]x_toe_tls_*.

This more clearly differentiates TLS records encrypted and decrypted
in TOE connections from those encrypted via NIC TLS.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agoRemove trailing whitespace.
Brooks Davis [Thu, 27 Feb 2020 23:06:40 +0000 (23:06 +0000)]
Remove trailing whitespace.

4 years agoPlug possible memory leaks in the previous patch.
Jung-uk Kim [Thu, 27 Feb 2020 23:06:12 +0000 (23:06 +0000)]
Plug possible memory leaks in the previous patch.

Two DH_free() calls were accidentally removed.

Pointyhat to: jkim

4 years agoDo not free p and g parameters after calling DH_set0_pqg(3).
Jung-uk Kim [Thu, 27 Feb 2020 22:36:16 +0000 (22:36 +0000)]
Do not free p and g parameters after calling DH_set0_pqg(3).

It is specifically mentioned in the manual page.  Note it has no functional
change in reality because DH_set0_pqg() cannot fail when both p and g are
not NULL.

4 years agoFix style inconsistencies near our OpenSSL 1.1.x patch.
Jung-uk Kim [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.
Jung-uk Kim [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 Davis [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 Davis [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:
Dimitry Andric [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 the following -Werror warning from clang 10.0.0:
Dimitry Andric [Thu, 27 Feb 2020 19:58:20 +0000 (19:58 +0000)]
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.
Hiroki Sato [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.
Hiroki Sato [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.
Edward Tomasz Napierala [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.
Hiroki Sato [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 agoMerge ^/head r358269 through r358399.
Dimitry Andric [Thu, 27 Feb 2020 19:07:10 +0000 (19:07 +0000)]
Merge ^/head r358269 through r358399.

4 years agoSimplify lazy advance with a 64bit atomic cmpset.
Jeff Roberson [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 agoMerge ^/vendor/llvm-project/release-10.x up to its last change (upstream
Dimitry Andric [Thu, 27 Feb 2020 19:04:39 +0000 (19:04 +0000)]
Merge ^/vendor/llvm-project/release-10.x up to its last change (upstream
commit llvmorg-10.0.0-rc2-70-ge5cb70267e7), and bump versions.

4 years agoVendor import of llvm-project branch release/10.x
Dimitry Andric [Thu, 27 Feb 2020 18:58:42 +0000 (18:58 +0000)]
Vendor import of llvm-project branch release/10.x
llvmorg-10.0.0-rc2-70-ge5cb70267e7.