]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
19 months agolinux(4): Add the forgotten in the 6f8439db opt_compat include.
Dmitry Chagin [Sun, 5 Feb 2023 15:25:10 +0000 (18:25 +0300)]
linux(4): Add the forgotten in the 6f8439db opt_compat include.

MFC after: 1 week

19 months agocoretemp: Only log critical temperature events
sadaszewski [Wed, 17 Nov 2021 07:27:46 +0000 (08:27 +0100)]
coretemp: Only log critical temperature events

According to the Intel manual
https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-3b-part-2-manual.pdf
the Thermal Status (0) and Thermal Status Log (1) bits report only a
high temperature on the CPU, not a critical temperature as suggested in
the coretemp driver. Check the Critical Temperature Log (5) instead.
The critical temperature waives guarantees of correct function,
therefore the CPU could have for example written some wrong values into
memory at that point and the OS should be stopped ASAP as the state is
no longer reliable.

Reviewed by: imp (confirmed descriptions of bits, linux ignores these bits)
Pull Request: https://github.com/freebsd/freebsd-src/pull/562

19 months agoFix truncation when ssize_t is larger than MAX_INT
Alfonso [Sat, 24 Jul 2021 16:52:31 +0000 (12:52 -0400)]
Fix truncation when ssize_t is larger than MAX_INT

Casting to int truncates size on some platforms, resulting swab not
copying all the data. Cast len to size_t to avoid right shifting a
signed value: we know here it's > 0, so we can safely cast it w/o losing
precision.

In addition, be more careful with signedness of char pointers and
temporaries. Downgrade tmp from unsigned long to unsigned char since
we're only reading and writing characters.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/516

19 months agousb/u3g: Add support for QUECTEL EP06-E 4G modem
ev [Sun, 5 Feb 2023 03:47:00 +0000 (20:47 -0700)]
usb/u3g: Add support for QUECTEL EP06-E 4G modem

Add QUECTEL EP06-E modem support via USB for FreeBSD.
Tested and works like a ppp on FreeBSD-13.

Reviewed by: imp
PR: 269326

19 months agovfs_mount.c: Free exports structures in vfs_destroy_mount()
Rick Macklem [Sat, 4 Feb 2023 22:45:23 +0000 (14:45 -0800)]
vfs_mount.c: Free exports structures in vfs_destroy_mount()

During testing of exporting file systems in jails, I
noticed that the export structures on a mount
were not being free'd when the mount is dismounted.

This bug appears to have been in the system for a
very long time.  It would have resulted in a slow memory
leak when exported file systems were dismounted.

Prior to r362158, freeing the structures during dismount
would not have been safe, since VFS_CHECKEXP() returned
a pointer into an export structure, which might still have been
used by the NFS server for an in-progress RPC when the file system
is dismounted.  r362158 fixed this, so it should now be safe
to free the structures in vfs_mount_destroy(), which is what
this patch does.

Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D38385

19 months agoRevert "vfs_export: Add checks for correct prison when updating exports"
Rick Macklem [Sat, 4 Feb 2023 22:38:32 +0000 (14:38 -0800)]
Revert "vfs_export: Add checks for correct prison when updating exports"

This reverts commit 7926a01ed7ae7cefd81ef4cc2142c35b84d81913.

A new patch in D38371 is being considered for doing this.

19 months agou3g: Add new 4G Huawei devices
Michael Paepcke [Sat, 4 Feb 2023 21:30:29 +0000 (14:30 -0700)]
u3g: Add new 4G Huawei devices

New 4G devices. Longer description of new modes to follow.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633

19 months agousb: Remove obsolete Huawei 3G from usbdevs
Michael Paepcke [Fri, 16 Dec 2022 10:05:10 +0000 (10:05 +0000)]
usb: Remove obsolete Huawei 3G from usbdevs

- remove Huawei 3G E3131 (E3131_INIT):
- frees up 0x1505/0x14fe shared IDs => product is EOL (since...)
- 3G networks are shutdown/scheduled
- E3131 devices will still work the same via scsi_huawei_eject2
- new 4G devices will switch & report correctly now

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633

19 months agousb: add support for Huawei E5573Cs322
Michael Paepcke [Sat, 17 Dec 2022 16:51:36 +0000 (16:51 +0000)]
usb: add support for Huawei E5573Cs322

Switch the now added E5573Cs322_ECM (0x14db) as well per default to NCM.
With this patch we default all devices to simple NCM mode to avoid the
problem and get a consistent reliable behavior. No matter what firmware
version and provider mix are involved.

Rationale:
Even the bigger SOC shows under complex load in ECM (double-nat) mode
the same performance drop from 25Mbit to 2Mbit Line Speed, similar to E3372h.
Reason: Thermal problems (reported via serial debug interface in ACM Mode)
after 2-3 minutes load.

