freebsd.git
3 years agoFix unused functions in invtrig_test.c
Alex Richardson [Mon, 22 Mar 2021 13:05:28 +0000 (13:05 +0000)]
Fix unused functions in invtrig_test.c

I only tested the WARNS=6 change on AArch64 and AMD64, but this file has
unused functions for architectures with LDBL_PREC == 53.

While touching this file change the LDBL_PREC == 53 checks to i386 checks.
The long double tests should only be disabled for i386 (due to the rather
odd rounding mode that it uses) not all architectures where long double
is the same as double.

PR: 205449
Fixes: 87d65c747a43 ("lib/msun: Allow building tests with WARNS=6")
Reported by: Jenkins

3 years agoDon't add -Winline for WARNS=6
Alex Richardson [Mon, 22 Mar 2021 11:55:45 +0000 (11:55 +0000)]
Don't add -Winline for WARNS=6

This warning is very rarely useful (inline is a hint and not mandatory).
This flag results in many warnings being printed when compiling C++
code that uses the standard library with GCC.

This flag was originally added in back in r94332 but the flag is a no-op
in Clang ("This diagnostic flag exists for GCC compatibility, and has no
effect in Clang"). Removing it should make the GCC build output slightly
more readable.

Reviewed By: jrtc27, imp
Differential Revision: https://reviews.freebsd.org/D29235

3 years agolib/msun/tests: Add more debug output to fenv_test.c
Alex Richardson [Thu, 4 Mar 2021 18:41:06 +0000 (18:41 +0000)]
lib/msun/tests: Add more debug output to fenv_test.c

Output a hex dump of the current fenv and the expected value to allow
comparing them without having to resort to interactive use of GDB.

3 years agotools/build/make.py: Avoid calling brew --prefix on macOS unnecessarily
Alex Richardson [Fri, 5 Mar 2021 10:21:12 +0000 (10:21 +0000)]
tools/build/make.py: Avoid calling brew --prefix on macOS unnecessarily

If all the require variables (XCC/XCXX/XCPP/XLD) are already set in the
environment, we don't have to infer a default value for the cross toolchain
path. This avoids an additional `brew --prefix` call when building with
cheribuild (since it already sets all these variables).

3 years agolib/msun/tests: Skip fenv_test:masking if exceptions can't be trapped
Alex Richardson [Mon, 22 Mar 2021 11:53:40 +0000 (11:53 +0000)]
lib/msun/tests: Skip fenv_test:masking if exceptions can't be trapped

Some CPUs (e.g. AArch64 QEMU) cannot trap on floating point exceptions and
therefore ignore the writes to the floating point control register inside
feenableexcept(). If no exceptions are enabled after
feenableexcept(FE_ALL_EXCEPT), we can assume that the CPU does not
support exceptions and we can then skip the test.

Reviewed By: dim
Differential Revision: https://reviews.freebsd.org/D29095

3 years agolib/msun: Allow building tests with WARNS=6
Alex Richardson [Thu, 25 Feb 2021 14:28:17 +0000 (14:28 +0000)]
lib/msun: Allow building tests with WARNS=6

The only change needed is to mark a few variables as static.

3 years agoImprove test messages for msun tests
Alex Richardson [Mon, 22 Mar 2021 11:42:07 +0000 (11:42 +0000)]
Improve test messages for msun tests

Also print the mismatched values when numbers compare not equal.

Reviewed By: dim
Differential Revision: https://reviews.freebsd.org/D29091

3 years agoRemove XFAILs from fmaxmin test
Alex Richardson [Mon, 22 Mar 2021 11:40:17 +0000 (11:40 +0000)]
Remove XFAILs from fmaxmin test

These appears to have been resolved by compiling the test with -fno-builtin
and/or using a newer compiler.

PR: 208703
Reviewed By: ngie
Differential Revision: https://reviews.freebsd.org/D28884

3 years agoConvert the msun tests to ATF
Alex Richardson [Mon, 22 Mar 2021 11:15:13 +0000 (11:15 +0000)]
Convert the msun tests to ATF

This provides better error messages that just an assertion failure and
also makes it easier to mark individual tests as XFAIL.
It was also helpful when coming up with D28786 and D28787.

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

3 years agotests/sys/net/if_lagg_test: Fix syntax error
Alex Richardson [Mon, 22 Mar 2021 10:30:41 +0000 (10:30 +0000)]
tests/sys/net/if_lagg_test: Fix syntax error

Fixes: ee231b27ff ("Also skip sys/net/if_lagg_test:witness on non-i386")

3 years agostress2: Updated the exclude list
Peter Holm [Mon, 22 Mar 2021 10:32:05 +0000 (11:32 +0100)]
stress2:  Updated the exclude list

3 years agostress2: Added two syzkaller reproducers.
Peter Holm [Mon, 22 Mar 2021 10:26:39 +0000 (11:26 +0100)]
stress2:  Added two syzkaller reproducers.

3 years agoAMD-vi: Fix IOMMU device interrupts being overridden
Ka Ho Ng [Mon, 22 Mar 2021 09:33:43 +0000 (17:33 +0800)]
AMD-vi: Fix IOMMU device interrupts being overridden

Currently, AMD-vi PCI-e passthrough will lead to the following lines in
dmesg:
"kernel: CPU0: local APIC error 0x40
ivhd0: Error: completion failed tail:0x720, head:0x0."

After some tracing, the problem is due to the interaction with
amdvi_alloc_intr_resources() and pci_driver_added(). In ivrs_drv, the
identification of AMD-vi IVHD is done by walking over the ACPI IVRS
table and ivhdX device_ts are added under the acpi bus, while there are
no driver handling the corresponding IOMMU PCI function. In
amdvi_alloc_intr_resources(), the MSI intr are allocated with the ivhdX
device_t instead of the IOMMU PCI function device_t. bus_setup_intr() is
called on ivhdX. the IOMMU pci function device_t is only used for
pci_enable_msi(). Since bus_setup_intr() is not called on IOMMU pci
function, the IOMMU PCI function device_t's dinfo->cfg.msi is never
updated to reflect the supposed msi_data and msi_addr. So the msi_data
and msi_addr stay in the value 0. When pci_driver_added() tried to loop
over the children of a pci bus, and do pci_cfg_restore() on each of
them, msi_addr and msi_data with value 0 will be written to the MSI
capability of the IOMMU pci function, thus explaining the errors in
dmesg.

This change includes an amdiommu driver which currently does attaching,
detaching and providing DEVMETHODs for setting up and tearing down
interrupt. The purpose of the driver is to prevent pci_driver_added()
from calling pci_cfg_restore() on the IOMMU PCI function device_t.
The introduction of the amdiommu driver handles allocation of an IRQ
resource within the IOMMU PCI function, so that the dinfo->cfg.msi is
populated.

This has been tested on EPYC Rome 7282 with Radeon 5700XT GPU.

Sponsored by: The FreeBSD Foundation
Reviewed by: jhb
Approved by: philip (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D28984

3 years agoivrs_drv: Fix IVHDs with duplicated BaseAddress
Ka Ho Ng [Mon, 22 Mar 2021 09:33:43 +0000 (17:33 +0800)]
ivrs_drv: Fix IVHDs with duplicated BaseAddress

Reviewed by: jhb
Approved by: philip (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D28945

3 years agoAdd device and ifnet logging methods, similar to device_printf / if_printf
Adrian Chadd [Sun, 21 Mar 2021 18:49:05 +0000 (18:49 +0000)]
Add device and ifnet logging methods, similar to device_printf / if_printf

* device_printf() is effectively a printf
* if_printf() is effectively a LOG_INFO

This allows subsystems to log device/netif stuff using different log levels,
rather than having to invent their own way to prefix unit/netif  names.

Differential Revision: https://reviews.freebsd.org/D29320
Reviewed by: imp

3 years agosys/ck.h: Add an include guard
Kevin Bowling [Sun, 21 Mar 2021 18:50:30 +0000 (11:50 -0700)]
sys/ck.h: Add an include guard

Approved by: cognet
MFC after: 1 week
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D29357

3 years agortsold: Fix validation of RDNSS options
Mark Johnston [Sun, 21 Mar 2021 18:18:10 +0000 (14:18 -0400)]
rtsold: Fix validation of RDNSS options

The header specifies the size of the option in multiples of eight bytes.
The option consists of an eight-byte header followed by one or more IPv6
addresses, so the option is invalid if the size is not equal to 1+2n for
some n>0.  Check this.

The bug can cause random stack data to be formatted as an IPv6 address
and passed to resolvconf(8), but a host able to trigger the bug may also
specify arbitrary addresses this way.

Reported by: Q C <cq674350529@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

3 years agoFix kassert panic when inserting multipath routes from multiple threads.
Alexander V. Chernikov [Sun, 21 Mar 2021 18:15:29 +0000 (18:15 +0000)]
Fix kassert panic when inserting multipath routes from multiple threads.

Reported by: Marco Zec <zec at fer.hr>
MFC after: immediately

3 years agousr.sbin/services_mkdb: diff reduction against NetBSD.
Xin LI [Sun, 21 Mar 2021 17:22:50 +0000 (10:22 -0700)]
usr.sbin/services_mkdb: diff reduction against NetBSD.

MFC after: 1 month

3 years agousr.sbin/uefisign: prevent specifying certificate, key or output
Xin LI [Sun, 21 Mar 2021 17:12:34 +0000 (10:12 -0700)]
usr.sbin/uefisign: prevent specifying certificate, key or output
multiple times.

MFC after: 1 month

3 years agoRemove PCPU_INC
Jason A. Harmening [Wed, 10 Mar 2021 04:43:01 +0000 (20:43 -0800)]
Remove PCPU_INC

e4b8deb22227 removed the last in-tree uses of PCPU_INC().  Its
potential benefit is also practically nonexistent.  Non-x86
platforms already implement it as PCPU_ADD(..., 1), and according
to [0] there are no recent x86 processors for which the 'inc'
instruction provides a performance benefit over the equivalent
memory-operand form of the 'add' instruction.  The only remaining
benefit of 'inc' is smaller instruction size, which in this case
is inconsequential given the limited number of per-CPU data consumers.

[0]: https://www.agner.org/optimize/instruction_tables.pdf

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

3 years agozfs: merge OpenZFS master-891568c99
Martin Matuska [Sun, 21 Mar 2021 00:46:08 +0000 (01:46 +0100)]
zfs: merge OpenZFS master-891568c99

Notable upstream pull request merges:
  #11652 Split dmu_zfetch() speculation and execution parts
  #11682 Fix zfs_get_data access to files with wrong generation
  #11735 Clean up RAIDZ/DRAID ereport code
  #11737 Initialize metaslab range trees in metaslab_init
  #11739 FreeBSD: make seqc asserts conditional on replay
  #11763 Allow setting bootfs property on pools with indirect vdevs
  #11767 FreeBSD: Fix memory leaks in kstats

Obtained from: OpenZFS
MFC after: 2 weeks

3 years agoUpdate vendor/openzfs to master-891568c99
Martin Matuska [Sun, 21 Mar 2021 00:39:51 +0000 (01:39 +0100)]
Update vendor/openzfs to master-891568c99

Notable upstream pull request merges:
  #11652 Split dmu_zfetch() speculation and execution parts
  #11682 Fix zfs_get_data access to files with wrong generation
  #11735 Clean up RAIDZ/DRAID ereport code
  #11737 Initialize metaslab range trees in metaslab_init
  #11739 FreeBSD: make seqc asserts conditional on replay
  #11763 Allow setting bootfs property on pools with indirect vdevs
  #11767 FreeBSD: Fix memory leaks in kstats

3 years agorc.conf(5): Remove left-over variables
Tobias Rehbein [Sun, 21 Mar 2021 00:01:31 +0000 (01:01 +0100)]
rc.conf(5): Remove left-over variables

ipv6_ipfilter_rules was obsoleted because of ipfilter was updated, and
rc_parallel_start was reverted to undergo further refinement.

PR: 254398
Fixes: e2ad10e84792f61831d2e8bd

3 years agoMove GH_BC ObsoleteFiles.inc section to OptionalObsoleteFiles.inc
Dimitry Andric [Sat, 20 Mar 2021 22:15:01 +0000 (23:15 +0100)]
Move GH_BC ObsoleteFiles.inc section to OptionalObsoleteFiles.inc

Optional features belong in the latter file, and should be tested using:

.if ${MK_FEATURE} == no
[...]
.endif

3 years agoelftoolchain: Support building on Arm-based Macs
Jessica Clarke [Sat, 20 Mar 2021 17:58:10 +0000 (17:58 +0000)]
elftoolchain: Support building on Arm-based Macs

Currently macOS and DragonFlyBSD get their own special case and only
handle x86. Since all the FreeBSD cases should be general enough for
macOS and DragonFlyBSD (and the x86 ones are identical to the existing
ones) we can just delete the special cases and reuse the FreeBSD ones.

Note that upstream has since removed all the architecture-specific
checks in this file, with the only code relevant to us being an
endianness check that uses the generic compiler-provided macros. Thus
this patch will not be upstreamed, and will be dropped in a future
vendor import.

Reviewed by: dim
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29352

3 years agonetmap: fix issues in nm_os_extmem_create()
Vincenzo Maffione [Sat, 20 Mar 2021 17:15:50 +0000 (17:15 +0000)]
netmap: fix issues in nm_os_extmem_create()

- Call vm_object_reference() before vm_map_lookup_done().
- Use vm_mmap_to_errno() to convert vm_map_* return values to errno.
- Fix memory leak of e->obj.

Reported by: markj
Reviewed by: markj
MFC after: 1 week

3 years agotools/build: Improve host-symlinks failure mode
Jessica Clarke [Sat, 20 Mar 2021 13:00:34 +0000 (13:00 +0000)]
tools/build: Improve host-symlinks failure mode

Since set -e is enabled by sys.mk, if the tool cannot be found in PATH
then the entire shell command line fails, causing us to not print the
error message below and instead silently (due to the @) fail, only
getting the usual "Error code 1" print from bmake. Thus, provide a dummy
default that will never exist (the same as is used by meta2deps.sh) if
which fails so that we get the error message as intended.

MFC after: 1 week

3 years agovirtio_pci_legacy: Allow memory space for configuration
Ka Ho Ng [Sat, 20 Mar 2021 07:40:55 +0000 (15:40 +0800)]
virtio_pci_legacy: Allow memory space for configuration

For guests running under some kind of VMMs, configuration structure is
available in memory space but not I/O space.

Reported by: Yuan Rui <number201724@me.com>
MFC after: 2 weeks
Reviewed by: rpokala, bryanv, jhb
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D28818

3 years agovirtio_pci_legacy: Use the table BAR and PBA BAR from MSI-X cap
Ka Ho Ng [Sat, 20 Mar 2021 07:40:52 +0000 (15:40 +0800)]
virtio_pci_legacy: Use the table BAR and PBA BAR from MSI-X cap

The MSI-X resource shouldn't be assumed to be always on BAR1.
The Virtio v1.1 Spec did not specify that MSI-X table and PBA BAR has to
be BAR1 either.

Reported by: Yuan Rui <number201724@me.com>
MFC after: 2 weeks
Reviewed by: bryanv, jhb
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D28817

3 years agofusefs: fix a dead store in fuse_vnop_advlock
Alan Somers [Sat, 20 Mar 2021 01:38:57 +0000 (19:38 -0600)]
fusefs: fix a dead store in fuse_vnop_advlock

kevans actually caught this in the original review and I fixed it, but
then I committed an older copy of the branch.  Whoops.

Reported by: kevans
MFC after: 13 days
MFC with: 929acdb19acb67cc0e6ee5439df98e28a84d4772
Differential Revision: https://reviews.freebsd.org/D29031

3 years agoOnly symlink cryptodev.h into /usr/include/crypto/
John Baldwin [Fri, 19 Mar 2021 23:59:44 +0000 (16:59 -0700)]
Only symlink cryptodev.h into /usr/include/crypto/

I missed updating the symlink side in the earlier commit.

Fixes: 283352dd4f6a3bb2f3c7cb45ce5dca3d86f5e3f4
MFC after: 1 week

3 years agoRemove /usr/include/crypto/rijndael.h as well.
John Baldwin [Fri, 19 Mar 2021 23:31:53 +0000 (16:31 -0700)]
Remove /usr/include/crypto/rijndael.h as well.

I missed this in the earlier commit.

MFC after: 1 week
Fixes: 283352dd4f6a3bb2f3c7cb45ce5dca3d86f5e3f4

3 years agonfsv4 client: fix forced dismount when sleeping on nfsv4lck
Rick Macklem [Fri, 19 Mar 2021 21:09:33 +0000 (14:09 -0700)]
nfsv4 client: fix forced dismount when sleeping on nfsv4lck

During a recent NFSv4 testing event a test server caused a hang
where "umount -N" failed.  The renew thread was sleeping on "nfsv4lck"
and the "umount" was sleeping, waiting for the renew thread to
terminate.

This is the first of two patches that is hoped to fix the renew thread
so that it will terminate when "umount -N" is done on the mount.

nfsv4_lock() checks for forced dismount, but only after it wakes up
from msleep().  Without this patch, a wakeup() call was required.
This patch adds a 1second timeout on the msleep(), so that it will
wake up and see the forced dismount flag.  Normally a wakeup()
will occur in less than 1second, but if a premature return from
msleep() does occur, it will simply loop around and msleep() again.

While here, replace the nfsmsleep() wrapper that was used for portability
with the actual msleep() call and make the same change for nfsv4_getref().

MFC after: 2 weeks

3 years agocxgbe(4): create a separate helper routine to write the global RSS key.
Navdeep Parhar [Fri, 19 Mar 2021 20:28:11 +0000 (13:28 -0700)]
cxgbe(4): create a separate helper routine to write the global RSS key.

While here, make sure only the PF driver attempts to program the global
RSS key (with options RSS).  The VF driver doesn't have access to those
device registers.

MFC after: 1 week
Sponsored by: Chelsio Communications

3 years agox86: consolidate hw watchpoint logic into new file
Mitchell Horne [Fri, 19 Mar 2021 19:39:12 +0000 (16:39 -0300)]
x86: consolidate hw watchpoint logic into new file

This is a prerequisite to using these functions outside of ddb, but also
provides some cleanup and minor refactoring. This code is almost
entirely duplicated between the two implementations, the only
significant difference being the lack of dbreg synchronization on i386.

Cleanups are:
 - demote some internal functions to static
 - use the constant NDBREGS instead of a '4' literal
 - remove K&R definitions
 - some added comments

Reviewed by: kib, jhb
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29153

3 years agocxgbe(4): make it safe to call setup_memwin repeatedly.
Navdeep Parhar [Fri, 19 Mar 2021 19:30:57 +0000 (12:30 -0700)]
cxgbe(4): make it safe to call setup_memwin repeatedly.

A repeat call will recreate the memory windows in the hardware and move
them to their last-known positions without repeating any of the software
initialization.

MFC after: 1 week
Sponsored by: Chelsio Communications

3 years agoAlso skip sys/net/if_lagg_test:witness on non-i386
Alex Richardson [Fri, 19 Mar 2021 18:35:04 +0000 (18:35 +0000)]
Also skip sys/net/if_lagg_test:witness on non-i386

The LOR also happens on amd64 and other architectures. Ideally we would
fix this. However, in order to get Jenkins green again to catch real
regressions, we should skip this test for now.

PR: 251726
Reviewed By: lwhsu
Differential Revision: https://reviews.freebsd.org/D29341

3 years agotests/sys/netgraph: Further CI fixes
Alex Richardson [Fri, 19 Mar 2021 18:34:29 +0000 (18:34 +0000)]
tests/sys/netgraph: Further CI fixes

I was trying to debug why this test is working locally but failing in CI.
While doing so I made some small changes to allow running it with set -e.

It turns out the problem is that find_iface does not return anything in
Jenkins, so all following tests fail with obscure error messages.
To handle this case exit early if $eth is empty.

Reviewed By: lwhsu
Differential Revision: https://reviews.freebsd.org/D29340

3 years agopfilctl: improve formatting of "hooks" and "heads" command output.
Gleb Smirnoff [Fri, 19 Mar 2021 18:18:05 +0000 (11:18 -0700)]
pfilctl: improve formatting of "hooks" and "heads" command output.

In "heads" output just improve the header to describe all of the columns.
In "hooks" print filter name and hook name delimited with colon, so that
it matches "heads" output and also can be copy-and-pasted straight into
the command line for future "link" command.

3 years agocxgbe(4): use standard sysctl routines to deal with 16b values.
Navdeep Parhar [Fri, 19 Mar 2021 17:56:24 +0000 (10:56 -0700)]
cxgbe(4): use standard sysctl routines to deal with 16b values.

These routines to handle 8b and 16b types were added in r289773 5+ years
ago.

MFC after: 2 weeks
Sponsored by: Chelsio Communications

3 years agoarmv8crypto: note derivation in armv8_crypto_wrap.c
Mitchell Horne [Mon, 15 Mar 2021 13:46:03 +0000 (10:46 -0300)]
armv8crypto: note derivation in armv8_crypto_wrap.c

This file inherits some boilerplate and structure from the analogous
file in aesni(4), aesni_wrap.c. Note the derivation and the copyright
holders of that file.

For example, the AES-XTS bits added in 4979620ece984 were ported from
aesni(4).

Requested by: jmg
Reviewed by: imp, gnn
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29268

3 years agoClarify that scripted installations don't require specification of boot
Nathan Whitehorn [Fri, 19 Mar 2021 13:44:30 +0000 (09:44 -0400)]
Clarify that scripted installations don't require specification of boot
partitions, as there seems to be widespread confusion on this point.

MFC after: 1 day

3 years agodevelopment(7): mention the Git mirror list in the manual page
Evgeniy Khramtsov [Fri, 19 Mar 2021 12:52:21 +0000 (20:52 +0800)]
development(7): mention the Git mirror list in the manual page

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

3 years agobc: upgrade to version 3.3.4
Stefan Eßer [Fri, 19 Mar 2021 08:46:12 +0000 (09:46 +0100)]
bc: upgrade to version 3.3.4

This upgrade performs an implicit flush of the output if the script
funcion read() is called, to make sure a prompt that does not end in a
new-line is correctly displayed in line-buffered output mode.

Merge commit '893ecb52db5ed47d6c1e8698334d34e0df651612'

3 years agoVendor import of bc 3.3.4
Stefan Eßer [Fri, 19 Mar 2021 08:39:56 +0000 (09:39 +0100)]
Vendor import of bc 3.3.4

3 years agorc.conf(5): Bump date on .Dd
Daniel Ebdrup Jensen [Fri, 19 Mar 2021 03:52:26 +0000 (04:52 +0100)]
rc.conf(5): Bump date on .Dd

Pointy hat to: me
Reported by: lwhsu

3 years agobhyve: support relocating fbuf and passthru data BARs
D Scott Phillips [Thu, 18 Mar 2021 16:08:52 +0000 (00:08 +0800)]
bhyve: support relocating fbuf and passthru data BARs

We want to allow the UEFI firmware to enumerate and assign
addresses to PCI devices so we can boot from NVMe[1]. Address
assignment of PCI BARs is properly handled by the PCI emulation
code in general, but a few specific cases need additional support.
fbuf and passthru map additional objects into the guest physical
address space and so need to handle address updates. Here we add a
callback to emulated PCI devices to inform them of a BAR
configuration change. fbuf and passthru then watch for these BAR
changes and relocate the frame buffer memory segment and passthru
device mmio area respectively.

We also add new VM_MUNMAP_MEMSEG and VM_UNMAP_PPTDEV_MMIO ioctls
to vmm(4) to facilitate the unmapping needed for addres updates.

[1]: https://github.com/freebsd/uefi-edk2/pull/9/

Originally by: scottph
MFC After: 1 week
Sponsored by: Intel Corporation
Reviewed by: grehan
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D24066

3 years agoRefactor configuration management in bhyve.
John Baldwin [Wed, 26 Jun 2019 20:30:41 +0000 (13:30 -0700)]
Refactor configuration management in bhyve.

Replace the existing ad-hoc configuration via various global variables
with a small database of key-value pairs.  The database supports
heirarchical keys using a MIB-like syntax to name the path to a given
key.  Values are always stored as strings.  The API used to manage
configuation values does include wrappers to handling boolean values.
Other values use non-string types require parsing by consumers.

The configuration values are stored in a tree using nvlists.  Leaf
nodes hold string values.  Configuration values are permitted to
reference other configuration values using '%(name)'.  This permits
constructing template configurations.

All existing command line arguments now set configuration values.  For
devices, the "-s" option parses its option argument to generate a list
of key-value pairs for the given device.

A new '-o' command line option permits setting an individual
configuration variable.  The key name is always given as a full path
of dot-separated components.

A new '-k' command line option parses a simple configuration file.
This configuration file holds a flat list of 'key=value' lines where
the 'key' is the full path of a configuration variable.  Lines
starting with a '#' are comments.

In general, bhyve starts by parsing command line options in sequence
and applying those settings to configuration values.  Once this is
complete, bhyve then begins initializing its state based on the
configuration values.  This means that subsequent configuration
options or files may override or supplement previously given settings.

A special 'config.dump' configuration value can be set to true to help
debug configuration issues.  When this value is set, bhyve will print
out the configuration variables as a flat list of 'key=value' lines.

Most command line argments map to a single configuration variable,
e.g.  '-w' sets the 'x86.strictmsr' value to false.  A few command
line arguments have less obvious effects:

- Multiple '-p' options append their values (as a comma-seperated
  list) to "vcpu.N.cpuset" values (where N is a decimal vcpu number).

- For '-s' options, a pci.<bus>.<slot>.<function> node is created.
  The first argument to '-s' (the device type) is used as the value of
  a "device" variable.  Additional comma-separated arguments are then
  parsed into 'key=value' pairs and used to set additional variables
  under the device node.  A PCI device emulation driver can provide
  its own hook to override the parsing of the additonal '-s' arguments
  after the device type.

  After the configuration phase as completed, the init_pci hook
  then walks the "pci.<bus>.<slot>.<func>" nodes.  It uses the
  "device" value to find the device model to use.  The device
  model's init routine is passed a reference to its nvlist node
  in the configuration tree which it can query for specific
  variables.

  The result is that a lot of the string parsing is removed from
  the device models and centralized.  In addition, adding a new
  variable just requires teaching the model to look for the new
  variable.

- For '-l' options, a similar model is used where the string is
  parsed into values that are later read during initialization.
  One key note here is that the serial ports use the commonly
  used lowercase names from existing documentation and examples
  (e.g. "lpc.com1") instead of the uppercase names previously
  used internally in bhyve.

Reviewed by: grehan
MFC after: 3 months
Differential Revision: https://reviews.freebsd.org/D26035

3 years agofusefs: fix two bugs regarding fcntl file locks
Alan Somers [Thu, 18 Mar 2021 20:27:27 +0000 (14:27 -0600)]
fusefs: fix two bugs regarding fcntl file locks

1) F_SETLKW (blocking) operations would be sent to the FUSE server as
   F_SETLK (non-blocking).

2) Release operations, F_SETLK with lk_type = F_UNLCK, would simply
   return EINVAL.

PR: 253500
Reported by: John Millikin <jmillikin@gmail.com>
MFC after: 2 weeks

3 years agoUnbreak MSG_CMSG_CLOEXEC
Alex Richardson [Thu, 18 Mar 2021 20:52:20 +0000 (20:52 +0000)]
Unbreak MSG_CMSG_CLOEXEC

MSG_CMSG_CLOEXEC has not been working since 2015 (SVN r284380) because
_finstall expects O_CLOEXEC and not UF_EXCLOSE as the flags argument.
This was probably not noticed because we don't have a test for this flag
so this commit adds one. I found this problem because one of the
libwayland tests was failing.

Fixes: ea31808c3b07 ("fd: move out actual fp installation to _finstall")
MFC after: 3 days
Reviewed By: mjg, kib
Differential Revision: https://reviews.freebsd.org/D29328

3 years agoAdd Chacha20+Poly1035 to the list of AEAD algorithms.
John Baldwin [Thu, 18 Mar 2021 20:31:39 +0000 (13:31 -0700)]
Add Chacha20+Poly1035 to the list of AEAD algorithms.

Sponsored by: Netflix

3 years agovtnet: fix TSO for TCP/IPv6
Michael Tuexen [Thu, 18 Mar 2021 20:25:47 +0000 (21:25 +0100)]
vtnet: fix TSO for TCP/IPv6

The decision whether a TCP packet is sent over IPv4 or IPv6 was
based on ethertype, which works correctly. In D27926 the criteria
was changed to checking if the CSUM_IP_TSO flag is set in the
csum-flags and then considering it to be TCP/IPv4.
However, the TCP stack sets the flag to CSUM_TSO for IPv4 and IPv6,
where CSUM_TSO is defined as CSUM_IP_TSO|CSUM_IP6_TSO.
Therefore TCP/IPv6 packets gets mis-classified as TCP/IPv4,
which breaks TSO for TCP/IPv6.
This patch bases the check again on the ethertype.
This fix will be MFC instantly as discussed with re(gjb).

MFC after: instantly
PR: 254366
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D29331

3 years agoFix the 'linux' rc script on aarch64.
Edward Tomasz Napierala [Tue, 16 Mar 2021 16:48:13 +0000 (16:48 +0000)]
Fix the 'linux' rc script on aarch64.

Previously it would try to load linux.ko instead of linux64.ko
and fail.  While here, don't try to match 'linuxaout'; even if
implemented, it's the same module as `linuxelf`.

Reviewed By: emaste
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D29288

3 years agonfsv4 pnfs client: fix updating of the layout stateid.seqid
Rick Macklem [Thu, 18 Mar 2021 19:20:25 +0000 (12:20 -0700)]
nfsv4 pnfs client: fix updating of the layout stateid.seqid

During a recent NFSv4 testing event a test server was replying
NFSERR_OLDSTATEID for layout stateids presented to the server
for LayoutReturn operations.  Upon rereading RFC5661, it was
apparent that the FreeBSD NFSv4.1/4.2 pNFS client did not
maintain the seqid field of the layout stateid correctly.

This patch is believed to correct the problem.  Tested against
a FreeBSD pNFS server with diagnostics added to check the stateid's
seqid did not indicate problems.  Unfortunately, testing aginst
this server will not happen in the near future, so the fix may
not be correct yet.

MFC after: 2 weeks

3 years agoRename linux_set_upcall_kse() to linux_set_upcall().
John Baldwin [Thu, 18 Mar 2021 19:14:34 +0000 (12:14 -0700)]
Rename linux_set_upcall_kse() to linux_set_upcall().

This matches the rename of cpu_set_upcall_kse() in
5c2cf818454375536fda522ba83cf67c50929e6b.

Reviewed by: kib, emaste
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D29295

3 years agox86: Reduce code duplication in cpu_fork() and cpu_copy_thread().
John Baldwin [Thu, 18 Mar 2021 19:13:17 +0000 (12:13 -0700)]
x86: Reduce code duplication in cpu_fork() and cpu_copy_thread().

Add copy_thread() to hold shared code.

Reviewed by: kib
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29228

3 years agorc.conf(5): Document the 'workstation' firewall_type
Tobias Rehbein [Thu, 18 Mar 2021 17:01:09 +0000 (18:01 +0100)]
rc.conf(5): Document the 'workstation' firewall_type

Document the workstation ACL ruleset, which uses stateful rules.

While here, add a note about where some of the undocumented variables
can be found. This is not a perfect solution for bug 127359, but it at
at least gives a place to go look, and can be used as a reference for
when bug 127359 gets fixed properly.

PR: 254358, 127359

3 years agoRevert "bootstrap: add tic to the bootstrap tools"
Baptiste Daroussin [Thu, 18 Mar 2021 15:01:11 +0000 (16:01 +0100)]
Revert "bootstrap: add tic to the bootstrap tools"
Since we don't build and install the terminfo db anymore this is not
needed

This reverts commit b6a51d39e3a2e2f75d5b42a8c17a531063258a15.
This reverts commit e5e4845959ac60110677df302a68c220dff75abe.
This reverts commit 0af562d7e1850bbef230d30805c101b26588a3ed.

3 years agovfs: fix vnlru marker handling for filtered/unfiltered cases
Mateusz Guzik [Wed, 17 Mar 2021 21:33:47 +0000 (22:33 +0100)]
vfs: fix vnlru marker handling for filtered/unfiltered cases

The global list has a marker with an invariant that free vnodes are
placed somewhere past that. A caller which performs filtering (like ZFS)
can move said marker all the way to the end, across free vnodes which
don't match. Then a caller which does not perform filtering will fail to
find them. This makes vn_alloc_hard sleep for 1 second instead of
reclaiming, resulting in significant stalls.

Fix the problem by requiring an explicit marker by callers which do
filtering.

As a temporary measure extend vnlru_free to restart if it fails to
reclaim anything.

Big thanks go to the reporter for testing several iterations of the
patch.

Reported by: Yamagi <lists yamagi.org>
Tested by: Yamagi <lists yamagi.org>
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D29324

3 years agoinetd.conf: Wordsmith recommendation
Daniel Ebdrup Jensen [Thu, 18 Mar 2021 14:17:32 +0000 (15:17 +0100)]
inetd.conf: Wordsmith recommendation

Rather than recommend specific VTIs, it's better to give a general
recommendation for where current and future suitable VTIs can be found.

3 years agolib80211: Start adding 11ac ETSI bits to regdomain.xml
Bjoern A. Zeeb [Thu, 18 Mar 2021 11:08:47 +0000 (11:08 +0000)]
lib80211: Start adding 11ac ETSI bits to regdomain.xml

Summary:
This change currently (partially) duplicates AC1 freqbands as AC2
as they are not fully overlapping.
It then adds the 11ac netband to the "etsi" domain including
"indoor" and "dfs" flags, which we can deal with, as well as
appropriate (round down) maxpower values.
Comments are left for the actual frequency bands as we do use the
centerfreq for the first/last (chansep sized) channel in the
freqband and their "id" name, which can be confusing.

Sponsored-by: Rubicon Communications, LLC ("Netgate")
Reviewed-by: philip, adrian
MFC-after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25999

3 years agonet80211: split up ieee80211_probereq()
Bjoern A. Zeeb [Sat, 6 Mar 2021 21:05:43 +0000 (21:05 +0000)]
net80211: split up ieee80211_probereq()

Factor out ieee80211_probereq_ie() and ieee80211_probereq_ie_len()
and make the length dynamic rather than static max.  The latter is
needed as our current fixed length was longer than some "hw scan",
e.g. that of ath10k, will take.  This way we can pass what we have.
Should this not be sufficient in the future we might have to deal
with filtering and much more error handling.

This also removes a duplicate calculation for ieee80211_ie_wpa [1].

Repoprted-by: Martin Husemann <martin NetBSD.org> [1]
Sponsored-by: Rubicon Communications, LLC ("Netgate")
Sponsored-by: The FreeBSD Foundation (update for alloc)
Reviewed-by: adrian, martin NetBSD.org (earlier version)
Reviewed-by: philip
MFC-after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D26545

3 years agoLinuxKPI: add support for crc32_le()
Bjoern A. Zeeb [Wed, 10 Mar 2021 15:01:10 +0000 (15:01 +0000)]
LinuxKPI: add support for crc32_le()

Add support for crc32_le() as a wrapper around crc32_raw().

Sponsored-by: The FreeBSD Foundation
Obtained-from: bz_iwlwifi
MFC-after: 2 weeks
Reviewed-by: hselasky
Differential Revision: https://reviews.freebsd.org/D29187

3 years agotermios: add more speeds
Bjoern A. Zeeb [Wed, 10 Mar 2021 22:17:07 +0000 (22:17 +0000)]
termios: add more speeds

A lot of small arm64 gadgets are using 1500000 as console speed.
While cu can perfectly deal with this some 3rd party software, e.g.,
comms/conserver-con add speeds based on B<n> being defined.
Having it defined here simplifies enhancing other software.

Obtained-from: NetBSD sys/sys/termios.h 1.36
MFC-after: 2 weeks
Reviewed-by: philip (,okayed by imp)
Differential Revision: https://reviews.freebsd.org/D29209

3 years agoterminfo db: add entries for the terminfo database removal
Baptiste Daroussin [Thu, 18 Mar 2021 10:04:32 +0000 (11:04 +0100)]
terminfo db: add entries for the terminfo database removal

3 years agoRevert "terminfo: add terminfo database"
Baptiste Daroussin [Thu, 18 Mar 2021 09:57:23 +0000 (10:57 +0100)]
Revert "terminfo: add terminfo database"

This reverts commit 2a50a9de8340f08bd876e9e5993332ae14376f80.

3 years agoterminfo: add more path to lookup for the database
Baptiste Daroussin [Thu, 18 Mar 2021 08:46:15 +0000 (09:46 +0100)]
terminfo: add more path to lookup for the database

In preparation for the move of the database out of base, add one more
path to lookup
Now the default lookup path is

1. base
2. localbase
3. localbase special site for custom terminfo (for ports adding custom
terminfo and avoid potential collision with the general db)
4. termcap

The plan is to allow the terminfo-db to be installed by end users via
a package for people willing to have the support for features from
this database provides. And keep the fallback on termcap for people who
don't want to hear about the terminfo db or how to configure the terminal
if it uses by default the features proposed in the definitions
of the terminfo db.

the first look up path is a window open for a proposal made by glebius@
consisting on creating a tool where the user at install time will select
the feature it want for a given terminal and generate its configurations
based on that. I won't work on it, but it is now posssible and there is
a path where to store those definitions

3 years agoClarify that the new STABLE branch is branched off CURRENT, not renamed
Li-Wen Hsu [Thu, 18 Mar 2021 09:16:16 +0000 (17:16 +0800)]
Clarify that the new STABLE branch is branched off CURRENT, not renamed

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

3 years agogenet: Fix problem with forwarding some TCP/IPv6 packets
Mike Karels [Thu, 18 Mar 2021 00:19:24 +0000 (19:19 -0500)]
genet: Fix problem with forwarding some TCP/IPv6 packets

TCP/IPv6 packets to be forwarded can be laid out with only the Ethernet
header in the first mbuf, and these packets are lost.  There was a
previous hack to pullup ICMPv6 packets with such a layout for the
same reason.  Generalize, and pullup any IPv6 packets with only the
Ethernet header in the first mbuf.  Possibly this should also include
IPv4, but that situation has not been observed to fail.

PR: 254060
Reported by: denis at h3q.com
MFC after: 3 days

3 years agoRemove unused obj variable missed in r354870.
Bryan Drewery [Wed, 17 Mar 2021 22:01:19 +0000 (15:01 -0700)]
Remove unused obj variable missed in r354870.

Sponsored by: Dell EMC

3 years agoarm64: implement COMPAT_FREEBSD32 fill/set dbregs/fpregs
Ed Maste [Wed, 17 Mar 2021 14:10:41 +0000 (10:10 -0400)]
arm64: implement COMPAT_FREEBSD32 fill/set dbregs/fpregs

On FreeBSD/arm fill_fpregs, fill_dbregs are stubs that zero the reg
struct and return success. set_fpregs and set_dbregs do nothing and
return success.

Provide the same implementation for arm64 COMPAT_FREEBSD32.

Reviewed by: andrew
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29314

3 years agoaarch64: Clear TLS registers during exec().
John Baldwin [Wed, 17 Mar 2021 20:19:04 +0000 (13:19 -0700)]
aarch64: Clear TLS registers during exec().

These are not stored in the trapframe so must be cleared explicitly.

This is similar to one of the MIPS changes in 822d2d6ac94f.

Reviewed by: andrew
Obtained from: CheriBSD
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D28711

3 years agopf tests: pfsync bulk update test
Kristof Provost [Mon, 15 Mar 2021 13:10:55 +0000 (14:10 +0100)]
pf tests: pfsync bulk update test

Test that pfsync works as expected with bulk updates. That is, create
some state before setting up the second firewall. Let that firewall
request a bulk update so it can catch up, and check that it got the
state which was created before it enable pfsync.

PR: 254236
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29272

3 years agopfsync: Unconditionally push packets when requesting state updates
Thomas Kurschel [Mon, 15 Mar 2021 13:28:52 +0000 (14:28 +0100)]
pfsync: Unconditionally push packets when requesting state updates

When we request a bulk sync we need to ensure we actually send out that
request, not just buffer it until we have enough data to send a full
packet.

PR: 254236
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29271

3 years agofix panic when rescue retransmission and FIN overlap
Richard Scheffenegger [Wed, 17 Mar 2021 15:44:29 +0000 (16:44 +0100)]
fix panic when rescue retransmission and FIN overlap

PR:           254244
PR:           254309
Reviewed By:  #transport, hselasky, tuexen
MFC after:    3 days
Sponsored By: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29315

3 years agorelease: sync 'git count' logic with newvers.sh
Glen Barber [Wed, 17 Mar 2021 14:57:32 +0000 (10:57 -0400)]
release: sync 'git count' logic with newvers.sh

Sync determining the git count with newvers.sh by adding the
--first-parent argument.  This ensures uname(1) reflects the
file name for snapshots.

Reported by: Mark Millard
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agonvme: Replace potentially long DELAY() with pause().
Alexander Motin [Wed, 17 Mar 2021 14:30:40 +0000 (10:30 -0400)]
nvme: Replace potentially long DELAY() with pause().

In some cases like broken hardware nvme(4) may wait minutes for
controller response before timeout.  Doing so in a tight spin loop
made whole system unresponsive.

Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29309
Sponsored by: iXsystems, Inc.

3 years agobase: remove if_wg(4) and associated utilities, manpage
Kyle Evans [Tue, 16 Mar 2021 02:38:23 +0000 (21:38 -0500)]
base: remove if_wg(4) and associated utilities, manpage

After length decisions, we've decided that the if_wg(4) driver and
related work is not yet ready to live in the tree.  This driver has
larger security implications than many, and thus will be held to
more scrutiny than other drivers.

Please also see the related message sent to the freebsd-hackers@
and freebsd-arch@ lists by Kyle Evans <kevans@FreeBSD.org> on
2021/03/16, with the subject line "Removing WireGuard Support From Base"
for additional context.

3 years agoRemove tmpfs size and properly format generated fstab for arm
Daniel Engerg [Wed, 17 Mar 2021 14:00:57 +0000 (15:00 +0100)]
Remove tmpfs size and properly format generated fstab for arm

Remove tmpfs size limitation, this breaks make installworld and installation of some packages
Format generated fstab using tabs to make it consistent and readable

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29283

3 years agowpa: import fix for P2P provision discovery processing vulnerability
Cy Schubert [Wed, 17 Mar 2021 00:06:17 +0000 (17:06 -0700)]
wpa: import fix for P2P provision discovery processing vulnerability

Latest version available from: https://w1.fi/security/2021-1/

Vulnerability

A vulnerability was discovered in how wpa_supplicant processes P2P
(Wi-Fi Direct) provision discovery requests. Under a corner case
condition, an invalid Provision Discovery Request frame could end up
reaching a state where the oldest peer entry needs to be removed. With
a suitably constructed invalid frame, this could result in use
(read+write) of freed memory. This can result in an attacker within
radio range of the device running P2P discovery being able to cause
unexpected behavior, including termination of the wpa_supplicant process
and potentially code execution.

Vulnerable versions/configurations

wpa_supplicant v1.0-v2.9 with CONFIG_P2P build option enabled

An attacker (or a system controlled by the attacker) needs to be within
radio range of the vulnerable system to send a set of suitably
constructed management frames that trigger the corner case to be reached
in the management of the P2P peer table.

Note: FreeBSD base does not enable P2P.

3 years agoImplement pci_get_relaxed_ordering_enabled() helper function.
Hans Petter Selasky [Tue, 16 Mar 2021 15:06:42 +0000 (16:06 +0100)]
Implement pci_get_relaxed_ordering_enabled() helper function.

Discussed with: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoImplement sndstat nvlist-based enumeration ioctls.
Ka Ho Ng [Wed, 17 Mar 2021 10:51:58 +0000 (18:51 +0800)]
Implement sndstat nvlist-based enumeration ioctls.

These ioctl commands aim to provide easier ways for user space
applications to enumerate existing audio devices and the node they can
potentially use.

The exchange of device lists between user space and kernel is done on
nv(9). Some ioctl commands are added to /dev/sndstat node:
  - SNDSTAT_REFRESH_DEVS
  - SNDSTAT_GET_DEVS
  - SNDSTAT_ADD_USER_DEVS
  - SNDSTAT_FLUSH_USER_DEVS

Bump __FreeBSD_version to reflect the addition of the ioctls.

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D26884

3 years agonlmrsa: Mark deprecated for 14.
John Baldwin [Tue, 16 Mar 2021 21:34:58 +0000 (14:34 -0700)]
nlmrsa: Mark deprecated for 14.

This is the only in-tree driver for the asymmetric crypto support in
OCF that is already marked deprecated for 14.

MFC after: 3 days
Sponsored by: Chelsio Communications

3 years agonfs: Cleanup dead files
Peter Jeremy [Tue, 16 Mar 2021 19:16:31 +0000 (06:16 +1100)]
nfs: Cleanup dead files

These files are no longer used by the FreeBSD base system. They were being used by the amd port but that has also been deleted.

Reviewed by: rmacklem
Sponsored by: Google
Differential Revision: https://reviews.freebsd.org/D29180

3 years agostand: Load INIT_ARRAY and FINI_ARRAY sections
Mark Johnston [Tue, 16 Mar 2021 19:01:41 +0000 (15:01 -0400)]
stand: Load INIT_ARRAY and FINI_ARRAY sections

This is required for preloading modules into a KASAN-configured kernel.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agolink_elf_obj: Add a case missing from 5e6989ba4f26
Mark Johnston [Tue, 16 Mar 2021 19:01:41 +0000 (15:01 -0400)]
link_elf_obj: Add a case missing from 5e6989ba4f26

Fixes: 5e6989ba4f26
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

3 years agopkgbase: Fix building out-of-tree manual pages
Jung-uk Kim [Tue, 16 Mar 2021 18:16:10 +0000 (14:16 -0400)]
pkgbase: Fix building out-of-tree manual pages

c7e6cb9e08d6 introduced MK_MANSPLITPKG but it was not available for
building out-of-tree manual pages.  For example, x11/nvidia-driver fails
with the following error:

===> doc (all)
make[3]: "/usr/share/mk/bsd.man.mk" line 53: Malformed conditional (${MK_MANSPLITPKG} == "no")
make[3]: Fatal errors encountered -- cannot continue

Move the definition from src.opts.mk to bsd.opts.mk to make it visible.

3 years agocxgbe(4): catch up with the latest cryptocaps.
Navdeep Parhar [Mon, 15 Mar 2021 19:54:34 +0000 (12:54 -0700)]
cxgbe(4): catch up with the latest cryptocaps.

There are two crypto capabilities that the driver didn't know about.

MFC after: 1 week
Sponsored by: Chelsio Communications

3 years agorelease: do not set __MAKE_CONF and SRCCONF for the chroot build
Glen Barber [Tue, 16 Mar 2021 16:01:48 +0000 (12:01 -0400)]
release: do not set __MAKE_CONF and SRCCONF for the chroot build

PR: 254319
Submitted by: truckman
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agopkg: settle the uniq extension to .pkg instead of .bsd
Baptiste Daroussin [Tue, 16 Mar 2021 15:18:48 +0000 (16:18 +0100)]
pkg: settle the uniq extension to .pkg instead of .bsd

Requested by: many

3 years agobhyve: virtio shares definitions between sys/dev/virtio
Ka Ho Ng [Tue, 16 Mar 2021 11:27:38 +0000 (19:27 +0800)]
bhyve: virtio shares definitions between sys/dev/virtio

Definitions inside usr.sbin/bhyve/virtio.h are thrown away.
Definitions in sys/dev/virtio are used instead.

This reduces code duplication.

Sponsored by: The FreeBSD Foundation
Reviewed by: grehan
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D29084

3 years agopf: pool/kpool conversion code
Kristof Provost [Thu, 11 Mar 2021 10:37:05 +0000 (11:37 +0100)]
pf: pool/kpool conversion code

stuct pf_pool and struct pf_kpool are different. We should not simply
bcopy() them.

Happily it turns out that their differences were all pointers, and the
userspace provided pointers were overwritten by the kernel, so this did
actually work correctly, but we should fix it anyway.

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29216

3 years agoRevert "include: Remove symlink installation"
Emmanuel Vadot [Tue, 16 Mar 2021 07:40:59 +0000 (08:40 +0100)]
Revert "include: Remove symlink installation"

This reverts commit 0006530aa14b9df56f88df7d819fae89b115d865.

3 years agoRevert "include: Tag directly the last headers"
Emmanuel Vadot [Tue, 16 Mar 2021 07:40:54 +0000 (08:40 +0100)]
Revert "include: Tag directly the last headers"

This reverts commit 839fc8cdf9b6bafe120e7da8a4b78950ad7295c4.

3 years agopkgbase: Add an src.conf option for splitting man pages
Emmanuel Vadot [Tue, 16 Mar 2021 06:11:56 +0000 (07:11 +0100)]
pkgbase: Add an src.conf option for splitting man pages

Man pages can be big in total, add an options to split man pages
in -man packages so we produce smaller packages.
This is useful for small jails or mfsroot produced of pkgbase.
The option is off by default.

Reviewed by: bapt, Mina Galić <me@igalic.co>
Differential Revision: https://reviews.freebsd.org/D29169
MFC after:      2 weeks

3 years agoConvert libs with pc files to use PCFILES
Emmanuel Vadot [Tue, 16 Mar 2021 06:13:07 +0000 (07:13 +0100)]
Convert libs with pc files to use PCFILES

Now the .pc ends up in the correct package (-dev)

Reviewed by: bapt, emaste
Differential Revision: https://reviews.freebsd.org/D29172
MFC after:      2 weeks

3 years agobsd.lib.mk: Add a install target for .pc files
Emmanuel Vadot [Tue, 16 Mar 2021 06:13:03 +0000 (07:13 +0100)]
bsd.lib.mk: Add a install target for .pc files

That way the files are correctly taggued for pkgbase

Reviewed by: bapt, emaste (both earlier version)
Differential Revision: https://reviews.freebsd.org/D29171
MFC after:      2 weeks

3 years agoinclude: Tag directly the last headers
Emmanuel Vadot [Tue, 16 Mar 2021 06:13:00 +0000 (07:13 +0100)]
include: Tag directly the last headers

We cannot easily used the TAG here and we don't yet have something to install
even .h from a diretory in bsd.prog.mk

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D29170
MFC after:      2 weeks

3 years agopkgbase: Remove case for runtime and jail package ucl generation
Emmanuel Vadot [Tue, 16 Mar 2021 06:12:56 +0000 (07:12 +0100)]
pkgbase: Remove case for runtime and jail package ucl generation

They aren't needed and produce wrong package comments :
We use to have "runtime-dev package" instead of
"FreeBSD Base System (Development Files)" for example

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D29168
MFC after:      2 weeks