Revert "fparseln: Update NetBSD version strings"
This reverts commit 1a968da448b0795184884ffe428fb24d7e695628.
I was mistakenly looking at the version strings in the CVS attic
but the function was moved to libc/stdio where it matches the
current string.
fparseln: Update NetBSD version strings
The correponding changes (mostly ANSIfication) were done long ago locally.
No functional change.
Obtained from: NetBSD (libutil CVS Attic)
Hyper-V: move memory alloc call for tlb hypercall out of smp_rendezvous
The allocation call could result in sleep lock violation if it is in
smp_rendezvous. Move it out. Also move the pcpu memory pointer to
vmbus_pcpu_data since it is only used on Hyper-V.
PR: 279738
Reported by: gbe
Fixes: 2b887687edc25bb4553f0d8a1183f454a85d413d
MFC after: 2 weeks
Sponsored by: Microsoft
linux: Translate Linux NVME ioctls to the lower layers.
The lower layers implement a ABI compatible Linux ioctl for a few of the
Linux IOCTLs. Translate them and pass them down. Since they are ABI
compatible, just use the nvme ioctl name.
Co-Authored-by: Warner Losh <imp at bsdimp.com>
Reviewed by: chuck
Differential Revision: https://reviews.freebsd.org/D45416
nvme: Add Linux copatible ioctls
Add the NVME_IOCTL_ID, NVME_IOCTL_ADMIN_CMD, and NVME_IOCTL_IO_CMD Linux
compatible ioctls. These may be run on either an I/O (ns) dev or a nvme
(admin) dev. Linux allows both on either device, and programs use this
and aren't careful about having the right device open. Emulate this
feature, and implement these ioctls. The data is passed in into the
kernel in host byte order (not converted to le). Results are returned in
host order.
The timeout field is ignore, and the metadata and metadata_len fields
must be zero.
The addr field can be null, even when the data_len is non zero (FreeBSD's
ioctl interface prohibits this, Linux's just ignores the inconsistency).
Only the cdw10 is returned from the command: the status is not returned
in 'result' field. XXX need to verify that this is what Linux does on an
error signaled from the drive.
[16 lines not shown]
vm_phys: Make sure that vm_phys_enq_chunk() stays in bounds
vm_phys_enq_chunk() inserts a run of pages into the buddy queues. When
lazy initialization is enabled, only the first page of each run is
initialized; vm_phys_enq_chunk() thus initializes the page following the
just-inserted run.
This fails to account for the possibility that the page following the
run doesn't belong to the segment. Handle that in vm_phys_enq_chunk().
Reported by: KASAN
Reported by: syzbot+1097ef4cee8dfb240e31 at syzkaller.appspotmail.com
Fixes: b16b4c22d2d1 ("vm_page: Implement lazy page initialization")
rc.subr: add some sanity checks for service jails
Add some sanity checks when service jails are used in jails:
- children.max > 0
- children.max - children.cur > 0
The nesting is too deep at those places to have a sane formatting, so no
line wrapping at the usual column.
If someone has a better idea how to format this: feel free to go ahead.
rc.subr: add new sysv option for service jails
Clarify that the "sysvipc" svcj option inherits from the host / parent.
Add "sysvipcnew" which creates a new SysV namespace for the service
jail.
Sanity check that only one of them is used.
riscv: improve commentary around initial stvec
Make it explicit why we must set the trap vector before enabling virtual
memory.
Reviewed by: br, jhb, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45474
riscv: adjust physmem reservation
Make sure we do this BEFORE pmap_bootstrap().
Reviewed by: markj, jhb
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45325
riscv: Don't handle missing kernel L3 pages
This code path should never be hit, if it does it means we did not
bootstrap correctly. Turn it into a panic like we do on amd64 and arm64.
Reviewed by: markj, jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45326
boot/efi: Fix warning for non-standard formats when debugging
Add -Wno-format for zfs_module and regroup. This fixes warnings when
EFI_DEBUG is defined.
PR: 279071
Reviewed-by: imp
sound: Include sound(4) channel information in sndstat nvlist
Extend SNDST_DSPS_PROVIDER_INFO for sound(4) to include information
about each channel in a given device, similar to how cat'ing
/dev/sndstat with hw.snd.verbose=2 works.
While here, document all provider_info fields.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D45501
(cherry picked from commit bbca3a75bb412f7106a569b82c616404103be084)
rk_pinctrl: fix error check
The parse_bias method returns a signed int, with a value of -1 when
the device tree reports nothing of the bias configuration. Convert the
local 'bias' from unsigned to signed to properly check this condition.
PR: 229721
Reviewed by: mhorne
MFC after: 3 days
tzsetup: ask local/UTC question only on x86
Storing local time in the RTC is a legacy of 1990s PCs; it's not
relevant on other platforms of interest to FreeBSD.
While here switch to C99 bool.
Sponsored by: The FreeBSD Foundation
Reviewed by: allanjude (earlier), imp (earlier)
Differential Revision: https://reviews.freebsd.org/D45575
libkern.h: Make more self-sufficient
libkern.h uses KASSERT, which fails when building in the boot
loader. This is hacked around in a number of other places, but it's
easier to just include sys/kassert.h here. Those other hacks still work,
but are no longer really needed and can be torn down over time.
Reviewed by: emaste
Sponsored by: Netflix
boot1.chrp: Include memset
Normally, memset isn't used. However for OPT_INIT_ALL=zero it is. Always
include it since we're not space constrained and latter-day loaders won't
include a copy if it's not actually used.
Reviewed by: emaste
Sponsored by: Netflix
udp_var: correct intoudpcb macro unintended identifier dependency
Change 483fe9651 embedded struct inpcb into struct udpcb and updated the
intoudpcb macro to use __containerof to locate it. This change accidentally
introduced a dependency on the identifier inp being defined in the block the
macro is expanded in. This should have been the macro argument ip. This change
makes this simple correction.
No functional change intended.
Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")
LinuxKPI: 802.11: make sure we can send DISASSOC or DEAUTH frames
The "Invalid TXQ" error from iwlwifi seems to be triggered by a
frame being sent for a sta which is no longer known to the driver/fw.
While we make sure to trigger the sending of the frame in net80211
early enough (by calling (*iv_newstate)() early on rather than at
the end), TX in LinuxKPI is run in a deferred task. When we drop the
net80211 ic lock again and re-acquire the LHW lock the packet may not
yet have made it to the driver.
Work around this between the (ic and lhw) locks by making sure
(a) no new packets get queued after we return from (*iv_newstate)(),
and (b) the TX task has run or gets cancelled and we manually push
any remaining packets out (or let lsta_free() clean them up).
The disabled packet queuing now also needs to be re-enabled in
scan_to_auth() in case an lsta is staying in service or gets re-used.
Also make sure that any following lkpi_wake_tx_queues() calls no
longer ignore queues which have not seen a prior dequeue.
[10 lines not shown]
LinuxKPI: 802.11: rename chanctx_conf for consistency
We used to call the struct ieee80211_chanctx_conf variable "conf"
in some places but that becomes confusing with bss_conf and other
"conf" bits. On the vif it is already called chanctx_conf thus also
rename it on the internal struct lkpi_chanctx and for our variables
in the implementation.
This should not have any external visibility.
No functional changes intended.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45185
(cherry picked from commit d1af434d99941d32a09c48fb3ef77ef83e203d29)
LinuxKPI: 802.11: remove unneeded re-lookup in lkpi_80211_txq_tx_one()
Given we are passed the lsta in as a function argument there is no
need to re-lookup the sta by ni and possibly not find it.
We know the sta and ni from the lsta and whether it is uploaded to
firmware or not we can check directly from the local lsta flag.
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43965
(cherry picked from commit ac867c20e67423e5019ab90148c387ea127eeffb)
LinuxKPI: 802.11: lock MO tx/wake_tx_queue() downcalls
Lock the two TX MO downcalls into driver/firmware in
lkpi_80211_txq_tx_one() to make sure they cannot happen in the
middle of other (net80211 triggered) updates calling down into
the driver/firmware.
Sponsored by: The FreeBSD Foundation (commit)
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43966
(cherry picked from commit 45bce6fa306fc3a211949f63c9bbb7932fe5a3bd)