Fix the root cause and bundle a working firmware is out of reach because
Huawei sells the same hardware, different (crippled) firmware versions
at different price points in different markets as strategy.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633

19 months agousb: add new scsi_huawei eject3 & eject4 driver support
Michael Paepcke [Fri, 16 Dec 2022 10:28:45 +0000 (10:28 +0000)]
usb: add new scsi_huawei eject3 & eject4 driver support

Add initialization for new Huawei 4G E3372_NCM, E3372v153_NCM,
E5573Cs322_NCM, E5573Cs322_ECM, and E5573Cs322_ACM.

Remove now-obsolete Huawei 3G E3131 init sequence. These devices are
obsolete, share IDs with new devices and the 3G networks are shutdown.
These old devices work correctly via the 4G code while still allowing
the shared IDs to work differently for the new devices.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633

19 months agousb: add new scsi_huawei eject3 & eject4 sequences
Michael Paepcke [Fri, 16 Dec 2022 10:21:14 +0000 (10:21 +0000)]
usb: add new scsi_huawei eject3 & eject4 sequences

Add new Huawei eject3 and eject4 command sequences.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633

19 months agousb: add new scsi_huawei eject3 & eject4 quirks
Michael Paepcke [Fri, 16 Dec 2022 10:12:17 +0000 (10:12 +0000)]
usb: add new scsi_huawei eject3 & eject4 quirks

Add new scsi_huawei eject3 & eject4 mode driver to usb quirks

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633

19 months agousb: Add Huawei 4G Modem devices (2022) to usbdevs
Michael Paepcke [Fri, 16 Dec 2022 10:05:10 +0000 (10:05 +0000)]
usb: Add Huawei 4G Modem devices (2022) to usbdevs

ADD [sys/dev/usb/usbdevs]
- add new Huawei 4G E3372_NCM  0x1505
- add new Huawei 4G E3372v153_NCM 0x155f
- add new Huawei 4G E5573Cs322_NCM 0x155e
- add new Huawei 4G E5573Cs322_ECM 0x14db
- add new Huawei 4G E5573Cs322_ACM 0x1442

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/633

19 months agoarm: mv: Add missing function prototype
Kornel Dulęba [Sat, 4 Feb 2023 18:30:33 +0000 (19:30 +0100)]
arm: mv: Add missing function prototype

This fixes armv7 kernel build with gcc12.

19 months agoarm: Add support for using VFP in kernel
Kornel Dulęba [Sat, 4 Feb 2023 12:59:30 +0000 (13:59 +0100)]
arm: Add support for using VFP in kernel

Add missing logic to allow in-kernel VFP usage for ARMv7 NEON.
The implementation is strongly based on arm64 code.
It introduces a family of fpu_kern_* functions to enable the usage
of VFP instructions in kernel.
Apart from that the existing armv7 VFP logic was modified,
taking into account that the state of the VFP registers can now
be modified in the kernel.

Co-developed by: Wojciech Macek <wma@FreeBSD.org>
Sponsored by: Stormshield
Obtained from: Semihalf
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D37419

19 months agotcp: Document TCP congestion control history
Tom Hukins [Tue, 31 Jan 2023 18:55:56 +0000 (18:55 +0000)]
tcp: Document TCP congestion control history

CUBIC replaced NEWRENO as the default congestion control algorithm in
bb1d472d79f718. Update man pages to reflect that.

Fixes: bb1d472d79f718
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/641

19 months agoStrip trailing slashes from DESTDIR
Marius van Witzenburg [Sun, 10 Apr 2022 20:12:50 +0000 (22:12 +0200)]
Strip trailing slashes from DESTDIR

Solves duplicate slashes in paths

Scanning //usr/share/certs/trusted for certificates...
Scanning //usr/local/share/certs for certificates...

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/595

19 months agojail: Correct jail_max_af_ips sysctl name
Elvin Aslanov [Mon, 11 Jul 2022 13:58:21 +0000 (17:58 +0400)]
jail: Correct jail_max_af_ips sysctl name

The sysctl is named "security.jail.jail_max_af_ips" with the jail_
prefix in the final part.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/605

19 months agoFIOSEEKHOLE/FIOSEEKDATA: correct consistency for bmap-based implementation
Konstantin Belousov [Sat, 4 Feb 2023 01:20:19 +0000 (03:20 +0200)]
FIOSEEKHOLE/FIOSEEKDATA: correct consistency for bmap-based implementation

Writes on UFS through a mapped region do not allocate disk blocks in
holes immediately. The blocks are allocated when the pages are paged out
first time.

This breaks the algorithm in vn_bmap_seekhole() and ufs_bmap_seekdata(),
because VOP_BMAP() reports hole for the place which already contains a
valid data.

