]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agosh/tests: Fix flaky execution/bg12.0
Jilles Tjoelker [Sun, 28 Jun 2020 21:15:29 +0000 (21:15 +0000)]
sh/tests: Fix flaky execution/bg12.0

When job control is not enabled, the shell ignores SIGINT while waiting for
a foreground process unless that process exits on SIGINT. In this case, the
foreground process is sleep and it does not exit on SIGINT because the
signal is only sent to the shell. Depending on order of events, this could
cause the SIGINT to be unexpectedly ignored.

On lightly loaded bare metal, the chance of this happening tends to be less
than 0.01% but with higher loads and/or virtualization it becomes more
likely.

Starting the sleep in background and using the wait builtin ensures SIGINT
will not be ignored.

PR: 247559
Reported by: lwhsu
MFC after: 1 week

3 years agoConfigure rx_delay/tx_delay values for RK3399/RK3328 GMAC
Oleksandr Tymoshenko [Sun, 28 Jun 2020 21:11:10 +0000 (21:11 +0000)]
Configure rx_delay/tx_delay values for RK3399/RK3328 GMAC

For 1000Mb mode to work reliably TX/RX delays need to be configured
between the TX/RX clock and the respective signals on the PHY
to compensate for differing trace lengths on the PCB.

Reviewed by: manu
MFC after: 1 week

3 years agoMake linux(4) support SO_PROTOCOL. Running Python test suite
Edward Tomasz Napierala [Sun, 28 Jun 2020 18:56:32 +0000 (18:56 +0000)]
Make linux(4) support SO_PROTOCOL.  Running Python test suite
with python3.8 from Focal triggers those.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25491

3 years agoFix llvm-strings.1 not installing, this was a copy/paste error.
Dimitry Andric [Sun, 28 Jun 2020 18:02:51 +0000 (18:02 +0000)]
Fix llvm-strings.1 not installing, this was a copy/paste error.

MFC after: 3 weeks

3 years agoRemove older llvm-ranlib.1 entry from ObsoleteFiles.inc, as it has
Dimitry Andric [Sun, 28 Jun 2020 18:02:12 +0000 (18:02 +0000)]
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 after: 3 weeks

3 years agoAdapt documentation of kern.tty_info_kstacks.
Michael Gmelin [Sun, 28 Jun 2020 17:28:11 +0000 (17:28 +0000)]
Adapt documentation of kern.tty_info_kstacks.

s/stack/kernel stack/, as this feature only shows kernel stacks.

Reported by: jhb
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D25488

3 years agoUse EFI memory map to determine attributes for Acpi mappings on arm64.
Andrew Turner [Sun, 28 Jun 2020 15:03:07 +0000 (15:03 +0000)]
Use EFI memory map to determine attributes for Acpi mappings on arm64.

AcpiOsMapMemory is used for device memory when e.g. an _INI method wants
to access physical memory, however, aarch64 pmap_mapbios is hardcoded to
writeback. Search for the correct memory type to use in pmap_mapbios.

Submitted by: Greg V <greg_unrelenting.technology>
Differential Revision: https://reviews.freebsd.org/D25201

3 years agoDon't send packets containing ERROR chunks in response to unknown
Michael Tuexen [Sun, 28 Jun 2020 14:11:36 +0000 (14:11 +0000)]
Don't send packets containing ERROR chunks in response to unknown
chunks when being in a state where the verification tag to be used
is not known yet.

MFC after: 1 week

3 years agoDon't check ch for not being NULL, since that is true.
Michael Tuexen [Sun, 28 Jun 2020 11:12:03 +0000 (11:12 +0000)]
Don't check ch for not being NULL, since that is true.

MFC after: 1 week

3 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
Dimitry Andric [Sun, 28 Jun 2020 07:43:43 +0000 (07:43 +0000)]
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 after: 3 weeks

3 years ago[fifolog] wrap the recno when we hit the end of the provided file size.
Adrian Chadd [Sun, 28 Jun 2020 06:52:39 +0000 (06:52 +0000)]
[fifolog] wrap the recno when we hit the end of the provided file size.

Without this the log just keeps growing to infinity.

Reviewed by: phk
Differential Revision: https://reviews.freebsd.org/D25478

3 years agotop: do not try to use sysctl machdep.smp_active.
Konstantin Belousov [Sun, 28 Jun 2020 00:29:21 +0000 (00:29 +0000)]
top: do not try to use sysctl machdep.smp_active.

The sysctl was removed by r76078 in 2001.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 years agoUpdate VFS_CHECKEXP.9 to reflect how it is currently used by the NFS server.
Rick Macklem [Sat, 27 Jun 2020 21:37:48 +0000 (21:37 +0000)]
Update VFS_CHECKEXP.9 to reflect how it is currently used by the NFS server.

Reported by: pluknet
Reviewed by: bcr
Differential Revision: https://reviews.freebsd.org/D25333

3 years agoExplain how to learn about possible recognized locale names
Joerg Wunsch [Sat, 27 Jun 2020 20:55:47 +0000 (20:55 +0000)]
Explain how to learn about possible recognized locale names

Posix says that the interpretation of the locale string is
"implementation-defined", so we ought to document what is
actually recognized.

Also add a cross reference to locale(1).

PR: 247553
MFC after: 1 week

