Commit Graph

279616 Commits

Author SHA1 Message Date
John Baldwin
73abae4493 vmm vmx: Add a global bool to indicate if the host has the TSC_AUX MSR.
A future commit will remove direct access to vCPU structures from
struct vmx, so add a dedicated boolean for this rather than checking
the capabilities for vCPU 0.

Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D37269
2022-11-18 10:25:35 -08:00
John Baldwin
39ec056e6d vmm: Rework snapshotting of CPU-specific per-vCPU data.
Previously some per-vCPU state was saved in vmmops_snapshot and other
state was saved in vmmops_vcmx_snapshot.  Consolidate all per-vCPU
state into the latter routine and rename the hook to the more generic
'vcpu_snapshot'.  Note that the CPU-independent per-vCPU data is still
stored in a separate blob as well as the per-vCPU local APIC data.

Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D37150
2022-11-18 10:25:35 -08:00
John Baldwin
19b9dd2e08 vmm svm: Mark all VMCB state caches dirty on vCPU restore.
Mark Johnston noticed that this was missing VMCB_CACHE_LBR.  Just set
all the bits as is done in svm_run() rather than trying to clear
individual bits.

Reported by:	markj
Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D37259
2022-11-18 10:25:35 -08:00
John Baldwin
0f00260c67 vmm vmx: Refactor per-vCPU data.
Add a struct vmx_vcpu to hold per-vCPU data specific to VT-x and
move parallel arrays out of struct vmx into a single array of
this structure.

While here, dynamically allocate the VMCS, APIC page and PIR
descriptors for each vCPU rather than embedding them.

Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D37149
2022-11-18 10:25:35 -08:00
John Baldwin
215d2fd53f vmm svm: Refactor per-vCPU data.
- Allocate VMCBs separately to avoid excessive padding in struct
  svm_vcpu.

- Allocate APIC pages dynamically directly in struct vlapic.

- Move vm_mtrr into struct svm_vcpu rather than using a separate
  parallel array.

Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D37148
2022-11-18 10:25:35 -08:00
John Baldwin
35abc6c238 vmm: Use vm_get_maxcpus() instead of VM_MAXCPU in various places.
Mostly these are loops that iterate over all possible vCPU IDs for a
specific virtual machine.

Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D37147
2022-11-18 10:25:34 -08:00
John Baldwin
a7db532e3a vmm: Simplify saving of absolute TSC values in snapshots.
Read the current "now" TSC value and use it to compute absolute time
saved value in vm_snapshot_vcpus rather than iterating over vCPUs
multiple times in vm_snapshot_vm.

Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D37146
2022-11-18 10:25:34 -08:00
Ed Maste
1e9c9ab595 pkgbase: do not record dependency on non-existent liby package
liby-dev provides (only) liby.a.  liby has no headers or man pages, and
there is no liby package.  Add a special case to record no dependency on
the package that does not exist.

PR:		266923
Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37429
2022-11-18 13:08:46 -05:00
Warner Losh
8a744de27e stand: Remove i386-only support fire firewire
Remove support for booting off of firewire, and for having dcons via
firewire in the loader. Kernel support for these things is unchanged.
Discussed on arch@ and the current state is not working (and the build
was wrong to boot).

Sponsored by:		Netflix
Discussed:		https://lists.freebsd.org/archives/freebsd-arch/2022-November/000267.html
Reviewed by:		kevans, melifaro, emaste
Differential Revision:	https://reviews.freebsd.org/D37334
2022-11-18 10:43:59 -07:00
Warner Losh
1a1fd76d0a arm64/pmap: freed only used for PV_STATS
When PV_STATS is defined, freed is used. Otherwise it isn't. Mark it as
__pvused and define __pvused appropriately.