Clean the pages before doing VOP_BMAP() in the affected functions.  In
principle, we could clean less by only requesting clean starting from
the offset, but it is probably not very important.

PR: 269261
Reported by: asomers
Reviewed by: asomers, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38379

19 months agocpuset: add --count
Mateusz Guzik [Sat, 4 Feb 2023 17:47:41 +0000 (17:47 +0000)]
cpuset: add --count

Can be used to count the number of hardware threads in the cpu set.

For example:
$ cpuset -g -p $$
pid 2440 mask: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39
pid 2440 domain policy: first-touch mask: 0, 1
$ cpuset -g --count -p $$
40

The intent is to replace calls to sysctl hw.ncpu and kern.smp.cpus which
can be found in the tree, which are not adequate given existence of
cpusets.

Right now only -g -p combination is supported to reduce complexity.
As anything else errors out, this can be expanded later as needed.

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

19 months agortwm: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
rtwm: purge EOL release compatibility

Remove FreeBSD 11 support

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agowmt: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
wmt: purge EOL release compatibility

Remove FreeBSD 11 support

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agovmm: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
vmm: purge EOL release compatibility

Remove FreeBSD 11 support

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agortsx: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
rtsx: purge EOL release compatibility

Remove support for FreeBSD 11 and earlier

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agomlx5: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
mlx5: purge EOL release compatibility

Remove FreeBSD 10 support code

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agomlx4: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
mlx4: purge EOL release compatibility

Remove FreeBSD 10 support code.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agohyperv: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
hyperv: purge EOL release compatibility

Remove FreeBSD 11 and earlier support

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agohptmv: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
hptmv: purge EOL release compatibility

Drop support for pre-FreeBSD 11

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agoacpica: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
acpica: purge EOL release compatibility

Remove obsolete check for FreeBSD >= 11

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agoqlnxr: cleanup secondary effects from EOL purge
Elliott Mitchell [Fri, 24 Jun 2022 23:26:18 +0000 (16:26 -0700)]
qlnxr: cleanup secondary effects from EOL purge

DEFINE_ALLOC_MR became unconditionally true, but it isn't used anywhere
now.  Several places depended upon DEFINE_IB_FAST_REG, but that is now
always false.
Similarly DEFINE_IB_UMEM_WITH_CHUNK became always false/undefined.
DEFINE_IB_AH_ATTR_WITH_DMAC is now unconditionally true.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agoqlnx: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
qlnx: purge EOL release compatibility

Drop code that supproted FreeBSD 10 and 11.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agoiavf: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
iavf: purge EOL release compatibility

Drop code that differentiated between FreeBSD 10 and 11

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agoixl: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
ixl: purge EOL release compatibility

Drop code that differentiated between FreeBSD 10 and 11.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agoqlxgbe: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
qlxgbe: purge EOL release compatibility

Drop code that differentiated between FreeBSD 10 and 11.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agoqlxge: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
qlxge: purge EOL release compatibility

Drop code ensuring FreeBSD 9 or newer

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agoqlxgb: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
qlxgb: purge EOL release compatibility

Remove code for FreeBSD 7, 8 & 9 and a warning that older versions
weren't supported.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agommc: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
mmc: purge EOL release compatibility

Remove support for FreeBSD 7 needed for a product that's not shipped
FreeBSD 7 in ~15 years....

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agoixgbe: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
ixgbe: purge EOL release compatibility

Remove support for pre FreeBSD 8.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agoe1000: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
e1000: purge EOL release compatibility

Remove support for releases before FreeBSD 8.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agomxge: cleanup from purging EOL release compatibility
Elliott Mitchell [Fri, 24 Jun 2022 23:16:47 +0000 (16:16 -0700)]
mxge: cleanup from purging EOL release compatibility

The FreeBSD version was being used to trigger preprocessor conditionals
IFNET_BUF_RING and MXGE_VIRT_JUMBOS.  Since those are no longer
conditional, purge their effects.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agomxge: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
mxge: purge EOL release compatibility

Remove FreeBSD 7, 8, 9 and 10 compatibility code.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agomrsas: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
mrsas: purge EOL release compatibility

Remove FreeBSD 7, 8, 9 and 10 compatibility code.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agompt: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
mpt: purge EOL release compatibility

Remove FreeBSD 7.x and earlier compatibility.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agousb: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
usb: purge EOL release compatibility

Remove conditionsals for FreeBSD 6, 7, 8 and 9 compatibility.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agonfsserver: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
nfsserver: purge EOL release compatibility

Remove now-obsolete FreeBSD 4.x and earlier ifdef.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agoaltq: purge EOL release compatibility
Elliott Mitchell [Thu, 23 Jun 2022 00:53:47 +0000 (17:53 -0700)]
altq: purge EOL release compatibility

Remove conditionals checking for End-of-Life releases, dating back to
3.0 in this case...

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560

