Commit Graph

281391 Commits

Author SHA1 Message Date
Peter Holm
31a2528768 stress2: Add UFS+SU test scenario 2023-02-14 11:48:18 +01:00
Peter Holm
3f1f48f1d9 stress2: Add a regression test for D38549 2023-02-14 09:44:58 +01:00
Corvin Köhne
b11081dca7
bhyve: add emulation for qemu's fwcfg data port
The data port returns the data of the fwcfg item.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38333
2023-02-14 08:28:49 +01:00
Corvin Köhne
151d8131a8
bhyve: add emulation for the qemu fwcfg selector port
The selector port is used to select the desired fwcfg item.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38332
2023-02-14 08:28:43 +01:00
Corvin Köhne
9b99de77f1
bhyve: add basic qemu fwcfg implementation
qemu's fwcfg and bhyve's fwctl are both used to configure ovmf. qemu's
fwcfg is much more powerfull than bhyve's fwctl. For that reason, add
support for qemu's fwcfg.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38331
2023-02-14 08:28:37 +01:00
Corvin Köhne
fbd045021d
bhyve: maintain a list of acpi devices
The list is used to generate the dsdt entry for every acpi device.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D3830
2023-02-14 08:28:31 +01:00
Corvin Köhne
682a522d61
bhyve: add helper func to write a dsdt entry
The guest will check the dsdt to detect acpi devices. Therefore, add a
helper function to create such a dsdt entry for an acpi device.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38329
2023-02-14 08:28:27 +01:00
Corvin Köhne
13a1df5b85
bhyve: add helper func to add acpi resources
These helper function can be used to assign acpi resources to an
acpi_device.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38328
2023-02-14 08:28:21 +01:00
Corvin Köhne
1231f047c3
bhyve: add helper struct for acpi device handling
To simplify the handling of different acpi devices like qemu fwcfg or a
tpm, add a helper struct. It will handle the reporting of acpi
resources.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38327
2023-02-14 08:28:17 +01:00
Piotr Kubaj
8923de5905
ice(4): Update to 1.37.7-k
Notable changes include:

- DSCP QoS Support (leveraging support added in
  rG9c950139051298831ce19d01ea5fb33ec6ea7f89)
- Improved PFC handling and TC queue assignments (now all remaining
  queues are assigned to TC 0 when more than one TC is enabled and the
  number of available queues does not evenly divide between them)
- Support for dumping the internal FW state for additional debugging by
  Intel support
- Support for allowing "No FEC" to be a valid state for the LESM to
  negotiate when using non-standard compliant modules

Also includes various bug fixes and smaller enhancements, too.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	erj@
Tested by:	Jeff Pieper <jeffrey.pieper@intel.com>
MFC after:	3 days
Relnotes:	yes
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D38109
2023-02-13 17:29:44 -08:00
Konstantin Belousov
3a3450eda6 tmpfs_rename(): use tmpfs_access_locked instead of VOP_ACCESS()
Protect the call with the node lock. We cannot lock the fvp vnode
sleepable there, because we already own other participating vnode's
locks. Taking it without sleeping require unwinding the whole locking
state in one more place.

Note that the liveness of the node is guaranteed by the lock on the
parent directory vnode.

Reported and tested by:	pho
Fixes:	cbac1f3464956185cf95955344b6009e2cc3ae40ESC
Reviewed by:	markj, mjg
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38557
2023-02-14 01:16:38 +02:00
Konstantin Belousov
adc3506d56 Extract tmpfs-specific part of tmpfs_access() into a helper
The helper tmpfs_access_locked() requires either the vnode or node
locked for consistency of the access check, unlike the pure vnode op.

Reviewed by:	markj, mjg
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38557
2023-02-14 01:16:38 +02:00
Konstantin Belousov
889f074601 tmpfs_access(): style fixes and remove redundand assertions
Note that MPASS(VOP_ISLOCKED(vp)) is simply broken.

Reviewed by:	markj, mjg
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38557
2023-02-14 01:16:38 +02:00
Rick Macklem
9d329bbc9a nfsd: Continue adding macros so nfsd can run in a vnet prison
Commit 7344856e3a6d added a lot of macros that will front end
vnet macros so that nfsd(8) can run in vnet prison.
This patch adds some more of them and also a lot of uses of
nfsstatsv1_p instead of nfsstatsv1. nfsstatsv1_p points to
nfsstatsv1 for prison0, but will point to a malloc'd structure
for other prisons.

It also puts nfsstatsv1_p in nfscommon.ko instead of nfsd.ko.

MFC after:	3 months
2023-02-13 15:07:17 -08:00
Konstantin Belousov
0152d453a0 msdosfs deextend: validate pages of the partial buffer
Suppose that the cluster size is larger than page size. If the buffer
at the old EOF (before extending) was partial and dirty, it cannot be
automatically neither written out nor validated by the buffer cache,
since extending buffer adds invalid pages at the end.

