Commit Graph
53156 Commits
Author SHA1 Message Date
Roman Bogorodskiy 238be79bb9 bhyve: auto-assign PCI addresses for hostdevs
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-08 10:28:00 +01:00
Alexander Shursha 43579767f4 bhyve: Tie the 'passthru' option to the 'hostdev' XML config
Signed-off-by: Alexander Shursha <kekek2@ya.ru>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-08 10:27:56 +01:00
Alexander Shursha 447252a54c bhyve: Advertise hostdev support
Signed-off-by: Alexander Shursha <kekek2@ya.ru>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-08 10:27:49 +01:00
Alexander ShurshaandRoman Bogorodskiy e4056c458a bhyve: Support passing the 'passthru' command line option
Bhyve supports PCI device passthrough using the following syntax:

  bhyve ... -s 4:0,passthru,5/2/0 ...

Where 5/2/0 is PCI address of the device in the host, and "4:0" is the
address in the guest.

Currently, user is responsible for reserving the device for passthrough,
i.e. by configuring pptdevs in loader.conf(5), or using devctl(8) to
detach the device.

Co-authored-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Signed-off-by: Alexander Shursha <kekek2@ya.ru>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-08 10:27:27 +01:00
Roman Bogorodskiy 4714272b39 bhyve: process: improve domain startup error handling
After executing the bhyve binary, it might happen that it fails very
early due to configuration issues (missing/inaccessible files, incorrect
custom args), bugs, etc. In this case it'll look like the domain has
started normally, but quickly turned off.

Improve that by waiting for the domain's vmm entity to appear in
/dev/vmm.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-08 09:14:37 +01:00
Jiri Denemark afafb2a28b cpu_map: Add YongFeng-v3 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark a6000b20ba cpu_map: Add YongFeng-v2 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 98b4609b51 cpu_map: Add YongFeng CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark db80641510 cpu_map: Add features used by Zhaoxin YongFeng Processor
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 56ee1bfb7a cpu_map: Add Zhaoxin CentaurHauls CPU vendor
Zhaoxin uses two distinct vendor IDs. This patch is adding one of them
used by Zhaoxin YongFeng Processor.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark ee95c9d7d1 cpu_map: Add EPYC-Turin CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark f37126bc55 cpu_map: Add EPYC-Milan-v3 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 0fcde0edc5 cpu_map: Add EPYC-v5 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark d2925f23e7 cpu_map: Add EPYC-Rome-v5 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 7e8f1698c7 cpu_map: Add EPYC-Genoa-v2 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark dec859cb66 cpu_map: Add ClearwaterForest CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark b8d830ff54 cpu_map: Add GraniteRapids-v3 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark cbc2f8e2b3 cpu_map: Add SapphireRapids-v4 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark bd43aa4cbb cpu_map: Add SierraForest-v3 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 64143828d7 cpu_map: Add SierraForest-v2 CPU model
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 189d7b64ac cputest: Add data for AMD Ryzen 9 9950X 16-Core CPU
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 034f02d25c cputest: Add data for Intel(R) Xeon(R) 6788P CPU
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark b7c92ce918 cputest: Read more MSRs in cpu-data.py
The features defined in our CPU map use quite a bit more than just the
two MSRs the script is currently trying to read. Let's read all of them
to get complete host CPU data.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark a3395fb598 cputest: Ignore missing MSRs in cpu-data.py
The current code made sense when we were reading only one MSR, but since
we started reading more MSRs, the host CPU would have to support all of
them otherwise the function would just return an empty dict.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 21c61bee36 sync_qemu_models_i386: Support adding models to an empty group
When adding a new CPU vendor, we create a new empty group in
src/cpu_map/index.xml and want to use the sync_qemu_models_i386.py
script to add models there.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark d3888c470a sync_qemu_models_i386: Handle unknown features in GraniteRapids-v2
The GraniteRapids-v2 uses quite a few CPU features unknown to this
script.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark b74b452f8a sync_qemu_models_i386: Print current model for unknown features
This way one can just grep for all warnings in the script output and
still be able to see for which CPU model is defined using features the
script doesn't know about.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 58972035bd sync_qemu_models_i386: Fix typo in CPUID_8000_0021_EAX_No_NESTED_DATA_BP
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 96df5805fd cpu_map: Fix ordering of CPU models in meson.build
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark a86973056a cpu_map: Add feature for detecting Indirect Target Selection immunity
QEMU commit 74978391b2da0116b9109d52931f342118d5a122

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:56 +01:00
Jiri Denemark 81c20d2c32 cpu_map: Add feature for detecting Branch History Injection immunity
QEMU commit b611931d4f70b9a3e49e39c405c63b3b5e9c0df1

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:55 +01:00
Jiri Denemark c80b283277 cpu_map: Add features for Transient Scheduler Attacks mitigation
QEMU commits d8ec0baf4a15082cdc4abe1de28face9a26f0dc9 and
c79a35acadee784610aed40134a12738381b4fba

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:55 +01:00
Jiri Denemark b72758d62a cpu_map: Add a few missing features to 0x80000021 CPUID leaf
QEMU commit dfd5b456108a75588ab094358ba5754787146d3d

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:55 +01:00
Jiri Denemark 819ce69b38 cpu_map: Add msr-imm CPU feature
QEMU commit 91084f3b44b1da4935eec85b79c1f97d1c140ada

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 15:54:55 +01:00
Ján Tomko a088734d57 scripts: do not use uninitialized variable
A previous commit removed the 'ret' variable when
switching to subprocess.run, but did not adjust
the exit code.