19 months agoRefer to a related manpage
Tom Hukins [Fri, 3 Feb 2023 16:09:39 +0000 (16:09 +0000)]
Refer to a related manpage

Add reference to the lua jail man page.

Reviewed by: imp, Mina Galic
Pull Request: https://github.com/freebsd/freebsd-src/pull/642

19 months agoiwm(4), iwmfw(4): mention iwm7265Dfw
Piotr Kubaj [Sat, 4 Feb 2023 13:12:56 +0000 (14:12 +0100)]
iwm(4), iwmfw(4): mention iwm7265Dfw

Correct documentation by mentioning iwm7265Dfw.

PR: 234584
Differential review: https://reviews.freebsd.org/D38374
Approved by: erj

19 months agoRemove rt ethernet driver.
Justin Hibbits [Sat, 4 Feb 2023 01:21:20 +0000 (20:21 -0500)]
Remove rt ethernet driver.

dev/rt is used only in some MIPS SoCs, and MIPS is gone.

19 months agoloader.efi: include help.fdt for FDT-enabled loader
Mitchell Horne [Mon, 31 Oct 2022 14:19:08 +0000 (11:19 -0300)]
loader.efi: include help.fdt for FDT-enabled loader

19 months agoloader: always install help files
Mitchell Horne [Thu, 11 Feb 2021 14:29:00 +0000 (10:29 -0400)]
loader: always install help files

Address two issues with current help file logic:

The existing condition prevents the common help file from being
installed when there are no additional help files defined. This results
in no loader.help on EFI platforms, for example.

Second, due to the fact that we build and install multiple loader types,
each successive install will clobber the previous loader.help. The
result is that we could lose type-specific commands, or possibly list
them in loaders that do not have such commands.

Instead, give each loader type a uniquely named help file. The EFI
loader will look for /boot/loader.help.efi, userboot will look for
/boot/loader.help.userboot, etc. The interpreter variant has no effect
on which help file is loaded.

This leaves the old /boot/loader.help unused.

Some credit for the final approach goes to Mathieu <sigsys@gmail.com>
for their version of the fix in https://reviews.freebsd.org/D22951.

PR: 267134
Reported by: Daniel O'Connor <darius@dons.net.au>
Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28591

19 months agoinpcb: better document INP_ANONPORT flag
Gleb Smirnoff [Fri, 3 Feb 2023 19:33:36 +0000 (11:33 -0800)]
inpcb: better document INP_ANONPORT flag

The name is pretty self explaining, but it is unclear why we need this
flag, as kernel only sets it and never reads.

19 months agonetinet: don't return conflicting inpcb in in_pcbconnect_setup()
Gleb Smirnoff [Fri, 3 Feb 2023 19:33:36 +0000 (11:33 -0800)]
netinet: don't return conflicting inpcb in in_pcbconnect_setup()

Last time this inpcb was actually used was in tcp_connect()
before c94c54e4df9a.

19 months agotcp: bring comment for tcp_connect() up to date
Gleb Smirnoff [Fri, 3 Feb 2023 19:33:36 +0000 (11:33 -0800)]
tcp: bring comment for tcp_connect() up to date

We no longer use in_pcbbind() since 25102351509.  The comment about
truncating old TIME-WAIT describes a code that had been removed back
in 2004 in c94c54e4df9a.

19 months agoinpcb: use family specific sockaddr argument for connect functions
Gleb Smirnoff [Fri, 3 Feb 2023 19:33:36 +0000 (11:33 -0800)]
inpcb: use family specific sockaddr argument for connect functions

Do the cast from sockaddr to either IPv4 or IPv6 sockaddr in the
protocol's pr_connect method and from there on go down the call
stack with family specific argument.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D38356

19 months agonetinet6: require network epoch for in6_pcbconnect()
Gleb Smirnoff [Fri, 3 Feb 2023 19:33:36 +0000 (11:33 -0800)]
netinet6: require network epoch for in6_pcbconnect()

This removes recursive epoch entry in the syncache case.  Fixes
unprotected access to V_in6_ifaddrhead in in6_pcbladdr(), as
well as access to prison IP address lists. It also matches what
IPv4 in_pcbconnect() does.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D38355

19 months agoinpcb: merge two versions of in6_pcbconnect() into one
Gleb Smirnoff [Fri, 3 Feb 2023 19:33:35 +0000 (11:33 -0800)]
inpcb: merge two versions of in6_pcbconnect() into one

No functional change.

Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D38354

19 months agotcp: retire net.inet.tcp.tcp_require_unique_port
Gleb Smirnoff [Fri, 3 Feb 2023 19:33:35 +0000 (11:33 -0800)]
tcp: retire net.inet.tcp.tcp_require_unique_port