Sponsored by:		Netflix
Reviewed by:		tsoome, rpokala, andrew
Differential Revision:	https://reviews.freebsd.org/D37438
2022-11-18 10:04:04 -07:00
Dag-Erling Smørgrav
cf325fda86 tftpd: type nit
Sponsored by:	Klara, Inc.
2022-11-18 17:26:54 +01:00
Dag-Erling Smørgrav
b9fabe997f tftp: cleanup
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37433
2022-11-18 17:01:30 +01:00
Dag-Erling Smørgrav
b15e052e74 tftpd: Plug memory leaks in option handling code.
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37423
2022-11-18 16:39:44 +01:00
Konstantin Belousov
ae507c25de amd64 libc: add missed GNU-stack annotation to memmove/memcpy
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2022-11-18 15:31:38 +02:00
Xin LI
dc58b3fca5 MFV: expat 2.5.0
MFC after:	2 weeks
2022-11-17 22:15:00 -08:00
Xin LI
9fc8132eca Vendor import of expat 2.5.0 2022-11-17 22:08:44 -08:00
Xin LI
cd3a777bca MFV: xz-embedded 3f438e15109229bb14ab45f285f4bff5412a9542
MFC after:	2 weeks
2022-11-17 22:04:57 -08:00
Kirk McKusick
8435a9b206 Updates to UFS/FFS superblock integrity checks when reading a superblock.
Further updates adding casts to avoid 32-bit multiplication overflow
inspired by fixes in commit 017367c114.

No legitimate superblocks should fail as a result of these changes.

Sponsored by: The FreeBSD Foundation
2022-11-17 14:51:15 -08:00
Vladimir Kondratyev
4a0db5e292 evdev: Extend EVIOCGRAB ioctl scope to cover sysmouse interface
of psm(4), ums(4) and sysmouse(4) drivers.
EVIOCGRAB ioctl execution on /dev/input/event# device node gains
exclusive access to this device to caller. It is used mostly for
development purposes and remote control software. See e.g.
https://reviews.freebsd.org/D30020 which is the reason of creation
of this change.

MFC after:	2 weeks
Tested by:	corvink
Differential revision:	https://reviews.freebsd.org/D30542
2022-11-18 00:48:42 +03:00
Cy Schubert
f556a05c49 heimdal: Fix: Too large time skew, client time 1970-01-01T01:00:00
Part of ed549cb0c5 zeroed out a data structure in the resulting code-file
when a TUTCTime type was freed. This part of the patch applies to Heimdal
7.1+ and not our Heimdal 1.5.2.

PR:		267827
Reported by:	Peter Much <pmc@citylink.dinoex.sub.org>
Tested by:	Peter Much <pmc@citylink.dinoex.sub.org>
Fixes:		ed549cb0c5
MFC after:	TBD with philip@
2022-11-17 09:29:17 -08:00
Andrew Turner
c15085278c arm64 pmap: implement per-superpage locks
As with amd64 pmap introduce per-superpage locks backed by pages
allocated by their respective domains.

This significiantly reduces lock contantion from pmap when running
poudriere on a 160 core Ampere Altra server

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36310
2022-11-17 17:12:40 +00:00
Eric van Gyzen
a134a12b14 Mark the debug.vnlru_nowhere sysctl as CTLFLAG_STATS
The kernel doesn't read it.  It's only writable so it can be cleared.

Sponsored by:	Dell EMC Isilon
2022-11-17 10:44:58 -06:00
Dag-Erling Smørgrav
bacb00ab40 tftpd: whitespace cleanup 2022-11-17 16:42:30 +00:00
Dag-Erling Smørgrav
9f9544fd92 tftp: Fix buffer overflow and fd leak in multi-file PUT.
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37422
2022-11-17 17:26:24 +01:00
Gleb Smirnoff
bc5708c0e2 counter: fix SYSCTL_COUNTER_U64_ARRAY type
There is nothing wrong with declaring an array as CTLTYPE_U64.  Note
that sysctl(8) is able to print such arrays and doesn't need any change.

Fixes:	b5b7b142a7
2022-11-17 08:16:14 -08:00
Dag-Erling Smørgrav
f1ad5e3931 libarchive: Add missing MLINK.
Differential Revision: https://reviews.freebsd.org/D37398
2022-11-17 17:12:24 +01:00
Ed Maste
b751fc75bb pkgbase: report type for duplicated METALOG entries
Duplicate METALOG file entries are more of a concern than duplicate
directories.  The metalog check tool previously did not include the
entry type in the warnings, making it hard to find the ones of concern.

