]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoMFC r363421: pkg-bootstrap: complain on improper `pkg bootstrap` usage
Kyle Evans [Thu, 6 Aug 2020 04:52:30 +0000 (04:52 +0000)]
MFC r363421: pkg-bootstrap: complain on improper `pkg bootstrap` usage

Right now, the bootstrap will gloss over things like pkg bootstrap -x or
pkg bootstrap -f pkg. Make it more clear that this is incorrect, and hint
at the correct formatting.

3 years agoMFC r363917:
Mark Johnston [Wed, 5 Aug 2020 17:07:13 +0000 (17:07 +0000)]
MFC r363917:
Fix a TOCTOU vulnerability in freebsd32_copyin_control().

PR: 248257
Reported by: m00nbsd working with Trend Micro Zero Day Initiative
Reviewed by: kib
Security: SA-20:23.sendmsg
Security: CVE-2020-7460
Security: ZDI-CAN-11543

3 years agoMFC r362564: stand: remove redundant declarations
Kyle Evans [Wed, 5 Aug 2020 14:42:45 +0000 (14:42 +0000)]
MFC r362564: stand: remove redundant declarations

These are picked out by the amd64-gcc6 build; time() is declared in <time.h>
and delay() is declared in <bootstrap.h>. These are the correct places for
these in stand/, so remove the duplicate declarations and make sure the
delay() consumer in libefi that depended on the extra delay() declaration
includes <bootstrap.h>.

3 years agoMFC r361257: bsdinstall: do a `certctl rehash` upon installation of config
Kyle Evans [Wed, 5 Aug 2020 14:40:09 +0000 (14:40 +0000)]
MFC r361257: bsdinstall: do a `certctl rehash` upon installation of config

If certctl is installed on the system we're configuring, do a certctl
rehash.

Note that certctl may not be present if the world we've installed was built
either WITHOUT_OPENSSL or WITHOUT_CAROOT. In this scenario, we don't
currently see if the host has a certctl as this may be an indication that
the system *shouldn't* have certs installed into /etc/ssl.

3 years agoMFC r359836-r359837, r359891, r360236-r360237: close_range(2)
Kyle Evans [Wed, 5 Aug 2020 03:53:57 +0000 (03:53 +0000)]
MFC r359836-r359837, r359891, r360236-r360237: close_range(2)

This commit diverges from our usual procedure of committing generated files
separately because the original commit, r359836, conflated userland use (in
tests) with the implementation.

__FreeBSD_version was already bumped ~15 hours prior to this MFC, 1201522
marks the introduction of close_range.

CPython will use this syscall for some pretty sizable performance gains.

r359836:
Implement a close_range(2) syscall

close_range(min, max, flags) allows for a range of descriptors to be
closed. The Python folk have indicated that they would much prefer this
interface to closefrom(2), as the case may be that they/someone have special
fds dup'd to higher in the range and they can't necessarily closefrom(min)
because they don't want to hit the upper range, but relocating them to lower
isn't necessarily feasible.

sys_closefrom has been rewritten to use kern_close_range() using ~0U to
indicate closing to the end of the range. This was chosen rather than
requiring callers of kern_close_range() to hold FILEDESC_SLOCK across the
call to kern_close_range for simplicity.

The flags argument of close_range(2) is currently unused, so any flags set
is currently EINVAL. It was added to the interface in Linux so that future
flags could be added for, e.g., "halt on first error" and things of this
nature.

This patch is based on a syscall of the same design that is expected to be
merged into Linux.

r359837:
sysent: re-roll after introduction of close_range in r359836

r359891:
close_range/closefrom: fix regression from close_range introduction