3 years agops(1): don't try to handle non-SMP systems
Piotr Pawel Stefaniak [Sat, 27 Jun 2020 20:01:56 +0000 (20:01 +0000)]
ps(1): don't try to handle non-SMP systems

As reported by kib, sysctl machdep.smp_active doesn't exist and on UP we
return CPU 0 for all threads anyway.

Reported by: kib

3 years agoamd64 pmap: explain ptepindex.
Konstantin Belousov [Sat, 27 Jun 2020 19:29:07 +0000 (19:29 +0000)]
amd64 pmap: explain ptepindex.

Reviewed by: markj
Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25187

3 years agops(1): reuse keyword "cpu" to show CPU number
Piotr Pawel Stefaniak [Sat, 27 Jun 2020 19:09:33 +0000 (19:09 +0000)]
ps(1): reuse keyword "cpu" to show CPU number

This flag will now show the processor number on which a process is running.

This change was inspired by PR129965. Initially I didn't think that the
patch attached to it was correct -- it sacrificed ki_estcpu use in "cpu"
for ki_lastcpu and I thought that the old functionality should be kept and
the new (cpu#) one added to it. But I've since discovered that ki_estcpu is
sched_4bsd-specific. What's worse, it represents the same thing as
ki_pctcpu, except ki_pctcpu is universal -- so "%cpu" has been using it
successfully. Therefore, I've decided to replace information based on
ki_estcpu with information based on ki_oncpu/ki_lastcpu.

Key parts of the code and manual changes were borrowed from top(1).

PR: 129965
Reported by: Nikola Knežević
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25377

3 years agoVendor import of llvm-project branch release/10.x
Dimitry Andric [Sat, 27 Jun 2020 18:34:17 +0000 (18:34 +0000)]
Vendor import of llvm-project branch release/10.x
llvmorg-10.0.1-rc2-0-g77d76b71d7d.

3 years agoDocument new kern.tty_info_kstacks tunable.
Michael Gmelin [Sat, 27 Jun 2020 16:31:04 +0000 (16:31 +0000)]
Document new kern.tty_info_kstacks tunable.

Reviewed by: manpages (imp), 0mp
Differential Revision: https://reviews.freebsd.org/D25488

3 years agoMake linux(4) warn about unsupported SA_ flags.
Edward Tomasz Napierala [Sat, 27 Jun 2020 15:50:35 +0000 (15:50 +0000)]
Make linux(4) warn about unsupported SA_ flags.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25453

3 years agoRegen.
Edward Tomasz Napierala [Sat, 27 Jun 2020 14:43:29 +0000 (14:43 +0000)]
Regen.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

3 years agoAdd proper types for linux message queue syscalls; mostly taken
Edward Tomasz Napierala [Sat, 27 Jun 2020 14:42:08 +0000 (14:42 +0000)]
Add proper types for linux message queue syscalls; mostly taken
from 32-bit Linuxulator.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25386

3 years agoAdd syscall definitions for linux xattr syscalls.
Edward Tomasz Napierala [Sat, 27 Jun 2020 14:39:44 +0000 (14:39 +0000)]
Add syscall definitions for linux xattr syscalls.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25387

3 years agoAdjust types of linuxulator syscalls, to match include/linux/syscalls.h
Edward Tomasz Napierala [Sat, 27 Jun 2020 14:37:36 +0000 (14:37 +0000)]
Adjust types of linuxulator syscalls, to match include/linux/syscalls.h
in vanilla Linux git tree.

Reviewed by: markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25385

3 years agoixl.4: Use a -bullet list instead of -item
Mateusz Piotrowski [Sat, 27 Jun 2020 13:33:31 +0000 (13:33 +0000)]
ixl.4: Use a -bullet list instead of -item

Now the list looks like a list. Using -item only makes sense if the list is
meant to be a list of terms and definitions.

MFC after: 3 days

3 years agoImport new 2-clause BSD licenced implementation of the bc and dc commands
Stefan Eßer [Sat, 27 Jun 2020 12:02:01 +0000 (12:02 +0000)]
Import new 2-clause BSD licenced implementation of the bc and dc commands

These implementations of the bc and dc programs offer a number of advantages
compared to the current implementations in the FreeBSD base system:

- They do not depend on external large number functions (i.e. no dependency
  on OpenSSL or any other large number library)

- They implements all features found in GNU bc/dc (with the exception of
  the forking of sub-processes, which the author of this version considers
  as a security issue).

- They are significantly faster than the current code in base (more than
  2 orders of magnitude in some of my tests, e.g. for 12345^100000).

- They should be fully compatible with all features and the behavior of the
  current implementations in FreeBSD (not formally verified).

- They support POSIX message catalogs and come with localized messages in
  Chinese, Dutch, English, French, German, Japanese, Polish, Portugueze,
  and Russian.

- They offer very detailed man-pages that provide far more information than
  the current ones.

The upstream sources contain a large number of tests, which are not
imported with this commit. They could be integrated into our test
framework at a latter time.

Installation of this version is controlled by the option "MK_GH_BC=yes".
This option will be set to yes by default in 13-CURRENT, but will be off
by default in 12-STABLE.

Approved by: imp
Obtained from: https://git.yzena.com/gavin/bc
MFC after: 4 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D19982

3 years agoFollow-up to r362679, add more entries to OptionalObsoleteFiles.inc
Dimitry Andric [Sat, 27 Jun 2020 12:00:08 +0000 (12:00 +0000)]
Follow-up to r362679, add more entries to OptionalObsoleteFiles.inc

MFC after: 3 days
X-MFC-With: r362679

3 years agoRegenerate ReStructuredText based manpages for llvm-project tools:
Dimitry Andric [Sat, 27 Jun 2020 11:56:49 +0000 (11:56 +0000)]
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 after: 3 days

3 years agokillall(1): Clarify -d, -s and -v options
Fernando Apesteguía [Sat, 27 Jun 2020 11:28:11 +0000 (11:28 +0000)]
killall(1): Clarify -d, -s and -v options

-d and -v are not equivalent options. The former is more verbose than the
latter and the former does not actually send the signals while the latter does.
Let them have their own paragraphs.

From the point of view of the output, -v is equivalent to -s, so describe them
close to each other. The difference is that former actually sends the signals
and the latter doesn't.

PR: 247411
Approved by: manpages(0mp)
Differential Revision: https://reviews.freebsd.org/D25413

3 years agorev(1): Add EXAMPLES section
Fernando Apesteguía [Sat, 27 Jun 2020 11:19:18 +0000 (11:19 +0000)]
rev(1): Add EXAMPLES section

Very simple example.

Approved by: imp, 0mp, manpages(bcr)
Differential Revision: https://reviews.freebsd.org/D25468

3 years agoFix trailing-comma-related typos in the tree when the Xr macro is used
Mateusz Piotrowski [Sat, 27 Jun 2020 11:13:45 +0000 (11:13 +0000)]
Fix trailing-comma-related typos in the tree when the Xr macro is used

MFC after: 1 week

3 years agoFix a typo, use Lk for links and use HTTPS where applicable
Mateusz Piotrowski [Sat, 27 Jun 2020 11:03:18 +0000 (11:03 +0000)]
Fix a typo, use Lk for links and use HTTPS where applicable

MFC after: 3 days

3 years agortwn: Add a USB ID for Buffalo WI-U2-433DHP
Li-Wen Hsu [Sat, 27 Jun 2020 07:34:15 +0000 (07:34 +0000)]
rtwn: Add a USB ID for Buffalo WI-U2-433DHP

PR: 247573
Submitted by: HATANO Tomomi <hatanou@infolab.ne.jp>
MFC after: 1 week

3 years ago[ath_hal] Add KeyMiss for AR5212/AR5416 series chips.
Adrian Chadd [Sat, 27 Jun 2020 02:59:51 +0000 (02:59 +0000)]
[ath_hal] Add KeyMiss for AR5212/AR5416 series chips.

This is a flag from the MAC that says the received packet didn't match
a keycache slot.  This isn't technically a problem as WEP keys don't
match keycache slots (they're "global" keys), but it could be useful
for tracking down CCMP decryption failures.

Right now it's a no-op - it mirrors what the AR9300 HAL does and it
just increments a counter.  But, hey, maybe one day I'll use it for
diagnosing keycache/CCMP decrypt issues.

3 years agovm_page_free_prep(): correct description of the required page and object state.
Konstantin Belousov [Sat, 27 Jun 2020 02:31:39 +0000 (02:31 +0000)]
vm_page_free_prep(): correct description of the required page and object state.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D25482

3 years agoFix libnv build post rename
Matt Macy [Sat, 27 Jun 2020 02:17:04 +0000 (02:17 +0000)]
Fix libnv build post rename

Submitted by: Neel Chauhan
Differential Revision: https://reviews.freebsd.org/D25481

3 years agoFix "current" variable name conflict with openzfs
Matt Macy [Sat, 27 Jun 2020 00:57:48 +0000 (00:57 +0000)]
Fix "current" variable name conflict with openzfs

The variable "current" is an alias for curthread
in openzfs. Rename all variable uses of current
in dtrace.c to curstate.

3 years agoRename nvpair.c to bsd_nvpair.c to not conflict with openzfs' version.
Matt Macy [Sat, 27 Jun 2020 00:55:03 +0000 (00:55 +0000)]
Rename nvpair.c to bsd_nvpair.c to not conflict with openzfs' version.

3 years agoChroot first appeared in 4.3-Reno, not in 4.4 in the BSD world,
Warner Losh [Fri, 26 Jun 2020 22:23:15 +0000 (22:23 +0000)]
Chroot first appeared in 4.3-Reno, not in 4.4 in the BSD world,
but in System III in the AT&T world.

Examination of the TUHS archives shows this was present in 4.3-Reno
and System III.

Reviewed by: 0mp@, allanjude@
MFC After: 3 days
Differential Revision: https://reviews.freebsd.org/D25479

3 years agoChroot actually appeared in 7th Edition Unix.
Warner Losh [Fri, 26 Jun 2020 22:05:23 +0000 (22:05 +0000)]
Chroot actually appeared in 7th Edition Unix.

Chroot appeared during the development of 7th edition Unix. The FreeBSD jail
documents, incorrectly, that Bill Joy added this to 4.2BSD on 18 March
1982. That was when Bill Joy converted from a statically coded system call glue
to dynamically generated assembler. Chroot was present in 32V, 3BSD, 4.0BSD, 4.1BSD
and 4.1cBSD well in advance of this. Kirk McKusick agrees with this analysis.

See also:
V7: https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/libc/sys/chroot.s
32V: https://minnie.tuhs.org/cgi-bin/utree.pl?file=32V/usr/src/libc/sys/chroot.s
3BSD: https://minnie.tuhs.org/cgi-bin/utree.pl?file=3BSD/usr/src/libc/sys/chroot.s
4BSD: https://minnie.tuhs.org/cgi-bin/utree.pl?file=4BSD/usr/src/libc/sys/chroot.s
4.1cBSD: https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.1cBSD/usr/src/libc/sys/chroot.s

The 6th and earlier editions do not have this system call, nor do they have
anything named chroot in the trees available from TUHS.

Reviewed by: allanjude@
Differential Revision: https://reviews.freebsd.org/D25475

3 years agoloader: can not read zfs pool with slog removed
Toomas Soome [Fri, 26 Jun 2020 21:21:35 +0000 (21:21 +0000)]
loader: can not read zfs pool with slog removed

The vdev_init() does check for "known" vdev types, the [log] device removal will create "hole"
device, but vdev_init() does not allow it.

Obtained from: illumos
MFC after: 1 week

3 years agoAdd mostly dummy hw.pci.enable_aspm tunable.
Alexander Motin [Fri, 26 Jun 2020 19:55:11 +0000 (19:55 +0000)]
Add mostly dummy hw.pci.enable_aspm tunable.

The only thing this tunable enables now is reporting to ACPI _OSC that
Active State Power Management and Clock Power Management Capability are
"supported" by the OS.

I've found that at least some Supermicro server boards do not allow OS
to support native PCIe hot-plug unless it reports those capabilities.
After spending significant time in PCIe specs I have found very little
motivation for that, and none of it applies to those motherboards, not
enabling ASPM themselves.  So unless OS explicitly wants to save power,
I see nothing for it to do there actually.

I guess it may get sense to support ASPM when we get Thunderbolt support.
Otherwise I have no system with PCIe hot-plug where power saving matters.

It would be nice to enable this by default, but I worry that it affect
power saving of some laptops, even though I haven't noticed that myself.

3 years agoOnly include object files from .ALLSRC when linking crt1 objects.
John Baldwin [Fri, 26 Jun 2020 19:46:30 +0000 (19:46 +0000)]
Only include object files from .ALLSRC when linking crt1 objects.

Reported by: np, peterj
Reviewed by: kib, emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25469

3 years agoTemporarily skip flakey sys.kern.sysv_test.msg in CI
Li-Wen Hsu [Fri, 26 Jun 2020 17:58:10 +0000 (17:58 +0000)]
Temporarily skip flakey sys.kern.sysv_test.msg in CI

PR: 233649

3 years agoifconfig(8): optimize -f ether:dash mode
Allan Jude [Fri, 26 Jun 2020 16:20:34 +0000 (16:20 +0000)]
ifconfig(8): optimize -f ether:dash mode

Switch to the simplified while loop suggest by Aaron LI

Post commit review via: https://reviews.freebsd.org/rS301185#inline-232

Submitted by: Aaron LI <aly@aaronly.me>
Sponsored by: Klara Inc.

3 years agoifconfig(8): remove duplicate line from man page
Allan Jude [Fri, 26 Jun 2020 15:14:03 +0000 (15:14 +0000)]
ifconfig(8): remove duplicate line from man page

Reported by: Weitian LI <liweitianux@live.com>
Sponsored by: Klara Inc.

3 years agoAdd MATCH option for CONFIG_MATCH_IFACE.
Cy Schubert [Fri, 26 Jun 2020 14:18:08 +0000 (14:18 +0000)]
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
MFC after: 1 month
Related to: ports r540412

3 years agosound/hda: fix interrupt handler endless loop after r362294
Andriy Gapon [Fri, 26 Jun 2020 09:46:03 +0000 (09:46 +0000)]
sound/hda: fix interrupt handler endless loop after r362294

Not all interrupt sources that affect CIS bit were acknowledged.
Specifically, bits in STATESTS (aka WAKESTS) were left set.

The fix is to disable WAKEEN and clear STATESTS bits before the HDA
interrupt is enabled.  This way we should never get any STATESTS bits.

I also added placeholders for all event bits that we currently do not
enable, do not handle and do not clear.  This might get useful when / if
we enable any of them.

Reported by: kib (Apollo Lake hardware)
Tested by: kib (earlier, different change)
MFC after: 2 weeks
X-MFC with: r362294

3 years agoTemporarily skip flakey bin.sh.execution.functional_test.bg12 in CI
Li-Wen Hsu [Fri, 26 Jun 2020 09:39:23 +0000 (09:39 +0000)]
Temporarily skip flakey bin.sh.execution.functional_test.bg12 in CI

PR: 238870
Sponsored by: The FreeBSD Foundation

3 years agoena: fix module build after r362530
Andriy Gapon [Fri, 26 Jun 2020 09:32:57 +0000 (09:32 +0000)]
ena: fix module build after r362530

Somehow I missed the makefile when moving the change from phabricator to
svn.

MFC after: 1 week
X-MFC with: r362530

3 years agoPrevent calling USB backends multiple times.
Peter Grehan [Fri, 26 Jun 2020 08:20:38 +0000 (08:20 +0000)]
Prevent calling USB backends multiple times.

The TRB processing loop could potentially call a back-end twice
with the same status transaction. While this was generally benign,
some code paths in the tablet backend weren't set up to handle
this case, resulting in a NULL dereference.

Fix by
 - returning a STALL error when an invalid request was seen in the backend
 - skipping a call to the backend if the number of packets in a status
   transaction was zero (this code fragment was taken from the Intel ACRN
   xhci backend)

PR: 246964
Reported by:  Ali Abdallah
Discussed with: Leon Dang (author)
Reviewed by: jhb (#bhyve), Leon Dang
Approved by: jhb
Obtained from:  Intel ACRN (partially)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25228

3 years agoUpdate bhyve maintainers.
Peter Grehan [Fri, 26 Jun 2020 06:11:50 +0000 (06:11 +0000)]
Update bhyve maintainers.

Suggested by: jhb
Approved by:  jhb, tychon

3 years agoDon't log normal login_getpwclass(3) result.
Xin LI [Fri, 26 Jun 2020 04:46:45 +0000 (04:46 +0000)]
Don't log normal login_getpwclass(3) result.

The logging was introduced in r314527 but doesn't appear to be useful
for regular operation, and as the result, for users with no class set
(very common) the administrator would see a message like this in their
auth.log:

  sshd[44251]: user root login class [preauth]

(note that the class was "" because that's what's typically configured
for most users; we would get 'default' if lc->lc_class is chosen)

Remove this log as it can be annoying as the lookup happen before
authentication and repeats, and our code is not acting upon lc_class
or pw_class directly anyways.

Reviewed by: cem, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24997

3 years agoAdd an entry for r362639.
Rick Macklem [Fri, 26 Jun 2020 03:18:10 +0000 (03:18 +0000)]
Add an entry for r362639.

3 years agoBump the version since r362639 changed the internal API between the NFS
Rick Macklem [Fri, 26 Jun 2020 03:14:30 +0000 (03:14 +0000)]
Bump the version since r362639 changed the internal API between the NFS
kernel modules so they must all be rebuilt.

3 years agoAdd a boolean argument to nfscl_reqstart() to indicate that ext_pgs mbufs
Rick Macklem [Fri, 26 Jun 2020 03:11:54 +0000 (03:11 +0000)]
Add a boolean argument to nfscl_reqstart() to indicate that ext_pgs mbufs
should be used.

For KERN_TLS (and possibly some other future network interface) the mbuf
list passed into sosend() must be ext_pgs mbufs. The krpc could simply
copy all the mbuf data into ext_pgs mbufs before calling sosend(), but
that would be inefficient for large RPC messages.
This patch adds an argument to nfscl_reqstart() to indicate that it should
fill the RPC message into ext_pgs mbufs.
It also adds fields to "struct nfsrv_descript" needed for building NFS RPC
messages in ext_pgs mbufs, along with new flags for this.

Since the argument is always "false", this commit should not result in any
semantic change. However, this commit prepares the code
for future commits that will add support for building of NFS RPC messages
in ext_pgs mbufs.

3 years agoReduce contention on per-adapter lock.
John Baldwin [Fri, 26 Jun 2020 00:01:31 +0000 (00:01 +0000)]
Reduce contention on per-adapter lock.

- Move temporary sglists into the session structure and protect them
  with a per-session lock instead of a per-adapter lock.

- Retire an unused session field, and move a debugging field under
  INVARIANTS to avoid using the session lock for completion handling
  when INVARIANTS isn't enabled.

- Use counter_u64 for per-adapter statistics.

Note that this helps for cases where multiple sessions are used
(e.g. multiple IPsec SAs or multiple KTLS connections).  It does not
help for workloads that use a single session (e.g. a single GELI
volume).

Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25457

3 years agoSimplify IPsec transform-specific teardown.
John Baldwin [Thu, 25 Jun 2020 23:59:16 +0000 (23:59 +0000)]
Simplify IPsec transform-specific teardown.

- Rename from the teardown callback from 'zeroize' to 'cleanup' since
  this no longer zeroes keys.

- Change the callback return type to void.  Nothing checked the return
  value and it was always zero.

- Don't have esp call into ah since it no longer needs to depend on
  this to clear the auth key.  Instead, both are now private and
  self-contained.

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25443

3 years agoEnter and exit the network epoch for async IPsec callbacks.
John Baldwin [Thu, 25 Jun 2020 23:57:30 +0000 (23:57 +0000)]
Enter and exit the network epoch for async IPsec callbacks.

When an IPsec packet has been encrypted or decrypted, the next step in
the packet's traversal through the network stack is invoked from a
crypto worker thread, not from the original calling thread.  These
threads need to enter the network epoch before passing packets down to
IP output routines or up to transport protocols.

Reviewed by: ae
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25444

3 years agoAdd CAP_EVENT to pidfiles.
David Bright [Thu, 25 Jun 2020 21:34:43 +0000 (21:34 +0000)]
Add CAP_EVENT to pidfiles.

CAP_EVENT was omitted on pidfiles (in
pidfile_open()). There seems no reason why a process that creates
and writes a pidfile cannot monitor events on that file. This mod adds
the capability.

Reviewed by: cem@
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D25363

3 years agoiflib: fix compilation issue introduced in r362621
Vincenzo Maffione [Thu, 25 Jun 2020 20:43:21 +0000 (20:43 +0000)]
iflib: fix compilation issue introduced in r362621

The ifp local variable is useful even without netmap
and altq, as it is used to check for IFF_DRV_RUNNING.

MFC after: 2 weeks

3 years agoUse zfree() to explicitly zero IPsec keys.
John Baldwin [Thu, 25 Jun 2020 20:31:06 +0000 (20:31 +0000)]
Use zfree() to explicitly zero IPsec keys.

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25442

3 years agoImplement an approximation of Linux MADV_DONTNEED semantics.
Mark Johnston [Thu, 25 Jun 2020 20:30:30 +0000 (20:30 +0000)]
Implement an approximation of Linux MADV_DONTNEED semantics.

Linux MADV_DONTNEED is not advisory: it has side effects for anonymous
memory, and some system software depends on that.  In particular,
MADV_DONTNEED causes anonymous pages to be discarded.  If the mapping is
a private mapping of a named object then subsequent faults are to
repopulate the range from that object, otherwise pages will be
zero-filled.  For mappings of non-anonymous objects, Linux MADV_DONTNEED
can be implemented in the same way as our MADV_DONTNEED.

This implementation differs from Linux semantics in its handling of
private mappings, inherited through fork(), of non-anonymous objects.
After applying MADV_DONTNEED, subsequent faults will repopulate the
mapping from the parent object rather than the root of the shadow chain.

PR: 230160
Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25330

3 years agoFix few panics on NVMe's timing out initialization requests.
Alexander Motin [Thu, 25 Jun 2020 20:29:29 +0000 (20:29 +0000)]
Fix few panics on NVMe's timing out initialization requests.

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

3 years agoUse explicit_bzero() instead of bzero() for sensitive data.
John Baldwin [Thu, 25 Jun 2020 20:25:35 +0000 (20:25 +0000)]
Use explicit_bzero() instead of bzero() for sensitive data.

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25441

3 years agoExplicitly zero the temporary auth context used to generate HMAC state.
John Baldwin [Thu, 25 Jun 2020 20:22:44 +0000 (20:22 +0000)]
Explicitly zero the temporary auth context used to generate HMAC state.

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25439

3 years agoExplicitly zero hash results and context in glxsb_authcompute().
John Baldwin [Thu, 25 Jun 2020 20:21:34 +0000 (20:21 +0000)]
Explicitly zero hash results and context in glxsb_authcompute().

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25438

3 years agoUse zfree() instead of bzero() and free().
John Baldwin [Thu, 25 Jun 2020 20:20:22 +0000 (20:20 +0000)]
Use zfree() instead of bzero() and free().

These bzero's should have been explicit_bzero's.

Reviewed by: cem, delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25437

3 years agoZero the temporary HMAC key in hmac_init_pad().
John Baldwin [Thu, 25 Jun 2020 20:18:55 +0000 (20:18 +0000)]
Zero the temporary HMAC key in hmac_init_pad().

Reviewed by: delphij
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25436

3 years agoUse zfree() instead of explicit_bzero() and free().
John Baldwin [Thu, 25 Jun 2020 20:17:34 +0000 (20:17 +0000)]
Use zfree() instead of explicit_bzero() and free().

In addition to reducing lines of code, this also ensures that the full
allocation is always zeroed avoiding possible bugs with incorrect
lengths passed to explicit_bzero().

Suggested by: cem
Reviewed by: cem, delphij
Approved by: csprng (cem)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25435

3 years agoFix copy/paste mistake in kvm_getswapinfo(3)
Dimitry Andric [Thu, 25 Jun 2020 20:04:35 +0000 (20:04 +0000)]
Fix copy/paste mistake in kvm_getswapinfo(3)

It seems this manpage was copied from kvm_getloadavg(3), but the
DIAGNOSTICS section was not updated completely. Update the section with
correct information about a return value of -1.

MFC after: 3 days

3 years agoiflib: netmap: add support for partial ring openings
Vincenzo Maffione [Thu, 25 Jun 2020 19:44:24 +0000 (19:44 +0000)]
iflib: netmap: add support for partial ring openings

Reviewed by: gallatin
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25254

3 years agoiflib: netmap: add per-tx-queue netmap support
Vincenzo Maffione [Thu, 25 Jun 2020 19:35:43 +0000 (19:35 +0000)]
iflib: netmap: add per-tx-queue netmap support

Reviewed by: gallatin
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25253

3 years agoRevert OPENSSL_NO_SSL3_METHOD to keep ABI compatibility.
Gordon Tetlow [Thu, 25 Jun 2020 19:35:37 +0000 (19:35 +0000)]
Revert OPENSSL_NO_SSL3_METHOD to keep ABI compatibility.

This define caused a couple of symbols to disappear. To keep ABI
compatibility, we are going to keep the symbols exposed, but leave SSLv3 as
not in the default config (this is what OPENSSL_NO_SSL3 achieves). The
ramifications of this is an application can still use SSLv3 if it
specifically calls the SSLv3_method family of APIs.

Reported by: kib, others
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D25451

3 years agoipfw: Support the literal IPv6 address syntax in the fwd command.
Mark Johnston [Thu, 25 Jun 2020 19:27:22 +0000 (19:27 +0000)]
ipfw: Support the literal IPv6 address syntax in the fwd command.

Discussed with: rgrimes, Lutz Donnerhacke
Submitted by: Neel Chauhan <neel AT neelc DOT org>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24011

3 years agoAdd SCTP_SUPPORT to the default kernel options.
Mark Johnston [Thu, 25 Jun 2020 19:12:27 +0000 (19:12 +0000)]
Add SCTP_SUPPORT to the default kernel options.

Otherwise out-of-tree module builds will be broken for a lack of a
definition of MK_SCTP_SUPPORT.

Reported by: Michael Butler <imb@protected-networks.net>
MFC with: r362614
Sponsored by: The FreeBSD Foundation

3 years agoEliminate the color field from the RB element struct. Identify the
Doug Moore [Thu, 25 Jun 2020 17:44:14 +0000 (17:44 +0000)]
Eliminate the color field from the RB element struct. Identify the
color of a node (or, really, the color of the link from the parent to
the node) by using one of the last two bits of the parent pointer in
that parent node. Adjust rebalancing methods to account for where
colors are stored, and the fact that null children have a color too.

Adjust RB_PARENT and RB_SET_PARENT to account for this change.

Reviewed by: markj
Tested by: pho, hselasky
Differential Revision: https://reviews.freebsd.org/D25418

3 years agocxgbe(4): Add a pointer to the adapter softc in vi_info.
Navdeep Parhar [Thu, 25 Jun 2020 17:04:22 +0000 (17:04 +0000)]
cxgbe(4): Add a pointer to the adapter softc in vi_info.

There were quite a few places where port_info was being accessed only to
get to the adapter.

Reviewed by: jhb@
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D25432

3 years agolimits(1): Add EXAMPLES section
Fernando Apesteguía [Thu, 25 Jun 2020 16:46:27 +0000 (16:46 +0000)]
limits(1): Add EXAMPLES section

 * Add four examples showing flags -e, -b, -d, -s
 * Remove extra space at the end of the line reported by igor

Approved by: bcr@
Differential Revision: https://reviews.freebsd.org/D25426

3 years agoAdd SCTP_SUPPORT handling to config.mk.
Mark Johnston [Thu, 25 Jun 2020 15:25:00 +0000 (15:25 +0000)]
Add SCTP_SUPPORT handling to config.mk.

Reviewed by: jhb, tuexen
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25402

3 years agoCall swap_pager_freespace() from vm_object_page_remove().
Mark Johnston [Thu, 25 Jun 2020 15:21:21 +0000 (15:21 +0000)]
Call swap_pager_freespace() from vm_object_page_remove().

All vm_object_page_remove() callers, except
linux_invalidate_mapping_pages() in the LinuxKPI, free swap space when
removing a range of pages from an object.  The LinuxKPI case appears to
be an unintentional omission that could result in leaked swap blocks, so
unconditionally free swap space in vm_object_page_remove() to protect
against similar bugs in the future.

Reviewed by: alc, kib
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25329

3 years agobhyve: allow for automatic destruction on power-off
Pawel Biernacki [Thu, 25 Jun 2020 12:35:20 +0000 (12:35 +0000)]
bhyve: allow for automatic destruction on power-off

Introduce -D flag that allows for the VM to be destroyed on guest initiated
power-off by the bhyve(8) process itself.
This is quality of life change that allows for simpler deployments without
the need for bhyvectl --destroy.

Requested by: swills
Reviewed by: 0mp (manpages), grehan, kib, swills
Approved by: kib (mentor)
MFC after: 2 weeks
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D25414

3 years agoman page of select(2) should mention pselect(2)
Pawel Biernacki [Thu, 25 Jun 2020 12:31:05 +0000 (12:31 +0000)]
man page of select(2) should mention pselect(2)

Reviewed by: bcr (manpages), kib, trasz
Approved by: kib (mentor)
MFC after: 7 days
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D25169

3 years agoUpdate tests(7) as kyua(1) was imported to base in r359260
Li-Wen Hsu [Thu, 25 Jun 2020 11:41:28 +0000 (11:41 +0000)]
Update tests(7) as kyua(1) was imported to base in r359260

PR: 247151
Reported by: 0mp
Reviewed by: 0mp, asomers, bcr, emaste, markj
Suggested from: brooks, ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25339

3 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
Dimitry Andric [Thu, 25 Jun 2020 08:15:10 +0000 (08:15 +0000)]
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 after: 3 weeks

3 years agobhyve(8): For prototyping, reattempt decode in userspace
Conrad Meyer [Thu, 25 Jun 2020 00:18:42 +0000 (00:18 +0000)]
bhyve(8): For prototyping, reattempt decode in userspace

If userspace has a newer bhyve than the kernel, it may be able to decode
and emulate some instructions vmm.ko is unaware of.  In this scenario,
reset decoder state and try again.

Reviewed by: grehan
Differential Revision: https://reviews.freebsd.org/D24464

3 years agoatkbd/evdev: recognize the Chromebook menu key as F13 like Linux does.
Vladimir Kondratyev [Thu, 25 Jun 2020 00:09:43 +0000 (00:09 +0000)]
atkbd/evdev: recognize the Chromebook menu key as F13 like Linux does.

This is the key on the right side of the function keys, with the
"hamburger menu" icon on it.

Submitted by: GregV <greg@unrelenting.technology>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25390

3 years agoClang-format: Avoid hardcoded LLVM include-order style
Conrad Meyer [Wed, 24 Jun 2020 23:22:36 +0000 (23:22 +0000)]
Clang-format: Avoid hardcoded LLVM include-order style

Reported by: emaste

3 years agoUpdate .clang-format type and foreach macros lists
Conrad Meyer [Wed, 24 Jun 2020 22:42:46 +0000 (22:42 +0000)]
Update .clang-format type and foreach macros lists

No functional change.

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

3 years agoVendor import of llvm-project branch release/10.x
Dimitry Andric [Wed, 24 Jun 2020 20:22:44 +0000 (20:22 +0000)]
Vendor import of llvm-project branch release/10.x
llvmorg-10.0.0-129-gd24d5c8e308.

3 years agoacpi_ibm(4): Rename disengaged mode to unthrottled mode.
Mark Johnston [Wed, 24 Jun 2020 19:51:03 +0000 (19:51 +0000)]
acpi_ibm(4): Rename disengaged mode to unthrottled mode.

This mode was added in r362496.  Rename it to make the meaning more
clear.

PR: 247306
Suggested by: rpokala
Submitted by: Ali Abdallah <ali.abdallah@suse.com>
MFC with: r362496

3 years agoAdd `kern.features.witness`
Enji Cooper [Wed, 24 Jun 2020 18:51:01 +0000 (18:51 +0000)]
Add `kern.features.witness`

Adding `kern.features.witness` helps expose whether or not the kernel has
`options WITNESS` enabled, so the `feature_present(3)` API can be used
to query whether or not witness(9) is built into the kernel.

This support is helpful with userspace applications (generally speaking,
tests), as it can be queried to determine whether or not tests related
to WITNESS should be run.

MFC after: 1 week
Reviewed by: cem, darrick.freebsd_gmail.com
Differential Revision: https://reviews.freebsd.org/D25302
Sponsored by: DellEMC Isilon

3 years agoUpdate .clang-format with style(9) header-sorting
Conrad Meyer [Wed, 24 Jun 2020 18:40:43 +0000 (18:40 +0000)]
Update .clang-format with style(9) header-sorting

Thanks to work done in the NetBSD clang-format project.  No functional change.

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

3 years agoAlways compile the brand and ignore init ELF notes standalone.
John Baldwin [Wed, 24 Jun 2020 17:54:24 +0000 (17:54 +0000)]
Always compile the brand and ignore init ELF notes standalone.

Reviewed by: kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25374

3 years agoRegenerate src.conf.5 after r362587
Conrad Meyer [Wed, 24 Jun 2020 17:31:21 +0000 (17:31 +0000)]
Regenerate src.conf.5 after r362587

3 years agoAdd WITH_CLANG_FORMAT option
Conrad Meyer [Wed, 24 Jun 2020 17:03:42 +0000 (17:03 +0000)]
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

3 years agoipfw(4): make O_IPVER/ipversion match IPv4 or 6, not just IPv4.
Mark Johnston [Wed, 24 Jun 2020 15:46:33 +0000 (15:46 +0000)]
ipfw(4): make O_IPVER/ipversion match IPv4 or 6, not just IPv4.

Submitted by: Neel Chauhan <neel AT neelc DOT org>
Reviewed by: Lutz Donnerhacke
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25227

3 years agoOnly invalidate the early DTB mapping if it exists
Mitchell Horne [Wed, 24 Jun 2020 15:21:12 +0000 (15:21 +0000)]
Only invalidate the early DTB mapping if it exists

This temporary mapping will become optional. Booting via loader(8)
means that the DTB will have already been copied into the kernel's
staging area, and is therefore covered by the early KVA mappings.

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

3 years agoHandle load from loader(8)
Mitchell Horne [Wed, 24 Jun 2020 15:20:00 +0000 (15:20 +0000)]
Handle load from loader(8)

In locore, we must detect and handle different arguments passed by
loader(8) compared to what we recieve when booting directly via SBI
firmware. Currently we receive the hart ID in a0 and a pointer to the
device tree blob in a1. loader(8) provides only a pointer to its
metadata in a0.

The solution to this is to add an additional entry point, _alt_start.
This will be placed first in the .text section, so SBI firmware will
enter here, and jump to the common pagetable setup shortly after. Since
loader(8) understands our ELF kernel, it will enter at the ELF's entry
address, which points to _start. This approach leads to very little
guesswork as to which way we booted.

Fix-up initriscv() to parse the loader's metadata, continuing to use
fake_preload_metadata() in the SBI direct boot case.

Reviewed by: markj, jrtc27 (asm portion)
Differential Revision: https://reviews.freebsd.org/D24912

3 years agoipfw(8): In fill_ip6(), use a single statement for both "me" and "me6".
Mark Johnston [Wed, 24 Jun 2020 15:05:42 +0000 (15:05 +0000)]
ipfw(8): In fill_ip6(), use a single statement for both "me" and "me6".

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