Sponsored by:	The FreeBSD Foundation
2022-11-17 10:28:06 -05:00
Ed Maste
b812132455 man9: add vm_map_unwire link
Reported by:	markj (in D37416)
Sponsored by:	The FreeBSD Foundation
2022-11-17 10:17:52 -05:00
Ed Maste
aa42e94678 ObsoleteFiles: correct path to removed rc.sendmail man page
Fixes:		820b62d941 ("ObsoleteFiles: the rc.sendmail(8)...")
2022-11-17 10:12:58 -05:00
Ed Maste
005609adda man9: correct vm_page_wire.9 links
PR:		244596
Reviewed by:	markj
Fixes:		fee2a2fa39 ("Change synchonization rules for ...")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37416
2022-11-17 10:08:36 -05:00
Ed Maste
bca4d27052 pkgbase: examine METALOG files relative to stage root directory
Previously we stripped the '.' from the beginning of each METALOG entry
to determine the path to stat.  This meant that we examined files on the
build host, not the staged files.

Instead, strip off the last part of the specified METALOG pathname to
find the stage root directory, and stat files relative to that.

Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37412
2022-11-17 08:52:12 -05:00
Xin LI
9e6bbe47a5 MFV: Merge xz 5.2.8
Relnotes:	yes
MFC after:      2 weeks
2022-11-16 20:37:07 -08:00
Rick Macklem
4ee16246f9 vfs_vnops.c: Fix blksize for ZFS
Since ZFS reports _PC_MIN_HOLE_SIZE as 512 (although it
appears that an unwritten region must be at least f_iosize
to remain unallocated), vn_generic_copy_file_range()
uses 4096 for the copy blksize for ZFS, reulting in slow copies.

For most other file systems, _PC_MIN_HOLE_SIZE and f_iosize
are the same value, so this patch modifies the code to
use f_iosize for most cases.  It also documents in comments
why the blksize is being set a certain way, so that the code
does not appear to be doing "magic math".

Reported by:	allanjude
Reviewed by:	allanjude, asomers
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D37076
2022-11-16 17:37:22 -08:00
Martin Matuska
5d42ef55de zfs: workaround panic on rootfs mount
The import of OpenZFS PR 13758 causes a panic in zfsctl_is_node()
if ZFS is mounting as root filesystem. This implements a workaround
until the issue is resolved by authors.
2022-11-17 02:01:47 +01:00
Ed Maste
42af87b83b man9: remove duplicate superio_find_dev link
PR:		244596
Fixes:		c812bea351 ("add superio.4 and superio.9 ...")
Sponsored by:	The FreeBSD Foundation
2022-11-16 19:30:23 -05:00
Ed Maste
227f47ce0c libcompat: avoid installing include files twice
Previously some headers were getting installed twice, once as expected
and then a second time as part of the compat32 library stage.

Makefile.libcompat sets -DLIBRARIES_ONLY for the install make invocation
which causes bsd.lib.mk to skip headers.  However some headers are
handled via bsd.prog.mk, which does not use LIBRARIES_ONLY.  Explicitly
set MK_INCLUDES=no.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37413
2022-11-16 19:15:20 -05:00
Martin Matuska
9198651515 zfs: unbreak 32-bit world build broken in dbd5678dc 2022-11-17 00:33:26 +01:00
Martin Matuska
dbd5678dca zfs: merge openzfs/zfs@2163cde45
Notable upstream pull request merges:
  #13680 Add options to zfs redundant_metadata property
  #13758 Allow mounting snapshots in .zfs/snapshot as a regular user
  #13838 quota: disable quota check for ZVOL
  #13839 quota: extend quota for dataset
  #13973 Fix memory leaks in dmu_send()/dmu_send_obj()
  #13977 Avoid unnecessary metaslab_check_free calling
  #13978 PAM: Fix unchecked return value from zfs_key_config_load()
  #13979 Handle possible null pointers from malloc/strdup/strndup()
  #13997 zstream: allow decompress to fix metadata for uncompressed
         records
  #13998 zvol_wait logic may terminate prematurely
  #14001 FreeBSD: Fix a pair of bugs in zfs_fhtovp()
  #14003 Stop ganging due to past vdev write errors
  #14039 Optimize microzaps
  #14050 Fix draid2+2s metadata error on simultaneous 2 drive failures
  #14062 zed: Avoid core dump if wholedisk property does not exist
  #14077 Propagate extent_bytes change to autotrim thread
  #14079 FreeBSD: vn_flush_cached_data: observe vnode locking contract
  #14093 Fix ARC target collapse when zfs_arc_meta_limit_percent=100
  #14106 Add ability to recompress send streams with new compression
         algorithm
  #14119 Deny receiving into encrypted datasets if the keys are not
         loaded
  #14120 Fix arc_p aggressive increase
  #14129 zed: Prevent special vdev to be replaced by hot spare
  #14133 Expose zfs_vdev_open_timeout_ms as a tunable
  #14135 FreeBSD: Fix out of bounds read in zfs_ioctl_ozfs_to_legacy()
  #14152 Adds the `-p` option to `zfs holds`
  #14161 Handle and detect #13709's unlock regression