Correct the buffer state by calling vfs_bio_clrbuf() on it, to mark
newly added and zeroed pages as valid.

Note that UFS is immune to the problem because ffs_truncate() always
allocate the block and buffer for the last byte of the file.

PR:	269341
Reported by:	asomers
In collaboration with:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38549
2023-02-14 00:29:42 +02:00
Konstantin Belousov
67dc1e7b04 msdosfs deextend(): memoize DETOV(dep)
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38549
2023-02-14 00:29:32 +02:00
Konstantin Belousov
e59180ea09 msdosfs: correct handling of vnode pager size on file extension error
If extension fails, vnode pager recorded size might be left increased.
Only update vnode pager when extension is past the point of no rollback.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38549
2023-02-14 00:29:19 +02:00
Konstantin Belousov
020e8a4d06 allocbuf(): convert direct panic() calls to KASSERT()s
Also do minor style adjustments.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38549
2023-02-14 00:28:42 +02:00
Mark Johnston
d099194818 vm_fault: Fix a race in vm_fault_soft_fast()
When vm_fault_soft_fast() creates a mapping, it release the VM map lock
before unbusying the top-level object.  Without the map lock, however,
nothing prevents the VM object from being deallocated while still busy.

Fix the problem by unbusying the object before releasing the VM map
lock.  If vm_fault_soft_fast() fails to create a mapping, the VM map
lock is not released, so those cases don't need to change.

Reported by:	syzkaller
Reviewed by:	kib (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D38527
2023-02-13 16:35:47 -05:00
Mark Johnston
c7ea65ec69 inpcb: refcount_release() returns a bool
No functional change intended.

MFC after:	1 week
Sponsored by:	Klara, Inc.
2023-02-13 16:35:47 -05:00
Mark Johnston
775da7f8a9 tcp: Remove a redundant net_epoch entry in tcp6_connect()
tcp6_connect() is always called in a net_epoch read section.

Fixes:		3d76be28ec ("netinet6: require network epoch for in6_pcbconnect()")
Reviewed by:	tuexen, glebius
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D38506
2023-02-13 16:35:47 -05:00
John Baldwin
18bb97b76b arm64 pmap: Fix a buffer overrun initializing per-superpage locks.
pmap_init_pv_table makes a first pass over the memory segments to
compute the amount of address space needed to allocate per-superpage
locks.  It then makes a second pass over each segment allocating
domain-local memory to back the pages for the locks belonging to each
segment.  This second pass rounds each segment's allocation up to a
page size since the domain-local allocation has to be a multiple of
pages.  However, the first pass was only doing a single round of the
total page counts up at the end not accounting for the padding present
in each segment.  To fix, apply the rounding in each segment in the
first pass instead of just at the end.

While here, tidy the second pass a bit by trimming some
not-quite-right logic copied from amd64.  In particular, compute pages
directly at the start of the loop iteration to more closely match the
first loop.  Then, drop an always-false condition as 'end' was
computed as 'start + pages' where 'start == highest + 1'.  Thus, the
actual condition being tested was 'if (highest >= highest + 1 +
pages)'.  Finally, remove 'highest' entirely by keep the result of the
'pvd' increment in the existing loop.