It was a safe belt just in case if the new port allocation
behaviour introduced in 25102351509 would cause a problem.

Reviewed by: markj, rscheff, tuexen
Differential revision: https://reviews.freebsd.org/D38353

19 months agopcb: Move an assignment into in_pcbdisconnect()
Mark Johnston [Fri, 3 Feb 2023 15:57:37 +0000 (10:57 -0500)]
pcb: Move an assignment into in_pcbdisconnect()

All callers of in_pcbdisconnect() clear the local address, so let's just
do that in the function itself.

Note that the inp's local address is not a parameter to the inp hash
functions.  No functional change intended.

Reviewed by: glebius
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D38362

19 months agoinpcb: Assert against wildcard addrs in in_pcblookup_hash_locked()
Mark Johnston [Fri, 3 Feb 2023 15:57:19 +0000 (10:57 -0500)]
inpcb: Assert against wildcard addrs in in_pcblookup_hash_locked()

No functional change intended.

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D38361

19 months agoinpcb: Deduplicate some assertions
Mark Johnston [Fri, 3 Feb 2023 15:56:26 +0000 (10:56 -0500)]
inpcb: Deduplicate some assertions

It makes more sense to check lookupflags in the function which actually
uses SMR.  No functional change intended.

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D38359

19 months agoshm: Document shm_create_largepage()
Mark Johnston [Fri, 3 Feb 2023 15:55:30 +0000 (10:55 -0500)]
shm: Document shm_create_largepage()

While here, move notes about FreeBSD-specific functionality to the
COMPATIBILITY section, and document the ECAPMODE error for shm_open().

Reviewed by: pauamma, kib
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38282

19 months agoman4: Add a manual page for kvmclock
Mark Johnston [Fri, 3 Feb 2023 15:54:50 +0000 (10:54 -0500)]
man4: Add a manual page for kvmclock

Reviewed by: pauamma, imp, kib
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38343

19 months agopvclock: Export a vDSO page even without rdtscp available
Mark Johnston [Fri, 3 Feb 2023 15:54:23 +0000 (10:54 -0500)]
pvclock: Export a vDSO page even without rdtscp available

When the cycle counter is "stable", i.e., synchronized across vCPUs by
the hypervisor, userspace can use a serialized rdtsc instead of relying
on rdtscp, just like the kernel timecounter does.  This can be useful
for performance in guests where the hypervisor hides rdtscp for some
reason.

To avoid breaking compatibility with older userspace which expects
rdtscp to be usable when pvclock exports timekeeping info, hide this
feature behind a sysctl.

Reviewed by: kib
Tested by: Shrikanth R Kamath <kshrikanth@juniper.net>
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38342

19 months agolibc: Fall back to rdtsc when using pvclock and rdtscp is not available
Mark Johnston [Fri, 3 Feb 2023 15:53:20 +0000 (10:53 -0500)]
libc: Fall back to rdtsc when using pvclock and rdtscp is not available

In preparation for a follow-up revision wherein kvmclock may export
timekeeping info to userspace even in the absence of AMDID_RDTSCP, fall
back to using rdtsc when rdtscp isn't available.  This mimics
pvclock_read_time_info() in the kernel.

Reviewed by: kib
Tested by: Shrikanth R Kamath <kshrikanth@juniper.net>
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38341

19 months agolinux(4): Microoptimize linux_ipc code to unindent else blocks.
Dmitry Chagin [Fri, 3 Feb 2023 16:17:34 +0000 (19:17 +0300)]
linux(4): Microoptimize linux_ipc code to unindent else blocks.

No functional change.

MFC after: 1 week

19 months agolinux(4): Use designated initializers.
Dmitry Chagin [Fri, 3 Feb 2023 16:17:15 +0000 (19:17 +0300)]
linux(4): Use designated initializers.

MFC after: 1 week

19 months agotest: Add fstab to all ufs images
Warner Losh [Fri, 3 Feb 2023 15:41:18 +0000 (08:41 -0700)]
test: Add fstab to all ufs images

Ensure that we populate /etc/fstab for all the ufs images.  Tweak sizes
while I'm at it.

Note: This file could use a good refactoring... or maybe a rewrite in
python or lua.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D38317

19 months agokboot: Keep track of what's used in the segment
Warner Losh [Fri, 3 Feb 2023 15:41:11 +0000 (08:41 -0700)]
kboot: Keep track of what's used in the segment

Keep track of how much is used in the segment as we allocate it to the
application. Set memsz to 0 first, and increment it as used. Adjust the
bufsz before we call kexec so the kernel copies the right amount (it's
an error for bufsz to be bigger than memsz, so we set them == when we
retrieve the segment). Make sure we round to the page size, otherwise
kexec_load gets cranky.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D38315