Obtained from:	OpenZFS
OpenZFS commit:	2163cde450
2022-11-16 21:27:42 +01:00
Dapeng Gao
61b146ba43 Check alignment of fp in unwind_frame
A misaligned frame pointer is certainly not a valid frame pointer and
with strict alignment enabled (as on CHERI) can cause panics when it is
loaded from later in the code.

This is a recommit of 40e0fa10f5 with
is_aligned() corrected to __is_aligned().

Reviewed By:	jhb
Differential Revision: https://reviews.freebsd.org/D34646
2022-11-16 18:29:28 +00:00
Ed Maste
07853c6c9d regen src.conf.5 after MK_CXX and arm64 Hyper-V changes
Reported by:	matteo
2022-11-16 11:37:42 -05:00
Corvin Köhne
b922cf4fe3
bhyve: build DSDT table by basl
Building the DSDT table by basl will allow it to be loaded by qemu's
ACPI table loader.

Building the DSDT is complex and basl doesn't support it yet. For that
reason, it's still compiled by iasl. It's just a bit restructured.
Upcoming commits will restructure the builds of all other ACPI tables in
a similar way. So, this commit is done for consistency reasons. We're
starting with DSDT because it doesn't point to any other tables and it's
the last one in our current build list.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36993
2022-11-16 12:43:41 +01:00
Corvin Köhne
2fb0f352b9
bhyve: add basl support for common table header
Most ACPI tables are using the same header. Make it easy to create this
header by creating a function for it.

Reviewed by:		jhb, markj (older version)
Approved by:		manu (mentor)
MFC after:		2 weeks
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D36992
2022-11-16 12:42:19 +01:00
Emmanuel Vadot
0860c27fe8 usb/dwc3: Use more () for macros variables
Suggested by:	andrew
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-16 11:58:32 +01:00
Emmanuel Vadot
67c76a1ba7 arm64/rockchip: Remove rk3328-dwc3 overlays
Not needed after
3c790abfba67 arm64/rk_dwc3: Remove RK3328 support
c45296f16f79 dwc3: Handle optional clocks

Differential Revision:	https://reviews.freebsd.org/D37395
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-16 11:58:32 +01:00
Emmanuel Vadot
d47f5f2886 usb/dwc3: Only force USB2 based on the PHY register and IP version
We shouldn't force USB2 only based on if we have an external PHY.
The internal PHY register tell us what link speed we can acheive
and we need to force USB2 only if it cannot do USB3.
This is only available after revision 0x290A of the dwc3 IP.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D37394
Fixed:	1331c0f44b ("Add support for RockChip RK356X to DWC3 driver.")
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-16 11:58:32 +01:00
Emmanuel Vadot
0e87f58bd7 usb/dwc3: Read the full IDs/version
We need to enable some quirks based on the version so read it.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D37393
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-16 11:58:31 +01:00
Emmanuel Vadot
dbd7bb7c89 arm64/rk_dwc3: Remove RK3328 support
The RK3328 dts doesn't have the glue node so we need the dwc3 driver
to attach directly.

Differential Revision:	https://reviews.freebsd.org/D37396
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-16 11:58:31 +01:00
Emmanuel Vadot
0a5f342aa5 dwc3: Handle optional clocks
Usually dwc3 needs a glue node that contain the SoC specific clocks/resets.
For some reason the RK3328 DTS doesn't have this glue node and the clocks
are specified in the dwc3 node directly.
The bindings says that it is allowed but doesn't specified some strict names
for them.
Add a specific case for RK3328 based on the compatible string.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D37392
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-11-16 11:58:31 +01:00
Michael Tuexen
bd4f986644 tcp: remove unused t_rttbest
No functional change intended.

Reviewed by:		rscheff@
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D37401
2022-11-16 11:22:13 +01:00
Xin LI
bbf0e6b900 Vendor import of xz-5.2.8 (trimmed). 2022-11-15 21:53:08 -08:00