Michal Prívozník wrote:
On 1/12/26 20:17, Roman Bogorodskiy wrote:
The "virt" board in QEMU has a "virtualization" option that is documented like this:
virtualization Set ``on``/``off`` to enable/disable emulating a guest CPU which implements the Arm Virtualization Extensions. The default is ``off``.
(from system/arm/virt.rst)
According to the documentation, the "virtualiaztion" option is related to the "gic-version" option. Specifically, gic version=4 requires virtualization to be enabled. And gic version=max will use version=4 when virtualization is enabled, and 3 when not. Libvirt does not currently model neither gic version "3" nor "max"
yes we do model GICv3 actually, but not 4.
Sorry, that was a typo, it should have been 'version "4" nor "max"'.
``gic`` Enable for architectures using a General Interrupt Controller instead of APIC in order to handle interrupts. For example, the 'aarch64' architecture uses ``gic`` instead of ``apic``. The optional attribute ``version`` specifies the GIC version; however, it may not be supported by all hypervisors. Accepted values are ``2``, ``3`` and ``host``. :since:`Since 1.2.16`
And there's this one funny comment in hw/arm/virt.c:
static VirtGICType finalize_gic_version_do(const char *accel_name, VirtGICType gic_version, int gics_supported, unsigned int max_cpus) { /* Convert host/max/nosel to GIC version number */ switch (gic_version) { case VIRT_GIC_VERSION_HOST: if (!kvm_enabled()) { error_report("gic-version=host requires KVM"); exit(1); }
/* For KVM, gic-version=host means gic-version=max */ return finalize_gic_version_do(accel_name, VIRT_GIC_VERSION_MAX, gics_supported, max_cpus);
though.
It is also documented for the "vexpress-a(9|15)" boards, where it is also disabled by default:
- QEMU defaults to providing a CPU which does not provide either TrustZone or the Virtualization Extensions: if you want these you must enable them with ``-machine secure=on`` and ``-machine virtualization=on``
(system/arm/vexpress.rst).
On the command line it looks like:
qemu-system-aarch64 -machine type=virt,virtualization=on ..
Model it using the "virtualization" element in the "features" section:
<features> <virtualization/> </features>
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> --- docs/formatdomain.rst | 4 ++ src/conf/domain_conf.c | 4 ++ src/conf/domain_conf.h | 1 + src/conf/schemas/domaincommon.rng | 5 +++ src/qemu/qemu_command.c | 9 ++++ src/qemu/qemu_validate.c | 1 + ...64-virt-virtualization.aarch64-latest.args | 38 ++++++++++++++++ ...h64-virt-virtualization.aarch64-latest.xml | 45 +++++++++++++++++++ .../aarch64-virt-virtualization.xml | 25 +++++++++++ tests/qemuxmlconftest.c | 2 + 10 files changed, 134 insertions(+) create mode 100644 tests/qemuxmlconfdata/aarch64-virt-virtualization.aarch64-latest.args create mode 100644 tests/qemuxmlconfdata/aarch64-virt-virtualization.aarch64-latest.xml create mode 100644 tests/qemuxmlconfdata/aarch64-virt-virtualization.xml
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Michal