19 months agokboot: Allocate a really big first segment
Warner Losh [Fri, 3 Feb 2023 15:41:03 +0000 (08:41 -0700)]
kboot: Allocate a really big first segment

Allocate a huge segment for the first kexec_load segments. We limit the
lessor of:
allocation to the size of the remaining memory segment
45% of available memory
95% of the memory we can allocate

This allows us to have really large RAM disks. We likely need to limit
this to the amount we actually used, though, since this can be a lot of
memory.

We have to do this complicated calculation for a few reasons: First, we
need 2 copies of the loaded kernel in the memory: The kernel can copy
everything to a temporary buffer. Next, malloc (via mmap) is limited to
a certain amount due to over commit, so we have to not allocate all we
can (only most of what we can).

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D38314

19 months agokboot: Remove externs
Warner Losh [Fri, 3 Feb 2023 15:40:56 +0000 (08:40 -0700)]
kboot: Remove externs

kboot_get_phys_load_segment is defined in kboot.h, so remove them from
the .c files.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D38310

19 months agokboot: Try to read UEFI memory from physical memory on aarch64
Warner Losh [Fri, 3 Feb 2023 15:40:45 +0000 (08:40 -0700)]
kboot: Try to read UEFI memory from physical memory on aarch64

Try to open /dev/mem to read in the UEFI memory map. If we can't, then
we'll read it in the trampoline.

Retain reading in /proc/iomem to find reserved areas in Linux. We need
to know them for good places to put the kernel. These are not reflected
in the UEFI memory map. However, we should not adjust the UEFI memory
map since these reserved areas of the Linux kernel are free to be used
once we enter the kexec trampoline...

Sponsored by: Netflix
Reviewed by: tsoome, kevans, andrew
Differential Revision: https://reviews.freebsd.org/D38264

19 months agokboot: Enable for aarch64
Warner Losh [Fri, 3 Feb 2023 15:40:38 +0000 (08:40 -0700)]
kboot: Enable for aarch64

Enable building loader.kboot for aarch64/arm64.

Sponsored by: Netflix
Reviewed by: tsoome, kevans, andrew
Differential Revision: https://reviews.freebsd.org/D38262

19 months agokboot: Don't need an arch pointer to get segments
Warner Losh [Fri, 3 Feb 2023 15:40:30 +0000 (08:40 -0700)]
kboot: Don't need an arch pointer to get segments

There's no need for an arch pointer to get segments. We can call the
routine directly since we don't need this code to be called from
different context where a pointer is needed.

Sponsored by: Netflix
Reviewed by: kevans, andrew
Differential Revision: https://reviews.freebsd.org/D38266

19 months agokboot: MI fixups to enable aarch64 booting
Warner Losh [Fri, 3 Feb 2023 15:40:22 +0000 (08:40 -0700)]
kboot: MI fixups to enable aarch64 booting

A number of bug fixes to loading kernels and modules on aarch64 and amd64.
Fix offset calcuations.
Add a number of debugs, commented out for now (will GC them in the future)

With this, and the MD aarch64 commands, we can linux boot in qemu and on
real hardware.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38261

19 months agokboot: Improve amd64 booting
Warner Losh [Fri, 3 Feb 2023 15:40:13 +0000 (08:40 -0700)]
kboot: Improve amd64 booting

Copy more of the necessary state for FreeBSD to boot:
o Copy EFI memory tables
o Create custom page tables needed for the kernel to find itself
o Simplify the passing of args to the trampoline by putting them
  on the stack rather than in dedicated memory.

This is only partially successful... we get only part way through the
amd64 startup code before dying. However, it's much further than before
the changes.

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D38259

19 months agokboot: aarch64 trampoline implementation
Warner Losh [Fri, 3 Feb 2023 15:40:04 +0000 (08:40 -0700)]
kboot: aarch64 trampoline implementation

Update exec.c (copyied from efi/loader/arch/arm64/exec.c) to allow
execution of aarch64 kernels. This includes a new trampoline code that
handles copying the UEFI memory map, if available from the Linux FDT
provided PA. This is a complete implementation now, able to boot from
the LinuxBoot environment on an aarch64 server that only offers
LinuxBoot (though a workaround for the gicv3 inability to re-init is not
yet in FreeBSD). Many 'fit and finish' issues will be addressed in
subsequent commits.

Sponsored by: Netflix
Reviewed by: tsoome, kevans, andrew
Differential Revision: https://reviews.freebsd.org/D38258

19 months agostand: share bootinfo.c between EFI and KBOOT
Warner Losh [Fri, 3 Feb 2023 15:39:55 +0000 (08:39 -0700)]
stand: share bootinfo.c between EFI and KBOOT

Connect efi's bootinfo.c to the kboot build, and adjust to use
the kboot specific routines.

The getrootmount() call is independent of EFI. Remove ifdefs so it's
called for kboot too.