close_range will clamp the range between [0, fdp->fd_lastfile], but failed
to take into account that fdp->fd_lastfile can become -1 if all fds are
closed. =-( In this scenario, just return because there's nothing further we
can do at the moment.

Add a test case for this, fork() and simply closefrom(0) twice in the child;
on the second invocation, fdp->fd_lastfile == -1 and will trigger a panic
before this change.

r360236:
close_range(2): use newly assigned AUE_CLOSERANGE

r360237:
sysent: re-roll after 360236 (AUE_CLOSERANGE used)

3 years agoMFC r360235: bsm: add AUE_CLOSERANGE
Kyle Evans [Wed, 5 Aug 2020 03:30:03 +0000 (03:30 +0000)]
MFC r360235: bsm: add AUE_CLOSERANGE

3 years agoMFC r363431: Untie nmi_handle_intr() from DEV_ISA.
Alexander Motin [Wed, 5 Aug 2020 01:43:40 +0000 (01:43 +0000)]
MFC r363431: Untie nmi_handle_intr() from DEV_ISA.

The only part of nmi_handle_intr() depending on ISA is isa_nmi(), which is
already wrapped.  Entering debugger on NMI does not really depend on ISA.

3 years agoMFC r361992: ixl(4): Add FW recovery mode support and other things
Eric Joyner [Tue, 4 Aug 2020 23:30:10 +0000 (23:30 +0000)]
MFC r361992: ixl(4): Add FW recovery mode support and other things

Update the iflib version of ixl driver based on the OOT version ixl-1.11.29.

Major changes:

- Extract iflib specific functions from ixl_pf_main.c to ixl_pf_iflib.c
  to simplify code sharing between legacy and iflib version of driver

- Add support for most recent FW API version (1.10), which extends FW
  LLDP Agent control by user to X722 devices

- Improve handling of device global reset

- Add support for the FW recovery mode

- Use virtchnl function to validate virtual channel messages instead of
  using separate checks

- Fix MAC/VLAN filters accounting

Relnotes: yes
Sponsored by: Intel Corporation

3 years agoMFC r362962, r362963:
Mark Johnston [Tue, 4 Aug 2020 16:06:58 +0000 (16:06 +0000)]
MFC r362962, r362963:
iflib: Fix handling of mbuf cluster allocation failures.

3 years agoMFC r358996 (by pkelsey):
Mark Johnston [Tue, 4 Aug 2020 15:48:12 +0000 (15:48 +0000)]
MFC r358996 (by pkelsey):
Fix iflib zero-length fragment handling

MFC r358997 (by pkelsey):
Remove freelist contiguous-indexes assertion from rxd_frag_to_sd()

MFC r358998 (by pkelsey):
Allow iflib drivers to specify the buffer size used for each receive queue

MFC r358999 (by pkelsey):
Remove refill budget from iflib

MFC r359000 (by pkelsey):
Fix if_vmx receive checksum offload bug and harden against the device
skipping receive descriptors

MFC r359001 (by pkelsey):
Adjust if_vmx default receive parameters for better out-of-box performance

MFC r359002 (by pkelsey):
Remove extraneous code from iflib

MFC r359029 (by pkelsey):
Restore power-of-2 queue count constraint from r290948

Tested by: marcus, mav

3 years agoregen
Pawel Biernacki [Tue, 4 Aug 2020 12:44:47 +0000 (12:44 +0000)]
regen

3 years agoMFC kernel part of r351729
Pawel Biernacki [Tue, 4 Aug 2020 12:42:55 +0000 (12:42 +0000)]
MFC kernel part of r351729

Add sysctlbyname system call

The two syscalls that exists in head but not in stable/12 are marked as
UNIMPL to keep the __sysctlbyname syscall number the same (570).
Userland part to be commited in about a week time.

Requested by: mjg
Discussed with: kib

3 years agoMFC r363630:
Ryan Moeller [Tue, 4 Aug 2020 12:04:47 +0000 (12:04 +0000)]
MFC r363630:

libpmc: Use known pmc_cpuid buffer size

Use the existing PMC_CPUID_LEN to size pmc_cpuid in the kernel and various
buffers for reading it in libpmc.  This avoids some extra syscalls and
malloc/frees.

While in here, use strlcpy to copy a user-provided cpuid string instead of
memcpy, to make sure we terminate the buffer.

Reviewed by:    mav
Sponsored by:   iXsystems, Inc.
Differential Revision:  https://reviews.freebsd.org/D25679

3 years agoMFC r363656: When modifying LUN pass "special" options too.
Alexander Motin [Tue, 4 Aug 2020 02:31:52 +0000 (02:31 +0000)]
MFC r363656: When modifying LUN pass "special" options too.

Before switching to nvlists CTL merged previous and new options, so
any options not passed just kept previous value.  Now CTL completely
replaces them, so we must pass everything still relevant.

3 years agoMFC r363649:
Mark Johnston [Tue, 4 Aug 2020 00:28:06 +0000 (00:28 +0000)]
MFC r363649:
ps(1): Fix formatting of the "command" field for kernel threads.

3 years agoMFC r363608:
Mark Johnston [Mon, 3 Aug 2020 23:06:33 +0000 (23:06 +0000)]
MFC r363608:
mpr(4), mps(4): Stop checking for failures from malloc(M_WAITOK).

3 years agoMFC r363623:
Mark Johnston [Mon, 3 Aug 2020 23:05:47 +0000 (23:05 +0000)]
MFC r363623:
cxgbe(4): Stop checking for failures from malloc(M_WAITOK).

3 years agoMFC r363078:
Hans Petter Selasky [Mon, 3 Aug 2020 09:18:59 +0000 (09:18 +0000)]
MFC r363078:
Implement the bitmap_subset() function in the LinuxKPI. This function
checks if the bitmap pointed to by the first argument is a subset of
the bitmap pointed to by the second argument. The function returns one
on success and zero on failure.

Sponsored by: Mellanox Technologies

3 years agoMFC r363077:
Hans Petter Selasky [Mon, 3 Aug 2020 09:13:06 +0000 (09:13 +0000)]
MFC r363077:
Implement the array_size() function in the LinuxKPI. This function
basically multiplies its two arguments and returns SIZE_MAX if the
result overflows the size_t type.  Else the product of the two
arguments is returned.

Bump the FreeBSD_version to mitigate issues with existing
implementation of array_size() in drm-devel-kmod.

Discussed with: manu@
Sponsored by: Mellanox Technologies

3 years agoMFC r361549:
Hans Petter Selasky [Mon, 3 Aug 2020 09:11:10 +0000 (09:11 +0000)]
MFC r361549:
Add overflow.h to the LinuxKPI.

Only add check_add_overflow and check_mul_overflow as those are the only
two needed function by DRM v5.3.
Both gcc and clang have builtin to do this check so use them directly
but throw an error if the compiler/code checker doesn't support this builtin.

Sponsored-by: The FreeBSD Foundation
Reviewed by: hselsasky
Differential Revision: https://reviews.freebsd.org/D25015

3 years agoMFC 363621: sh(1): print a newline when ^D quits sh
Piotr Pawel Stefaniak [Mon, 3 Aug 2020 06:54:04 +0000 (06:54 +0000)]
MFC 363621: sh(1): print a newline when ^D quits sh

3 years agoMFC r363597: actually enable gate control for allwinner's r-ccu ir clock
Andriy Gapon [Mon, 3 Aug 2020 06:10:13 +0000 (06:10 +0000)]
MFC r363597: actually enable gate control for allwinner's r-ccu ir clock

3 years agoMFC r362791:
Colin Percival [Mon, 3 Aug 2020 01:00:20 +0000 (01:00 +0000)]
MFC r362791:
  Make EC2 AMIs use portsnap and freebsd-update mirrors hosted in AWS

3 years agoMFC r363284-r363285, r363452, r363670
Cy Schubert [Sun, 2 Aug 2020 04:25:11 +0000 (04:25 +0000)]
MFC r363284-r363285, r363452, r363670

r363284:
pfil_run_hooks() can be called recursively, so we have to
define FASTROUTE_RECURSION in fil.c

Submitted by: christos@NetBSD.org
Reported by: christos@NetBSD.org
Obtained from: NetBSD r1.31

r363285:
Fix incorrect byte order in ipfstat -f output.
- make sure frag is initialized to 0
- initialize ipfr_p field

NetBSD PR: 55137
Submitted by: christos@NetBSD.org
Reported by: christos@NetBSD.org
Obtained from: NetBSD fil.c r1.32, ip_frag.c r1.8

r363452:
Load ipfilter, ipnat, and ippool rules, and start ipmon in a vnet jail.

PR: 248109
Reported by: joeb1@a1poweruser.com

r363670:
Continued ipfilter #ifdef cleanup. The r343701 log entry contains a
complete description.

3 years agoMFC r363106 (by carlavilla): Add orders man page
Gordon Bergling [Sat, 1 Aug 2020 14:58:43 +0000 (14:58 +0000)]
MFC r363106 (by carlavilla): Add orders man page

PR: 239020
Submitted by: gbe
Approved by: imp
Obtained from: NetBSD
Differential Revision: https://reviews.freebsd.org/D24293

3 years agoMFC r359418 (by grog): Add STANDARDS section
Gordon Bergling [Sat, 1 Aug 2020 14:41:43 +0000 (14:41 +0000)]
MFC r359418 (by grog): Add STANDARDS section

PR: 239723
Submitted by: gbe
Reported by: gbe

3 years agoMFC r352577 (by 0mp): ascii(7): Add STANDARDS section and update HISTORY section
Gordon Bergling [Sat, 1 Aug 2020 14:33:22 +0000 (14:33 +0000)]
MFC r352577 (by 0mp): ascii(7): Add STANDARDS section and update HISTORY section

PR: 240727
Submitted by: gbe
Reviewed by: imp

3 years agoMFC r359547, r359629 (by imp): Note some functions that appeared in First Edition...
Gordon Bergling [Sat, 1 Aug 2020 14:22:05 +0000 (14:22 +0000)]
MFC r359547, r359629 (by imp): Note some functions that appeared in First Edition Unix

These functions first appeared in the First Edition of Unix (or earlier in the
pdp-7 version). Just claim 1st Edition for all this. The pdp-7 code is too
fragmented at this point to extend history that far back.

3 years agoMFC r359773 (by carlavilla): Add HISTORY section to getc(3)
Gordon Bergling [Sat, 1 Aug 2020 14:08:05 +0000 (14:08 +0000)]
MFC r359773 (by carlavilla): Add HISTORY section to getc(3)

PR: 240269
Submitted by: gbe
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D24295

3 years agoMFC r359772 (by carlavilla): exit(3): Add a HISTORY section
Gordon Bergling [Sat, 1 Aug 2020 14:00:47 +0000 (14:00 +0000)]
MFC r359772 (by carlavilla): exit(3): Add a HISTORY section

PR: 240259
Submitted by: gbe
Reviewed by: bcr
Approved by: bcr
Obtained from: OpenBSD
Differential Revision: https://reviews.freebsd.org/D24146

3 years agoMFC r359326 (by carlavilla): Add a HISTORY section to log(3) man page
Gordon Bergling [Sat, 1 Aug 2020 13:56:31 +0000 (13:56 +0000)]
MFC r359326 (by carlavilla): Add a HISTORY section to log(3) man page

PR: 240265
Submitted by: gbe
Approved by: bcr, imp
Differential Revision: https://reviews.freebsd.org/D24148

3 years agoMFC 363475:
Mateusz Piotrowski [Fri, 31 Jul 2020 12:02:04 +0000 (12:02 +0000)]
MFC 363475:

Fix grammar issues and typos

Reported by: ian

3 years agoMFC 363248:
Mateusz Piotrowski [Fri, 31 Jul 2020 10:55:23 +0000 (10:55 +0000)]
MFC 363248:

Remove old devd rules for ActiveWire and Entrega Serial DB25

Those rules have been broken at least since 8-STABLE, when the port
providing the ezdownload binary was removed (misc/ezload).

Reviewed by: kevans, imp
Differential Revision: https://reviews.freebsd.org/D25686

3 years agoMFC 363473:
Mateusz Piotrowski [Fri, 31 Jul 2020 10:40:47 +0000 (10:40 +0000)]
MFC 363473:

Document that force_depend() supports only /etc/rc.d scripts

Currently, force_depend() from rc.subr(8) does not support depending on
scripts outside of /etc/rc.d (like /usr/local/etc/rc.d). The /etc/rc.d path
is hard-coded into force_depend().

3 years agoMFC r363268:
Piotr Pawel Stefaniak [Fri, 31 Jul 2020 07:37:08 +0000 (07:37 +0000)]
MFC r363268:
Promote use of unprivileged users for building ports by documenting SU_CMD.
Phrasing by Daniel O'Connor.

Reviewed by: 0mp
Differential Revision: https://reviews.freebsd.org/D25433

3 years agoMFC r358908: Enable ixl device on PowerPC64
Eric Joyner [Thu, 30 Jul 2020 19:11:01 +0000 (19:11 +0000)]
MFC r358908: Enable ixl device on PowerPC64

Relnotes: yes

3 years agoMFC r362063: em(4): Always reinit interface when adding/removing VLAN
Eric Joyner [Thu, 30 Jul 2020 18:31:25 +0000 (18:31 +0000)]
MFC r362063: em(4): Always reinit interface when adding/removing VLAN

PR: 240818
Sponsored by: Intel Corporation

3 years agoMFC r363446:
Mark Johnston [Thu, 30 Jul 2020 14:48:48 +0000 (14:48 +0000)]
MFC r363446:
cuse: Stop checking for failures from malloc(M_WAITOK).

3 years agoMFC r361596: fortune: remove warning about potentially offensive fortunes
Ed Maste [Thu, 30 Jul 2020 14:42:50 +0000 (14:42 +0000)]
MFC r361596: fortune: remove warning about potentially offensive fortunes

They were removed long ago.

PR: 246736
Submitted by: Ruby Lazuli Lord

3 years agoMFC r363457: md5: return non-zero if built-in tests (-x) fail
Ed Maste [Thu, 30 Jul 2020 14:41:41 +0000 (14:41 +0000)]
MFC r363457: md5: return non-zero if built-in tests (-x) fail

3 years agoMFC r363383: dtrace/fbt: fix return probe arguments on arm
Andriy Gapon [Thu, 30 Jul 2020 14:05:24 +0000 (14:05 +0000)]
MFC r363383: dtrace/fbt: fix return probe arguments on arm

arg0 should be an offset of the return point within the function, arg1
should be the return value.  Previously the return probe had arguments as
if for the entry probe.

Tested on armv7.

andrew noted that the same problem seems to be present on arm64, mips,
and riscv.
I am not sure if I will get around to fixing those.  So, platform users
or anyone looking to make a contribution please be aware of this
opportunity.

3 years agoMFC r363382: gpioiic: never drive lines active high
Andriy Gapon [Thu, 30 Jul 2020 14:01:54 +0000 (14:01 +0000)]
MFC r363382: gpioiic: never drive lines active high

Few drivers support GPIO_PIN_OPENDRAIN.

3 years agoMFC r363232: build DTS for Orange Pi PC Plus as well
Andriy Gapon [Thu, 30 Jul 2020 13:56:45 +0000 (13:56 +0000)]
MFC r363232: build DTS for Orange Pi PC Plus as well

3 years agoMFC r362530: teach ena driver about RSS kernel option
Andriy Gapon [Thu, 30 Jul 2020 13:55:05 +0000 (13:55 +0000)]
MFC r362530: teach ena driver about RSS kernel option

Networking is broken if the driver configures its (virtual) hardware to
use a hash algorithm (or a key) different from the one that the network
stack (software RSS) uses.  This can be seen with connections initiated
from the host.  The PCB will be placed into the hash table based on the
hash value calculated by the software.  The hardware-calculated hash
value in reponse packets will be different, so the PCB won't be found.

Tested with a kernel compiled with 'options RSS' on an instance with ena
driver.

3 years agoMFC r362492: gpiobus_release_pin: remove incorrect prefix from error messages
Andriy Gapon [Thu, 30 Jul 2020 13:17:01 +0000 (13:17 +0000)]
MFC r362492: gpiobus_release_pin: remove incorrect prefix from error messages

3 years agoMFC r362294,r362647: hdac_intr_handler: keep working until global interrupt status...
Andriy Gapon [Thu, 30 Jul 2020 12:59:23 +0000 (12:59 +0000)]
MFC r362294,r362647: hdac_intr_handler: keep working until global interrupt status clears

It is plausible that the hardware interrupts a host only when GIS goes
from zero to one.  GIS is formed by OR-ing multiple hardware statuses,
so it's possible that a previously cleared status gets set again while
another status has not been cleared yet.  Thus, there will be no new
interrupt as GIS always stayed set.  If we don't re-examine GIS then we
can leave it set and never get another interrupt again.

Without this change I frequently saw a problem where snd_hda would stop
working.  Setting dev.hdac.1.polling=1 would bring it back to life and
afterwards I could set polling back to zero.  Sometimes the problem
started right after a boot, sometimes it happened after resuming from
S3, frequently it would occur when sound output and input are active
concurrently (such as during conferencing).  I looked at HDAC_INTSTS
while the sound was not working and I saw that both HDAC_INTSTS_GIS and
HDAC_INTSTS_CIS were set, but there were no interrupts.

3 years agoMFC r363453:
Cy Schubert [Thu, 30 Jul 2020 02:52:55 +0000 (02:52 +0000)]
MFC r363453:

Document the IPFILTER_PREDEFINED environment variable.

PR: 248088
Reported by: joeb1@a1poweruser.com

3 years agoMFC r363438:
Brooks Davis [Wed, 29 Jul 2020 22:10:25 +0000 (22:10 +0000)]
MFC r363438:

Use SI_ORDER_(FOURTH|FIFTH) rather than bespoke versions.

No functional change.

When these SYSINITs were added these macros didn't exist.

Reviewed by: imp
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25758

3 years agoMFC r363435:
Brooks Davis [Wed, 29 Jul 2020 20:30:15 +0000 (20:30 +0000)]
MFC r363435:

Avoid reading one byte before the path buffer.

This happens when there's only one component (e.g. "/foo"). This
(mostly-harmless) bug has been present since June 1990 when it was
commited to mountd.c SCCS version 5.9.

Note: the bug is on the second changed line, the first line is changed
for visual consistency.

Reviewed by: cem, emaste, mckusick, rmacklem
Reported by: CHERI
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25759

3 years agoMFC r363420:
Mark Johnston [Wed, 29 Jul 2020 14:30:42 +0000 (14:30 +0000)]
MFC r363420:
usb(4): Stop checking for failures from malloc(M_WAITOK).

3 years agoMake lex a bootstrap tool when cross-building on recent 13-CURRENT if
Don Lewis [Wed, 29 Jul 2020 04:36:45 +0000 (04:36 +0000)]
Make lex a bootstrap tool when cross-building on recent 13-CURRENT if
binutils/ld is going to be built.  The latter is no longer true by default.

The import of flex 2.6.4 into -CURRENT changed the type of yy_n_chars
in the lex skeleton from yy_size_t to int, which breaks the build of
binutils/ld when using the host copy of lex.

ldlex.c:3216:3: error: incompatible pointer types passing 'int *' to parameter
      of type 'yy_size_t *' (aka 'unsigned long *')
      [-Werror,-Wincompatible-pointer-types]
  ...YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is a direct commit to stable/12 since binutils/ld has been removed
from -CURRENT, and it would require a different fix there since the
bootstrap tool version of lex would also cause breakage.  This is similar
to the stable/11 change in r363653, but in stable/12 we only need to
build lex as a bootstrap tool if binutils/ld is going to be built.

3 years agoMFC r363363, r363416: geli(8): new example with file based storage
Gordon Bergling [Tue, 28 Jul 2020 16:10:51 +0000 (16:10 +0000)]
MFC r363363, r363416: geli(8): new example with file based storage

r363363:
geli(8): Add an example on how to use geli(8) with a file as encrypted storage

Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D25741

r363416:
geli(8): Add missing commands in the EXAMPLES section

Reported by: Fabian Keil <freebsd-listen at fabiankeil dot de>
Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D25761

3 years agoMFC r363395:
Mark Johnston [Tue, 28 Jul 2020 15:16:29 +0000 (15:16 +0000)]
MFC r363395:
traceroute6: Fix most warnings at the default WARNS level.

3 years agoMFC r363444,r363513:
Mateusz Guzik [Tue, 28 Jul 2020 07:07:38 +0000 (07:07 +0000)]
MFC r363444,r363513:

    vm: annotate swap_reserved with __exclusive_cache_line
    Remove leftover macros for long gone vmsize mtx

3 years agoMFC r363511:
Mateusz Guzik [Tue, 28 Jul 2020 07:05:49 +0000 (07:05 +0000)]
MFC r363511:

    Do a lockless check in kthread_suspend_check

3 years agoMFC r363242:
Mateusz Guzik [Tue, 28 Jul 2020 07:04:46 +0000 (07:04 +0000)]
MFC r363242:

    amd64: patch ffsl to use the compiler builtin

3 years agoMFC r355132: Support kernels larger than EFI_STAGING_SIZE in loader.efi
Kyle Evans [Tue, 28 Jul 2020 04:58:01 +0000 (04:58 +0000)]
MFC r355132: Support kernels larger than EFI_STAGING_SIZE in loader.efi

With a very large kernel or module the staging area may be too small to
hold it. When this is the case try to allocate more space before failing
in the efi copyin/copyout/readin functions.

3 years agoMFC r363206:
Ryan Moeller [Tue, 28 Jul 2020 02:53:44 +0000 (02:53 +0000)]
MFC r363206:

hwpmc: Always set pmc_cpuid to something

pmc_cpuid was uninitialized for most AMD processor families.  We can still
populate this string for unimplemented families.

Also added a CPUID_TO_STEPPING macro and converted existing code to use it.

Reviewed by:    mav
Sponsored by:   iXsystems, Inc.
Differential Revision:  https://reviews.freebsd.org/D25673

3 years agoMFC r363439:
Brooks Davis [Mon, 27 Jul 2020 23:18:14 +0000 (23:18 +0000)]
MFC r363439:

Correct a type-mismatch between xdr_long and the variable "bad".

Way back in r28911 (August 1997, CVS rev 1.22) we imported a NetBSD
information leak fix via OpenBSD.  Unfortunatly we failed to track the
followup commit that fixed the type of the error code.  Apply the change
from int to long now.

Reviewed by: emaste
Reported by: CHERI
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25779

3 years agoMFC r354018 (by tuexen):
Mark Johnston [Mon, 27 Jul 2020 15:34:07 +0000 (15:34 +0000)]
MFC r354018 (by tuexen):
Store a handle for the event handler.

3 years agoUpdate the expression used to decide whether to build sctp.ko.
Mark Johnston [Mon, 27 Jul 2020 15:09:07 +0000 (15:09 +0000)]
Update the expression used to decide whether to build sctp.ko.

This is a direct commit to stable/12.

Reported by: Jenkins

3 years agoMFC r363079, r363080, r363129, r363133:
Mark Johnston [Mon, 27 Jul 2020 14:41:23 +0000 (14:41 +0000)]
MFC r363079, r363080, r363129, r363133:
Provide support for building SCTP as a loadable module.

3 years agoMFC r363374:
Mark Johnston [Mon, 27 Jul 2020 14:16:27 +0000 (14:16 +0000)]
MFC r363374:
crypto(9): Stop checking for failures from malloc(M_WAITOK).

PR: 240545

3 years agoMFC r363164, r363166:
Mark Johnston [Mon, 27 Jul 2020 14:15:50 +0000 (14:15 +0000)]
MFC r363164, r363166:
ipfw(8): Fix most warnings with the default WARNS level.

3 years agoMFC r363367:
Mark Johnston [Mon, 27 Jul 2020 14:14:06 +0000 (14:14 +0000)]
MFC r363367:
ext2fs: Stop checking for failures from malloc(M_WAITOK).

PR: 240545

3 years agoMFC r363373:
Mark Johnston [Mon, 27 Jul 2020 14:10:12 +0000 (14:10 +0000)]
MFC r363373:
Fix a memory leak in dsl_scan_visitbp().

PR: 247445

3 years agoMFC r363375:
Mark Johnston [Mon, 27 Jul 2020 14:08:29 +0000 (14:08 +0000)]
MFC r363375:
libdwarf: Hide SHT_NOBITS sections.

PR: 239516

3 years agoiflib: fix cloneattach fail and generalize pseudo device handling
Matt Macy [Mon, 27 Jul 2020 01:53:27 +0000 (01:53 +0000)]
iflib: fix cloneattach fail and generalize pseudo device handling

- a cloneattach failure will not currently be handled correctly,
  jump to the right target

- pseudo devices are all treat as if they're ethernet devices -
  this often doesn't make sense

Sponsored by: Netgate, Inc.
Differential Revision: https://reviews.freebsd.org/D25083

3 years agoFix panics when using iflib pseudo device support
Matt Macy [Mon, 27 Jul 2020 01:38:14 +0000 (01:38 +0000)]
Fix panics when using iflib pseudo device support

Reviewed by: gallatin@, hselasky@
Sponsored by: Netgate, Inc.
Differential Revision: https://reviews.freebsd.org/D23710

3 years agoMFC r363157: Update AMD Zen1 and add Zen2 events mapping.
Alexander Motin [Mon, 27 Jul 2020 00:26:54 +0000 (00:26 +0000)]
MFC r363157: Update AMD Zen1 and add Zen2 events mapping.

3 years agoMFC r355666: libpmc: sort some amdfam17h entries to make valid json
Alexander Motin [Mon, 27 Jul 2020 00:25:56 +0000 (00:25 +0000)]
MFC r355666: libpmc: sort some amdfam17h entries to make valid json

3 years agoMFC r362146:
Yuri Pankov [Sun, 26 Jul 2020 19:18:55 +0000 (19:18 +0000)]
MFC r362146:
locale: exit 1 if unknown keyword was specified

PR: 241906
Submitted by: Akos Somfai <akos.somfai@gmail.com>

3 years agoMFC r363052:
Mark Johnston [Sun, 26 Jul 2020 18:12:54 +0000 (18:12 +0000)]
MFC r363052:
whois: Handle referrals to rwhois servers.

PR: 243862

3 years agoRevert bridge epochification
Kristof Provost [Sun, 26 Jul 2020 17:44:03 +0000 (17:44 +0000)]
Revert bridge epochification

Revert r363492, r363491, r363430, r363429 and r362650.

The introduction of epoch in the network stack is incomplete in stable/12, and
there are simply too many limitations to make the bridge epoch code work there.

The final problem is capability configuration of the bridge member interfaces.
if_bridge needs to enable promiscuous mode, which for certain drivers (e1000
for example) can sleep. In stable/12 we may not sleep within epoch.

3 years agoMFC r362651:
Cy Schubert [Sun, 26 Jul 2020 13:07:09 +0000 (13:07 +0000)]
MFC r362651:

Add MATCH option for CONFIG_MATCH_IFACE.

If the interfaces on which wpa_supplicant is to run are not known or do
not exist, wpa_supplicant can match an interface when it arrives. Each
matched interface is separated with -M argument and the -i argument now
allows for pattern matching.

As an example, the following command would start wpa_supplicant for a
specific wired interface called lan0, any interface starting with wlan
and lastly any other interface. Each match has its own configuration
file, and for the wired interface a specific driver has also been given.

wpa_supplicant \
-M -c wpa_wired.conf -ilan0 -D wired \
-M -c wpa1.conf -iwlan* \
-M -c wpa2.conf

PR: 247177
Reported by: greg@unrelenting.technology
Related to: ports r540412

3 years agoMFC 359977:
Mateusz Piotrowski [Sun, 26 Jul 2020 11:16:43 +0000 (11:16 +0000)]
MFC 359977:

Fix a typo

Reported by: rgrimes

3 years agoMFC 363241:
Toomas Soome [Sun, 26 Jul 2020 10:59:32 +0000 (10:59 +0000)]
MFC 363241:

efibootmgr: typo in long option name

del-timout should be del-timeout

Reported by: mjg

3 years agoMFC 359504:
Mateusz Piotrowski [Sun, 26 Jul 2020 10:08:53 +0000 (10:08 +0000)]
MFC 359504:

Use proper mdoc(7) macros for literal text and do not use Tn

Tn is deprecated and upsets linters.

3 years agoMFC 359967:
Mateusz Piotrowski [Sun, 26 Jul 2020 10:04:02 +0000 (10:04 +0000)]
MFC 359967:

Document the exit status and the stdout message of nologin(8)

Reviewed by: debdrup (earlier version)
Differential Revision: https://reviews.freebsd.org/D24196

3 years agoMFC 359973:
Mateusz Piotrowski [Sun, 26 Jul 2020 10:01:27 +0000 (10:01 +0000)]
MFC 359973:

sshd: Warn about missing ssh-keygen only when necessary

The sshd service is using ssh-keygen to generate missing SSH keys.
If ssh-keygen is missing, it prints the following message:

> /etc/rc.d/sshd: WARNING: /usr/bin/ssh-keygen does not exist.

It makes sense when the key is not generated yet and
cannot be created because ssh-keygen is missing.

The problem is that even if the key is present on the host,
the sshd service would still warn about missing ssh-keygen
(even though it does not need it).

Reviewed by: emaste
Approved by: emaste (src)
Differential Revision: https://reviews.freebsd.org/D23911

3 years agoMFC 360187:
Mateusz Piotrowski [Sun, 26 Jul 2020 09:58:52 +0000 (09:58 +0000)]
MFC 360187:

Improve formatting of synopsis section

This patch is about sorting the arguments and using proper mdoc(7) macros
to stylize arguments and command modifiers for much better readability.

Further style fixes in other sections within the bhyve manual page are
going to be worked on in upcoming patches.

Reviewed by: rgrimes
Differential Revision: https://reviews.freebsd.org/D24526

3 years agoMFC 360283:
Mateusz Piotrowski [Sun, 26 Jul 2020 09:57:08 +0000 (09:57 +0000)]
MFC 360283:

Fix invalid use of macros and two typos

It turns out that currently mandoc(1) is not handling Fl in Ss
correctly (maybe it never was). Let's just replace "Fl S \&Ss ..."
with "-S ...". After all, this subsection title is stylized anyway, so Fl
is not that helpful.

3 years agoMFC 362956:
Mateusz Piotrowski [Sun, 26 Jul 2020 09:53:50 +0000 (09:53 +0000)]
MFC 362956:

Clean up cam.3

- Add a missing Pp [1]
- Remove uses of Tn
- Use "Xr open 2" when appropriate

PR: 247783 [1]
Submitted by: PauAmma <pauamma@gundo.com> [1]

3 years agoMFC 362742:
Mateusz Piotrowski [Sun, 26 Jul 2020 09:52:04 +0000 (09:52 +0000)]
MFC 362742:

Do not use macros in the argument to -width

This patch improves the presentation of the FILES section dramatically.

3 years agoMFC 362741:
Mateusz Piotrowski [Sun, 26 Jul 2020 09:48:04 +0000 (09:48 +0000)]
MFC 362741:

Document that Intel Dual Band Wireless AC 8265 is supported by iwm(4)

3 years agoMFC 362957:
Mateusz Piotrowski [Sun, 26 Jul 2020 09:47:01 +0000 (09:47 +0000)]
MFC 362957:

Fix description of the "\$" sequence for PS1

The manual page documents "\$" to expand to either "$" or "#" followed by
a single space. In reality, the single space character is not appended.

PR: 247791
Submitted by: kd-dev@pm.me

3 years agoMFC r363448: Add missing newlines.
Alexander Motin [Sun, 26 Jul 2020 01:11:30 +0000 (01:11 +0000)]
MFC r363448: Add missing newlines.

3 years agoMFC r363329:
Konstantin Belousov [Sun, 26 Jul 2020 01:04:53 +0000 (01:04 +0000)]
MFC r363329:
Simplify non-pti syscall entry on amd64.

3 years agoMFC r362569 (by jkim):
Don Lewis [Sat, 25 Jul 2020 23:06:47 +0000 (23:06 +0000)]
MFC r362569 (by jkim):

    Fix build with recent byacc.

3 years agoMFC r363277-r363283
Cy Schubert [Sat, 25 Jul 2020 14:27:12 +0000 (14:27 +0000)]
MFC r363277-r363283

r363277:
Only use the use_inet6 variable when INET6 is a build option.

This is a prerequisite to upcoming argument processing cleanups which
will resolve consistency as was done with ippool previously.

PR: 247952

r363278:
fr_family (the protocol family) must be AF_INET or AF_INET6, as in
the kernel, not an arbitrary 4 or 6.

This only affected printing ipfilter stats and rules from a kernel
dump. (This is currently undocumented.)

PR: 247952

r363279:
Historically ipfstat listings and stats only listed IPv4 or IPv6 output.
ipfstat would list IPv4 outputs by default while -6 would produce IPv6
outputs. This commit combines the ipfstat -i and -o outputs into one
listing of IPv4 and IPv6 rules. The -4 option lists only IPv4 rules
(as the default before) while -6 continues to list only rules that affect
IPv6.

PR: 247952
Reported by: joeb1@a1poweruser.com

r363280:
ipfstat -t defaults to IPv4 output. Make consistent with ipfstat -i
and ipfstat -o where without an argument IPv4 and IPv6 states are
shown. Use -4 and -6 to limit the display to IPv4 or IPv6 respectively.

PR: 247952

r363281:
Make ipfstat -t header generic when IPv4 and IPv6 output are
displayed in the same display.

PR: 247952

r363282:
The output from usage() need not contain usage for -t when STATETOP
is not compiled in.

PR: 247952

3 years agoMFC r342576-342577,342645,342812,342881,343231,343399 (by trasz):
Piotr Pawel Stefaniak [Sat, 25 Jul 2020 11:57:39 +0000 (11:57 +0000)]
MFC r342576-342577,342645,342812,342881,343231,343399 (by trasz):

r342577 Make sh(1) collapse $HOME into "~" in PS1
r342576 Simplify the way we set the default sh(1) PS1
r342645 Add current working directory to the default sh prompt
r342812 Give sh(1) a proper default prompt instead of just "$".
r342881 Make sh(1) recognize the default $HOME
r343231 Don't mess with BLOCKSIZE in shell startup files
r343399 Make sh(1) support \u in PS1

3 years agoMFC r355228:
Mateusz Guzik [Sat, 25 Jul 2020 00:37:34 +0000 (00:37 +0000)]
MFC r355228:

    devfs: introduce a per-dev lock to protect ->si_devsw

3 years agoMFC r357208,r357309,r357239,r357310
Mateusz Guzik [Sat, 25 Jul 2020 00:24:11 +0000 (00:24 +0000)]
MFC r357208,r357309,r357239,r357310

    amd64: revamp memcmp
    amd64: speed up failing case for memcmp
    amd64: sync up libc memcmp with the kernel version (r357208)
    amd64: sync up libc memcmp with the kernel version (r357309)

3 years agoMFC r363297:
Mateusz Guzik [Sat, 25 Jul 2020 00:03:23 +0000 (00:03 +0000)]
MFC r363297:

    Short-circuit tdfind when looking for the calling thread.

3 years agoMFC r347503,r347505,r347510,r352177,r352178,r352183,r352612,r352617,
Mateusz Guzik [Sat, 25 Jul 2020 00:01:57 +0000 (00:01 +0000)]
MFC r347503,r347505,r347510,r352177,r352178,r352183,r352612,r352617,
    r352631,r352810,r352811,r352812,r352813,r354893,r355124,r355125,
    r356880,r356883,r356915

    cache: push sdt probes in cache_zap_locked to code doing the work
    cache: bump numcache on entry, while here fix lnumcache type
    cache: fix a brainfart in r347505
    cache: assorted cleanups
    cache: change the formula for calculating lock array sizes
    cache: avoid excessive relocking on entry removal during lookup
    cache: jump in negative success instead of positive
    cache: count evictions of negatve entries
    cache: tidy up handling of negative entries
    cache: stop recalculating upper limit each time a new entry is added
    cache: make negative list shrinking a little bit concurrent
    cache: stop requeuing negative entries on the hot list
    cache: decrease ncnegfactor to 5
    cache: minor stat cleanup
    cache: fix numcache accounting on entry
    cache: stop reusing .. entries on enter
    cache: convert numcachehv to counter(9) on 64-bit platforms
    cache: counter_u64_add_protected -> counter_u64_add
    cache: make numcachehv use counter(9) on all archs

3 years agoMFC r357282:
Mateusz Guzik [Fri, 24 Jul 2020 23:45:42 +0000 (23:45 +0000)]
MFC r357282:

    zfs: fix spurious lock contention during path lookup

3 years agoMFC r352874:
Mateusz Guzik [Fri, 24 Jul 2020 23:44:35 +0000 (23:44 +0000)]
MFC r352874:

    amd64 pmap: batch chunk removal in pmap_remove_pages

3 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
Dimitry Andric [Fri, 24 Jul 2020 20:48:06 +0000 (20:48 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
10.0.1 final (aka llvmorg-10.0.1-0-gef32c611aa2).

MFC r359582 (by emaste):

lldb: use lua as the default script language

In the FreeBSD base system we do not have Python support in lldb, but
will have Lua support.  Make Lua the default.

This needs to be made into a configure-time option; that is being
discussed upstream and will appear in a future lldb import.  For now
carry this change as a tiny patch to our copy of lldb.

MFC r359599 (by emaste):

lldb: add rule to generate LLDBWrapLua.cpp

Building lldb's lua/python bindings requires swig, but we do not want to
include it in the FreeBSD base system (as a build tool) because it has
non-trivial dependencies.  As a workaround, add a make rule to generate
LLDBWrapLua.cpp, and we will commit the generated file.

Requires the swig30 package.

Reviewed by: brooks
Discussed with: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24265

MFC r359600 (by emaste):

lldb: commit generated LLDBWrapLua.cpp

MFC r359606 (by emaste):

lldb: build and enable lua script bindings

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24266

MFC r360697:

In r358396 I merged llvm upstream commit 2e24219d3, which fixed "error:
unsupported relocation on symbol" when assembling arm 'adr' pseudo
instructions. However, the upstream commit did not take big-endian arm
into account.

Applying the same changes to the big-endian handling is straightforward,
thanks to Andrew Turner and Peter Smith for the hint. This will also be
submitted upstream.

MFC r360702:

Merge commit 4ca2cad94 from llvm git (by Justin Hibbits):

  [PowerPC] Add clang -msvr4-struct-return for 32-bit ELF

  Summary:

  Change the default ABI to be compatible with GCC. For 32-bit ELF
  targets other than Linux, Clang now returns small structs in
  registers r3/r4. This affects FreeBSD, NetBSD, OpenBSD. There is no
  change for 32-bit Linux, where Clang continues to return all structs
  in memory.

  Add clang options -maix-struct-return (to return structs in memory)
  and -msvr4-struct-return (to return structs in registers) to be
  compatible with gcc. These options are only for PPC32; reject them on
  PPC64 and other targets. The options are like -fpcc-struct-return and
  -freg-struct-return for X86_32, and use similar code.

  To actually return a struct in registers, coerce it to an integer of
  the same size. LLVM may optimize the code to remove unnecessary
  accesses to memory, and will return i32 in r3 or i64 in r3:r4.

  Fixes PR#40736

  Patch by George Koehler!

  Reviewed By: jhibbits, nemanjai
  Differential Revision: https://reviews.llvm.org/D73290

Requested by: jhibbits

MFC r361410:

Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
llvmorg-10.0.1-rc1-0-gf79cd71e145 (aka 10.0.1 rc1).

MFC r362235 (by kp):

llvm: Default to -mno-relax on RISC-V

Compiling on a RISC-V system fails with 'relocation R_RISCV_ALIGN
requires unimplemented linker relaxation; recompile with -mno-relax'.

Our default linker (ld.lld) doesn't support relaxation, so default to
no-relax so we don't generate object files the linker can't handle.

Reviewed by: mhorne
Sponsored by: Axiado
Differential Revision: https://reviews.freebsd.org/D25210

MFC r362445:

Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
llvmorg-10.0.0-97-g6f71678ecd2 (not quite 10.0.1 rc2, as more fixes are
still pending).

MFC r362587 (by cem):

Add WITH_CLANG_FORMAT option

clang-format is enabled conditional on either WITH_CLANG_EXTRAS or
WITH_CLANG_FORMAT.  Some sources in libclang are build conditional on
either rule, and obviously the clang-format binary itself depends on the
rule.

clang-format could still use a manual page.

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

MFC r362609:

Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
llvmorg-10.0.0-129-gd24d5c8e308. Getting closer to 10.0.1-rc2.

MFC r362679:

Regenerate ReStructuredText based manpages for llvm-project tools:

* bugpoint.1
* clang.1
* llc.1
* lldb.1
* lli.1
* llvm-ar.1
* llvm-as.1
* llvm-bcanalyzer.1
* llvm-cov.1
* llvm-diff.1
* llvm-dis.1
* llvm-dwarfdump.1
* llvm-extract.1
* llvm-link.1
* llvm-mca.1
* llvm-nm.1
* llvm-pdbutil.1
* llvm-profdata.1
* llvm-symbolizer.1
* llvm-tblgen.1
* opt.1

Add newly generated manpages for:

* llvm-addr2line.1 (this is an alias of llvm-symbolizer)
* llvm-cxxfilt.1
* llvm-objcopy.1
* llvm-ranlib.1 (this is an alias of llvm-ar)

Note that llvm-objdump.1 is an exception, as upstream has both a plain
.1 file, and a .rst variant. These will have to be reconciled upstream
first.

MFC r362680:

Follow-up to r362679, add more entries to OptionalObsoleteFiles.inc

MFC r362719:

Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
llvmorg-10.0.1-rc2-0-g77d76b71d7d.

Also add a few more llvm utilities under WITH_CLANG_EXTRAS:

* llvm-dwp, a utility for merging DWARF 5 Split DWARF .dwo files into
  .dwp (DWARF package files)
* llvm-size, a size(1) replacement
* llvm-strings, a strings(1) replacement

MFC r362733:

Remove older llvm-ranlib.1 entry from ObsoleteFiles.inc, as it has
gotten its own manpage now, and should be no longer be removed by "make
delete-old".

MFC r362734:

Fix llvm-strings.1 not installing, this was a copy/paste error.

MFC r363401:

Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
10.0.1 final (aka llvmorg-10.0.1-0-gef32c611aa2).

There were no changes since rc2, except in the upstream regression
tests, which we do not ship.

Relnotes: yes

3 years agobridge: Enter epoch for bridge_transmit()
Kristof Provost [Fri, 24 Jul 2020 20:10:27 +0000 (20:10 +0000)]
bridge: Enter epoch for bridge_transmit()

Just like the change done for bridge_input()/bridge_output() in r363430
we must enter epoch ourselves, because its coverage is not as wide as in
head.

This is a direct commit to stable/12.

PR: 248046

3 years agobridge: Fix mismerges from r360345
Kristof Provost [Fri, 24 Jul 2020 20:09:52 +0000 (20:09 +0000)]
bridge: Fix mismerges from r360345

In r362650 we merged r360345. This required manual changes due to the
differences in EPOCH macros between head and stable/12, and was done
imperfectly.

This is a direct commit to stable/12.

PR: 248046