Fixes: 15c9ca383c
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2025-11-07 15:44:09 +01:00
Daniel P. Berrangé 1ff3d18528 tools/nss: check for missing array element
We've already checked the upper bound of the array, but we should
none the less sanity check that the requested array element is
not NULL before dereferencing it.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-07 11:58:35 +00:00
Daniel P. Berrangé f1e59f961d src: check for invalid stream in virStreamInData
All methods must use virCheckStreamReturn to validate their
'stream' parameter.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-07 11:58:30 +00:00
Daniel P. Berrangé 15c9ca383c scripts: use subprocess.run instead of os.system
The subprocess.run command avoids using the shell and so is robust
should sys.argv contain any whitespace or unexpected shell meta
characters.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-07 11:58:26 +00:00
Praveen K Paladugu 7db2138dc9 qemu: Use query-accelerators to query accelerators
Use the `query-accelerators` command to generically query the enabled
acclerator. Below is an example invocation in Qemu:

  { "execute": "query-accelerators"}
  "return": {"enabled": "kvm", "present": ["kvm", "mshv", "qtest", "tcg", "xen"]}}

"enabled" here indicates "kvm" is the enabled accelertor.

If query-accelerators command is not available, fallback to existing
mechnisms for querying kvm and hvf capabilities.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 12:19:03 +01:00
Praveen K Paladugu 4c266d53e8 qemu: Introduce query-accelerators cap
Introduce query-accelerators capability which is a generic way to query
the accelerators supported by qemu.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-07 12:15:02 +01:00
Daniel P. Berrangé 878470256e src: report error from failing to add timer/FD watches
The virEventAddHandle/Timeout APIs are unusual in that they do not
report errors on failure, because they call through to function
callbacks which might be provided externally to libvirt and thus
won't be using libvirt's error reporting APIs.

This is a rather unfortunate design characteristic as we can see
most callers forgot about this special behaviour and so we are
lacking error reporting in many cases.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2025-11-06 12:04:48 +00:00
Peter Krempa 9b7ef8058b conf: Don't leak virDomainDiskDef's 'statistics' member
In commit 19fc614d53 I've added an option to configure statistics but
forgot to free it once the disk definition struct is freed.

Fixes: 19fc614d53
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2025-11-05 16:03:13 +01:00
Peter Krempa 7ee9dbacbe qemu: Add support for enabling timed block device statistics collection
Add validation that qemu supports the collection of statistics and
enable it on the block device commandline.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa 19fc614d53 conf: Add configuration option for timed disk statistics collection
QEMU supports collection of disk statistics in configurable time
windows. Add support for enabling this feature to the conf parser.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa 1c4234b34e qemu: capabilities: Introduce QEMU_CAPS_DISK_TIMED_STATS
The capability tracks support for 'stats-intervals' property of disk
frontends which enables statistics collection on the devices.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa 166be0d48c Expose qemu timed block statistics via bulk stats API
The statistics show various disk access timing parameters collected in
configurable interval which can be useful for performance
investigations.

Note that the statistic collection needs to be enabled explicitly for
the statistics to be collected and displayed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa 6914b4f2a5 qemu_monitor: Extract 'timed_stats' of block devices
The 'timed_stats' block is a set of statistics gathered in configurable
time intervals. The stats include latency timings of reads/writes as
well as the depth of the request queues.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa d1eafbe88b Expose qemu storage request limits via bulk stats API
Management applications can use the detected limits to cross reference
with configuration within the VM to ensure optimal performance.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa c33e5971b1 qemu: monitor: Extract block limit values
The 'limits' field reports various maximum request sizes and
alignments for a qemu blockdev protocol node.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2025-11-05 14:27:57 +01:00
Peter Krempa c177003d4d qemucapabilitiestest: qemucapabilitiestest: Update 'caps_10.2.0_x86_64' to 'v10.1.0-1969-g53b41bb789'
Notable changes:
 - deprecated 'reconnect' option removed from socket chardevs
 - 'query-accelerators' QMP command added
 - 'query-firmware-log' QMP command added
 - block image limits exposed via QMP
 - timed block statistics collection config is now available via -device
 - 'audio-backend' QOM object type added
 - 'mshv-accel' QOM object type added
 - 'tsa-l1-no', 'tsa-sq-no', 'verw-clear' cpu properties added
 - SCLP_CPI_INFO_AVAILABLE event addedt

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2025-11-05 14:25:46 +01:00