The differences between the kboot and efi bootinfo.c files are now tiny.
This could use some more refactoring, but this is a working checkpoint.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D38350

19 months agokboot: aarch64 bi_loadsmap
Warner Losh [Fri, 3 Feb 2023 15:39:46 +0000 (08:39 -0700)]
kboot: aarch64 bi_loadsmap

Since aarch64 is different, it needs a different smap. We first see if
we have the PA of the table from the FDT info. If so, we copy that and
quit. Otherwise, we do the best we can in translating the /proc/iomap
into EFI Memory Table format.

We also send the system table to the kernel.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38255

19 months agokboot: bi_loadsmap for amd64
Warner Losh [Fri, 3 Feb 2023 15:39:39 +0000 (08:39 -0700)]
kboot: bi_loadsmap for amd64

Copy the EFI memory tables we were able to get into the MODINFOMD_SMAP
metadata area for the kernel.

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D38254

19 months agokboot: Powerpc provide bi_loadsmap
Warner Losh [Fri, 3 Feb 2023 15:39:31 +0000 (08:39 -0700)]
kboot: Powerpc provide bi_loadsmap

It's just a stub, since the kernel learns of memory via FDT.

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D38253

19 months agokboot: Define bi_loadsmap for loading memory maps
Warner Losh [Fri, 3 Feb 2023 15:39:24 +0000 (08:39 -0700)]
kboot: Define bi_loadsmap for loading memory maps