Reported by:	CHERI (overflow)
Reviewed by:	markj
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38377
2023-02-13 13:19:03 -08:00
John Baldwin
3dfd18a769 Remove support for the base/* toolchain ports.
These ports have been removed so these knobs are no longer meaningful.

This reverts commit 608289394f.
This reverts commit 39eb07f172.

Reviewed by:	imp, bapt, emaste
Differential Revision:	https://reviews.freebsd.org/D38562
2023-02-13 13:16:24 -08:00
Jean-Sébastien Pédron
a27902c183
linuxkpi: Define cpu_data(cpu)
`cpu_data(cpu)` evaluates to a `struct cpuinfo_x86` filled with
attributes of the given CPU number. The CPU number is an index in the
`__cpu_data[]` array with MAXCPU entries. On FreeBSD, we simply
initialize all of them like we do with `boot_cpu_data`.

While here, we add the `x86_model` field to the `struct cpuinfo_x86`. We
use `CPUID_TO_MODEL()` to set it.

At the same time, we fix the value of `x86` which should have been set
to the CPU family. It was using the same implementation as
`CPUID_TO_MODEL()` before. It now uses `CPUID_TO_FAMILY()`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38542
2023-02-13 22:09:32 +01:00
Jean-Sébastien Pédron
f3490083b7
linuxkpi: Add sg_alloc_table_from_pages_segment()
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38541
2023-02-13 22:09:32 +01:00
Jean-Sébastien Pédron
d91cf06020
linuxkpi: Add <linux/stdarg.h> + include it from <linux/string.h>
The <stdarg.h> header was moved in Linux 5.15.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38540
2023-02-13 22:09:32 +01:00
Jean-Sébastien Pédron
210e756d4b
linuxkpi: Define IRQ_NOTCONNECTED
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38539
2023-02-13 22:09:32 +01:00
Jean-Sébastien Pédron
b82bcfb66f
linuxkpi: Define lockdep_assert{,_once}()
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38538
2023-02-13 22:09:32 +01:00
Jean-Sébastien Pédron
54606590df
linuxkpi: Move definition of struct list_head to <linux/types.h>
This is the case on Linux.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38537
2023-02-13 22:09:31 +01:00
Jean-Sébastien Pédron
bf6f665081
linuxkpi: Define FIELD_FIT()
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38536
2023-02-13 22:09:31 +01:00
Jean-Sébastien Pédron
83276e1f95
linuxkpi: Add i2c_adapter_quirks support
While here, also declare `I2C_CLASS_HWMON`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38535
2023-02-13 22:09:31 +01:00
Jean-Sébastien Pédron
5542309ec6
linuxkpi: Define xa_is_err(), xa_{store,erase}_irq() and xa_{,un}lock_irq*()
`xa_is_err()` is synonymous to `IS_ERR()`.

Other introduced functions call their equivalent without the `irq*`
suffix.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38534
2023-02-13 22:09:31 +01:00
Jean-Sébastien Pédron
1c6d8146fd
linuxkpi: Update vga_client_register() and add vga_client_unregister()
For `vga_client_register()`, the API is modified twice in a row. To keep
the API compatible with all commits in the DRM driver, we introduce two
`LINUXKPI_VERSION` version bumps.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38533
2023-02-13 22:09:31 +01:00
Jean-Sébastien Pédron
cf54169086
linuxkpi: Declare missing DMI_* enum entries
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38532
2023-02-13 22:09:30 +01:00
Jean-Sébastien Pédron
a82a8a5e19
linuxkpi: Define backlight_get_brightness() and backlight_is_blank()
This is not used by the DRM driver yet because we comment out the code
calling them, but they are easy to implement.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38530
2023-02-13 22:09:26 +01:00
Warner Losh
1a1f7b7df7 zlib: Add proper NO_WSTRICT_PROTYPES too
Also move NO_WDEPRECATED_NON_PROTOTYPE to a better place...

Sponsored by:	Netflix
Noticed by:	jhb
Fixes:		b9f235ba31
2023-02-13 12:50:56 -07:00
Mateusz Guzik
5173c996bc psm: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-13 18:38:49 +00:00
Mateusz Guzik
937b00ac0d tcp: add missing void keyword to tcp_stats_init
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-13 18:38:04 +00:00
Mateusz Guzik
1842178ad3 xdr: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-13 18:37:31 +00:00
Mateusz Guzik
85d4483d5e ufs: ansify
Reviewed by:
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:
2023-02-13 18:35:54 +00:00
Mateusz Guzik
c492eb60b3 altq: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-13 18:32:45 +00:00
Mateusz Guzik
aa0b46948e speaker: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-13 18:28:09 +00:00
Mateusz Guzik
a066bba2da ntptime: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-13 18:24:13 +00:00
Mateusz Guzik
bbb6228eae vm: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-13 18:23:21 +00:00
Mateusz Guzik
00343b4adc uipc: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-13 18:20:29 +00:00
Mateusz Guzik
e4542107d8 sctp: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-13 18:17:10 +00:00
Mitchell Horne
a4532c4c5a intr_event(9): fixup Nm field 2023-02-13 14:08:12 -04:00
Mateusz Guzik
ec6b282218 ipfilter: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-02-13 18:05:57 +00:00
Mitchell Horne
afca197f52 ofwbus: only allow unit number zero
ofwbus has always been the root of attachment for OFW/FDT platforms. It
may have simplebus children, but we expect only one instance of the
ofwbus driver, added directly by nexus. We may as well ensure this
remains the case.

Reviewed by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D38493
2023-02-13 13:45:01 -04:00
Mitchell Horne
53d5e65eea ofwbus: remove arm64 ifdefs
Rather than using the DEVICE_IDENTIFY method, let's have other
ofwbus-using platforms add ofwbus0 explicitly in nexus, like arm64. This
gives them the same flexibility, e.g. if riscv starts supporting ACPI,
and cleans up the #ifdefs.

We were doing this already on riscv, but adjust the 'order' parameters.

Reviewed by:	andrew, jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D38492
2023-02-13 13:45:01 -04:00