Each architecture will soon be required to provide this to load memory
maps as metadata for the platforms that require it (or a stub function
for those that don't).

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D38252

19 months agokboot: Call enumerate_memory_arch()
Warner Losh [Fri, 3 Feb 2023 15:39:16 +0000 (08:39 -0700)]
kboot: Call enumerate_memory_arch()

Now that all architectures provide this, enumerate the platform's memory
before we go to interact(). This needs to be done only once, but relies
on our ability to open host: files on some platforms, so it needs to be
done after devinit().

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D38251

19 months agokboot: Update amd64 to use enumerate_memory_arch()
Warner Losh [Fri, 3 Feb 2023 15:39:06 +0000 (08:39 -0700)]
kboot: Update amd64 to use enumerate_memory_arch()

Move memory enumeration to the enumerate_memory_arch(), tweak the code a
bit to make that fit into that framework.

Also fix a bug in the name of the end location. The old code never found
memory (though amd64 doesn't yet work, this lead to using fallback
addresses that were good enough for QEMU...).

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38250

19 months agokboot: aarch64 memory enumeration enumerate_memory_arch()
Warner Losh [Fri, 3 Feb 2023 15:38:36 +0000 (08:38 -0700)]
kboot: aarch64 memory enumeration enumerate_memory_arch()

We have an odd situation with aarch64 memory enumeration. The fdt that
we can get has a PA of the UEFI memory map, as modified by the current
running Linux kernel so it can retain those pages it needs for EFI and
other services. We have to pass in this EFI tablem but don't have access
to it in the boot loader. We do in the trampoline code, so a forthcoming
commit will copy it there for the kernel to use. All for want of /dev/mem
in the target environment sometimes.

However, we also have to find a place to load the kernel, so we have to
fallback to /proc/iomem when we can't read the UEFI memory map directly
from /dev/mem. It will give us good enough results to do this task. This
table isn't quite suitable to be converted to the EFI table, so we use
both methods. We'll fall back to this method also if there's no EFI
table advertised in the fdt. There's no /sys file on aarch64 that has
this information, hence using the old-style /proc/iomem. We're unlikely
to work if there's no EFI, though.

Note: The underlying Linux mechanism is different than the amd64 method
which seems like it should be MI, but unimplemented on aarch64.

Sponsored by: Netflix
Discussed with: kevans
Differential Revision: https://reviews.freebsd.org/D38249

19 months agokboot: Add powerpc stub for enumerate_memory_arch()
Warner Losh [Fri, 3 Feb 2023 15:38:29 +0000 (08:38 -0700)]
kboot: Add powerpc stub for enumerate_memory_arch()

Add stub for new MI interface for enumerating memory. Right now powerpc
looks in the FDT table at a later point in boot since we don't need to
pass a specific memory table to the kernel. Leave it like that for now,
but note plans for the future.

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38248

19 months agokboot: space_avail -- how much space exists from 'start' to end of segment
Warner Losh [Fri, 3 Feb 2023 15:38:22 +0000 (08:38 -0700)]
kboot: space_avail -- how much space exists from 'start' to end of segment

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D38313

19 months agokboot: Add parsing of /proc/iomem into seg.c
Warner Losh [Fri, 3 Feb 2023 15:38:14 +0000 (08:38 -0700)]
kboot: Add parsing of /proc/iomem into seg.c

We'll be using this code for most / all of the platforms since iomem is
the only interface that can tell us of the reserved to the linux kernel
areas that we cannot place the new kernel into, but that we are free to
use once we hit trampoline. aarch64 will use this shortly, and similar
code in amd64 will be refactored when I make that platform work.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D38309

19 months agokboot: Create segment handling code at main level
Warner Losh [Fri, 3 Feb 2023 15:37:53 +0000 (08:37 -0700)]
kboot: Create segment handling code at main level

Create segment handling code up to the top level. Move it all into
seg.c, and make necessary adjustments for it being in a new file,
including inventing print_avail() and first_avail() to print the array
and find the first large enough memory hole.  aarch64 will use this,
and I'll refactor the other platforms to use it as I make them work.

Sponsored by: Netflix
Discussed with: kevans
Differential Revision: https://reviews.freebsd.org/D38308

19 months agokboot: MI part of the memory enumeration code
Warner Losh [Fri, 3 Feb 2023 15:37:45 +0000 (08:37 -0700)]
kboot: MI part of the memory enumeration code

enumerate_memory_arch is called once early in kboot's startup to allow
us to discover the memory layout, reserved areas, etc of the system
memory. Add the MI interface part of this.

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D38247

19 months agokboot: Add aarch64 fdt fixup
Warner Losh [Fri, 3 Feb 2023 15:37:39 +0000 (08:37 -0700)]
kboot: Add aarch64 fdt fixup

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D38256

19 months agokboot: Probe all disks and partitions for a kernel
Warner Losh [Fri, 3 Feb 2023 15:37:31 +0000 (08:37 -0700)]
kboot: Probe all disks and partitions for a kernel

Guess where to boot from when bootdev= isn't on the command line or
other config. Search all the disks and partitions for one that looks
like it could be a boot partition (same as we do when probing
zpools). Return the first one we find.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D38319

19 months agocp: Minor code cleanup.
Dag-Erling Smørgrav [Fri, 3 Feb 2023 15:37:24 +0000 (16:37 +0100)]
cp: Minor code cleanup.

* Fix includes in utils.c, cf. style(9).
* Fix type mismatch: readlink(2) returns ssize_t, not int.
* It is not necessary to set errno to 0 as fts_read(3) already does it.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D38369

19 months agoMechanically convert wg(4) to IfAPI
Justin Hibbits [Fri, 13 Jan 2023 16:22:11 +0000 (11:22 -0500)]
Mechanically convert wg(4) to IfAPI

Reviewed By: jhb
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38307

19 months agolinsysfs: Use IfAPI accessors
Justin Hibbits [Thu, 2 Feb 2023 21:43:56 +0000 (16:43 -0500)]
linsysfs: Use IfAPI accessors

Replace the only two ifnet member accesses with IfAPI accessor calls.

Sponsored by: Juniper Networks, Inc.

19 months agolinprocfs: Migrate to IfAPI
Justin Hibbits [Thu, 2 Feb 2023 21:48:22 +0000 (16:48 -0500)]
linprocfs: Migrate to IfAPI

Summary:
Migrate linprocfs to use the IfAPI interfaces instead of direct ifnet
accesses.

Reviewed by: dchagin
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38358

19 months agoIfAPI: Add iterator to loop over all interfaces
Justin Hibbits [Wed, 1 Feb 2023 21:28:11 +0000 (16:28 -0500)]
IfAPI: Add iterator to loop over all interfaces

Summary:
Sometimes it's useful to iterate over all interfaces in the current
VNET, as the linuxulator does in several places.

Unlike other iterators in the IfAPI this propagates any error received
up to the caller, instead of returning a count.

Sponsored by: Juniper Networks, Inc.
Reviewed by: glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D38348

19 months agoefiserialio: use port settings (sio->Mode) for initial setup
Toomas Soome [Thu, 2 Feb 2023 14:01:02 +0000 (16:01 +0200)]
efiserialio: use port settings (sio->Mode) for initial setup

Use serial port setup done by system firmware.
ARM64 Hyper-V does hung if we attempt to override the defaults,
therefore we should default to use settings from firmware.

Tested by: schakrabarti@microsoft.com
PR: 266248
MFC after: 1 week

19 months agopf tests: improve pfsync:basic_defer test
Kristof Provost [Fri, 3 Feb 2023 03:10:32 +0000 (04:10 +0100)]
pf tests: improve pfsync:basic_defer test

Create state on output only, to ensure we trigger the defer code.

MFC after: 2 weeks

19 months agopfsync: add missing bucket lock
Kristof Provost [Thu, 2 Feb 2023 09:34:57 +0000 (10:34 +0100)]
pfsync: add missing bucket lock

pfsync_q_ins() expects us to hold the bucket lock, but when we enter it
from pfsync_state_import() we don't.

MFC after: 2 weeks