[PATCH v2 0/3] conf,qemu: add AIA support for RISC-V 'virt'

Hi, This new version has improvements suggested by Martin in v1. Most notably we're now doing a proper handling of 'aia=none' by adding a 'default' value that is internal only. Changes from v1: - patch 2: - changed libvirt version to 11.1.0 in 'aia' docs in formatdomain.rst - added a new internal only VIR_DOMAIN_AIA_DEFAULT value in domain_conf.h - virDomainDefFormatFeatures: skip if VIR_DOMAIN_AIA_DEFAULT instead of VIR_DOMAIN_AIA_NONE - patch 3: - skip cmd line appending if VIR_DOMAIN_AIA_DEFAULT instead of VIR_DOMAIN_AIA_NONE - changed riscv64-virt-features-aia.xml to use 'aia=none' to verify the intended behavior - v1 link: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/YUYYW... Daniel Henrique Barboza (3): qemu: add capability for RISC-V AIA feature conf,qemu: implement RISC-V 'aia' virt domain feature qemu: add RISC-V 'aia' command line docs/formatdomain.rst | 8 ++++ src/conf/domain_conf.c | 40 +++++++++++++++++++ src/conf/domain_conf.h | 12 ++++++ src/conf/schemas/domaincommon.rng | 15 +++++++ src/libvirt_private.syms | 2 + src/qemu/qemu_capabilities.c | 2 + src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 5 +++ src/qemu/qemu_validate.c | 15 +++++++ .../caps_8.0.0_riscv64.xml | 1 + .../caps_9.1.0_riscv64.xml | 1 + ...cv64-virt-features-aia.riscv64-latest.args | 31 ++++++++++++++ ...scv64-virt-features-aia.riscv64-latest.xml | 1 + .../riscv64-virt-features-aia.xml | 27 +++++++++++++ tests/qemuxmlconftest.c | 2 + 15 files changed, 163 insertions(+) create mode 100644 tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.args create mode 120000 tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.xml create mode 100644 tests/qemuxmlconfdata/riscv64-virt-features-aia.xml -- 2.48.1

At this moment it is not possible to launch a 'riscv64' domain if a CPU definition is presented in the domain. For example, adding this CPU definition: <cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>rv64</model> </cpu> Will trigger the following error: $ sudo ./run tools/virsh start riscv-virt1 error: Failed to start domain 'riscv-virt1' error: this function is not supported by the connection driver: cannot update guest CPU for riscv64 architecture The error comes from virCPUUpdate(), via qemuProcessUpdateGuestCPU(), and it's caused by the absence of the 'update' API in the existing RISC-V driver. Add an 'update' API impl to the RISC-V driver to allow for CPU definitions to be declared in RISC-V domains. This API was copied from the ARM driver (virCPUarmUpdate()) since it's a good enough implementation to get us going. Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> --- po/POTFILES | 1 + src/cpu/cpu_riscv64.c | 28 +++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/po/POTFILES b/po/POTFILES index b122f02818..5d6ec195b4 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -70,6 +70,7 @@ src/cpu/cpu.c src/cpu/cpu_arm.c src/cpu/cpu_map.c src/cpu/cpu_ppc64.c +src/cpu/cpu_riscv64.c src/cpu/cpu_s390.c src/cpu/cpu_x86.c src/datatypes.c diff --git a/src/cpu/cpu_riscv64.c b/src/cpu/cpu_riscv64.c index c44bdeb291..4cb795f849 100644 --- a/src/cpu/cpu_riscv64.c +++ b/src/cpu/cpu_riscv64.c @@ -46,6 +46,32 @@ virCPURiscv64ValidateFeatures(virCPUDef *cpu G_GNUC_UNUSED) } +static int +virCPURiscv64Update(virCPUDef *guest, + const virCPUDef *host, + bool relative) +{ + g_autoptr(virCPUDef) updated = virCPUDefCopyWithoutModel(guest); + + if (!relative || guest->mode != VIR_CPU_MODE_HOST_MODEL) + return 0; + + if (!host) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("unknown host CPU model")); + return -1; + } + + updated->mode = VIR_CPU_MODE_CUSTOM; + virCPUDefCopyModel(updated, host, true); + + virCPUDefStealModel(guest, updated, false); + guest->mode = VIR_CPU_MODE_CUSTOM; + guest->match = VIR_CPU_MATCH_EXACT; + + return 0; +} + struct cpuArchDriver cpuDriverRiscv64 = { .name = "riscv64", .arch = archs, @@ -54,6 +80,6 @@ struct cpuArchDriver cpuDriverRiscv64 = { .decode = NULL, .encode = NULL, .baseline = NULL, - .update = NULL, + .update = virCPURiscv64Update, .validateFeatures = virCPURiscv64ValidateFeatures, }; -- 2.40.0

On Wed, Jan 22, 2025 at 12:16:59PM -0300, Daniel Henrique Barboza wrote:
At this moment it is not possible to launch a 'riscv64' domain if a CPU definition is presented in the domain. For example, adding this CPU definition:
<cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>rv64</model> </cpu>
Will trigger the following error:
$ sudo ./run tools/virsh start riscv-virt1 error: Failed to start domain 'riscv-virt1' error: this function is not supported by the connection driver: cannot update guest CPU for riscv64 architecture
The error comes from virCPUUpdate(), via qemuProcessUpdateGuestCPU(), and it's caused by the absence of the 'update' API in the existing RISC-V driver.
Add an 'update' API impl to the RISC-V driver to allow for CPU definitions to be declared in RISC-V domains. This API was copied from the ARM driver (virCPUarmUpdate()) since it's a good enough implementation to get us going.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
I presume this patch was left formatted in your repo and accidentally sent with something like `git send-email *patch`, since it's already merged for quite some time =) Anyway, thanks to it I noticed the change in your e-mail address, so you might want to update .mailmap to your satisfaction. Martin

On 1/23/25 6:18 AM, Martin Kletzander wrote:
On Wed, Jan 22, 2025 at 12:16:59PM -0300, Daniel Henrique Barboza wrote:
At this moment it is not possible to launch a 'riscv64' domain if a CPU definition is presented in the domain. For example, adding this CPU definition:
<cpu mode='custom' match='exact' check='none'> <model fallback='forbid'>rv64</model> </cpu>
Will trigger the following error:
$ sudo ./run tools/virsh start riscv-virt1 error: Failed to start domain 'riscv-virt1' error: this function is not supported by the connection driver: cannot update guest CPU for riscv64 architecture
The error comes from virCPUUpdate(), via qemuProcessUpdateGuestCPU(), and it's caused by the absence of the 'update' API in the existing RISC-V driver.
Add an 'update' API impl to the RISC-V driver to allow for CPU definitions to be declared in RISC-V domains. This API was copied from the ARM driver (virCPUarmUpdate()) since it's a good enough implementation to get us going.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
I presume this patch was left formatted in your repo and accidentally sent with something like `git send-email *patch`, since it's already merged for quite some time =)
Oooops :(
Anyway, thanks to it I noticed the change in your e-mail address, so you might want to update .mailmap to your satisfaction.
I wasn't aware of this file. I'll take a look and update as needed. Thanks, Daniel
Martin

AIA (Advanced Interrupt Architecture) support was introduced in QEMU 7.0 for the 'virt' machine type. It allows the guest to choose from a more modern interrupt model than the default (CLINT - Core Logical Interrupt Controller). Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml | 1 + tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml | 1 + 4 files changed, 5 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 53aa64a009..490f5b28fd 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -725,6 +725,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 470 */ "migrate-incoming.exit-on-error", /* QEMU_CAPS_MIGRATE_INCOMING_EXIT_ON_ERROR */ + "machine.virt.aia", /* QEMU_CAPS_MACHINE_VIRT_AIA */ ); @@ -1764,6 +1765,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsPSeries[] = { static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsVirt[] = { { "iommu", QEMU_CAPS_MACHINE_VIRT_IOMMU }, { "ras", QEMU_CAPS_MACHINE_VIRT_RAS }, + { "aia", QEMU_CAPS_MACHINE_VIRT_AIA }, }; static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsGeneric[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 398749a136..07746f644c 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -704,6 +704,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 470 */ QEMU_CAPS_MIGRATE_INCOMING_EXIT_ON_ERROR, /* exit-on-error argument of migrate-incoming command */ + QEMU_CAPS_MACHINE_VIRT_AIA, /* -machine virt,aia=(none|aplic|aplic-imsic), RISC-V only */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml b/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml index 7959d49c02..0207637ebc 100644 --- a/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml @@ -142,6 +142,7 @@ <flag name='usb-mtp'/> <flag name='netdev.user'/> <flag name='snapshot-internal-qmp'/> + <flag name='machine.virt.aia'/> <version>7002050</version> <microcodeVersion>0</microcodeVersion> <package>v7.2.0-333-g222059a0fc</package> diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml b/tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml index 77f4deca03..ccc7673ba9 100644 --- a/tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml @@ -169,6 +169,7 @@ <flag name='acpi-erst'/> <flag name='snapshot-internal-qmp'/> <flag name='migrate-incoming.exit-on-error'/> + <flag name='machine.virt.aia'/> <version>9001000</version> <microcodeVersion>0</microcodeVersion> <package>v9.1.0</package> -- 2.48.1

On Wed, Jan 22, 2025 at 12:17:00PM -0300, Daniel Henrique Barboza wrote:
AIA (Advanced Interrupt Architecture) support was introduced in QEMU 7.0 for the 'virt' machine type. It allows the guest to choose from a more modern interrupt model than the default (CLINT - Core Logical Interrupt Controller).
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

This feature is implemented as a string that can range from "none", "aplic" and "aplic-imsic". If the feature isn't present in the domain XML the hypervisor default will be used. For QEMU, at least up to 9.2, the default is "none". Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> --- docs/formatdomain.rst | 8 +++++++ src/conf/domain_conf.c | 40 +++++++++++++++++++++++++++++++ src/conf/domain_conf.h | 12 ++++++++++ src/conf/schemas/domaincommon.rng | 15 ++++++++++++ src/libvirt_private.syms | 2 ++ src/qemu/qemu_validate.c | 15 ++++++++++++ 6 files changed, 92 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 620daae9af..785b51bb4e 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2043,6 +2043,7 @@ Hypervisors may allow certain CPU / machine features to be toggled on/off. <async-teardown enabled='yes'/> <ras state='on'/> <ps2 state='on'/> + <aia value='aplic-imsic'/> </features> ... @@ -2290,6 +2291,13 @@ are: disable the emulation of a PS/2 controller used by ``ps2`` bus input devices. If the attribute is not defined, the hypervisor default will be used. :since:`Since 10.7.0` (QEMU only) +``aia`` + Configure aia (Advanced Interrupt Architecture) for RISC-V 'virt' + guests. Possible values for the ``value`` attribute are ``aplic`` (one + emulated APLIC device present per socket), ``aplic-imsic`` (one APLIC and + one IMSIC device present per core), or ``none`` (no support for AIA). + If the attribute is not defined, the hypervisor default + will be used. :since:`Since 11.1.0` (QEMU/KVM and RISC-V guests only) Time keeping ------------ diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3f88a77a8f..5e7b9edf8f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -186,6 +186,7 @@ VIR_ENUM_IMPL(virDomainFeature, "async-teardown", "ras", "ps2", + "aia", ); VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, @@ -1536,6 +1537,14 @@ VIR_ENUM_IMPL(virDomainPstoreBackend, "acpi-erst", ); +VIR_ENUM_IMPL(virDomainAIA, + VIR_DOMAIN_AIA_LAST, + "default", + "none", + "aplic", + "aplic-imsic", +); + typedef enum { VIR_DOMAIN_NET_VHOSTUSER_MODE_NONE, VIR_DOMAIN_NET_VHOSTUSER_MODE_CLIENT, @@ -17171,6 +17180,18 @@ virDomainFeaturesDefParse(virDomainDef *def, break; } + case VIR_DOMAIN_FEATURE_AIA: { + virDomainAIA value; + + if (virXMLPropEnumDefault(nodes[i], "value", virDomainAIATypeFromString, + VIR_XML_PROP_NONZERO, &value, + VIR_DOMAIN_AIA_NONE) < 0) + return -1; + + def->features[val] = value; + break; + } + case VIR_DOMAIN_FEATURE_TCG: if (virDomainFeaturesTCGDefParse(def, ctxt, nodes[i]) < 0) return -1; @@ -21161,6 +21182,17 @@ virDomainDefFeaturesCheckABIStability(virDomainDef *src, } break; + case VIR_DOMAIN_FEATURE_AIA: + if (src->features[i] != dst->features[i]) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of feature '%1$s' differs: source: '%2$s=%3$s', destination: '%4$s=%5$s'"), + featureName, + "value", virDomainAIATypeToString(src->features[i]), + "value", virDomainAIATypeToString(dst->features[i])); + return false; + } + break; + case VIR_DOMAIN_FEATURE_MSRS: case VIR_DOMAIN_FEATURE_TCG: case VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN: @@ -28219,6 +28251,14 @@ virDomainDefFormatFeatures(virBuffer *buf, virTristateBoolTypeToString(def->features[i])); break; + case VIR_DOMAIN_FEATURE_AIA: + if (def->features[i] == VIR_DOMAIN_AIA_DEFAULT) + break; + + virBufferAsprintf(&childBuf, "<aia value='%s'/>\n", + virDomainAIATypeToString(def->features[i])); + break; + case VIR_DOMAIN_FEATURE_LAST: break; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 9f7c28343f..ba1a495764 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2206,6 +2206,7 @@ typedef enum { VIR_DOMAIN_FEATURE_ASYNC_TEARDOWN, VIR_DOMAIN_FEATURE_RAS, VIR_DOMAIN_FEATURE_PS2, + VIR_DOMAIN_FEATURE_AIA, VIR_DOMAIN_FEATURE_LAST } virDomainFeature; @@ -2423,6 +2424,17 @@ typedef enum { VIR_ENUM_DECL(virDomainIBS); +typedef enum { + VIR_DOMAIN_AIA_DEFAULT = 0, + VIR_DOMAIN_AIA_NONE, + VIR_DOMAIN_AIA_APLIC, + VIR_DOMAIN_AIA_APLIC_IMSIC, + + VIR_DOMAIN_AIA_LAST +} virDomainAIA; + +VIR_ENUM_DECL(virDomainAIA); + typedef struct _virDomainFeatureKVM virDomainFeatureKVM; struct _virDomainFeatureKVM { int features[VIR_DOMAIN_KVM_LAST]; diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng index 7121519ca3..5848d3eaaf 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -6996,6 +6996,9 @@ <ref name="featurestate"/> </element> </optional> + <optional> + <ref name="aia"/> + </optional> </interleave> </element> </optional> @@ -7294,6 +7297,18 @@ </element> </define> + <define name="aia"> + <element name="aia"> + <attribute name="value"> + <choice> + <value>none</value> + <value>aplic</value> + <value>aplic-imsic</value> + </choice> + </attribute> + </element> + </define> + <define name="address"> <element name="address"> <choice> diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 33b93cbd3e..ee90fb2b84 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -229,6 +229,8 @@ virDiskNameParse; virDiskNameToBusDeviceIndex; virDiskNameToIndex; virDomainActualNetDefFree; +virDomainAIATypeFromString; +virDomainAIATypeToString; virDomainAudioDefFree; virDomainAudioFormatTypeFromString; virDomainAudioFormatTypeToString; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 086c66b602..0a086d9cf4 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -264,6 +264,21 @@ qemuValidateDomainDefFeatures(const virDomainDef *def, } break; + case VIR_DOMAIN_FEATURE_AIA: + if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT && + !qemuDomainIsRISCVVirt(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("aia feature is only supported with RISC-V Virt machines")); + return -1; + } + if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_VIRT_AIA)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("aia feature is not available with this QEMU binary")); + return -1; + } + break; + case VIR_DOMAIN_FEATURE_SMM: case VIR_DOMAIN_FEATURE_KVM: case VIR_DOMAIN_FEATURE_XEN: -- 2.48.1

On Wed, Jan 22, 2025 at 12:17:01PM -0300, Daniel Henrique Barboza wrote:
This feature is implemented as a string that can range from "none", "aplic" and "aplic-imsic".
If the feature isn't present in the domain XML the hypervisor default will be used. For QEMU, at least up to 9.2, the default is "none".
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> --- docs/formatdomain.rst | 8 +++++++ src/conf/domain_conf.c | 40 +++++++++++++++++++++++++++++++ src/conf/domain_conf.h | 12 ++++++++++ src/conf/schemas/domaincommon.rng | 15 ++++++++++++ src/libvirt_private.syms | 2 ++ src/qemu/qemu_validate.c | 15 ++++++++++++ 6 files changed, 92 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3f88a77a8f..5e7b9edf8f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17171,6 +17180,18 @@ virDomainFeaturesDefParse(virDomainDef *def, break; }
+ case VIR_DOMAIN_FEATURE_AIA: { + virDomainAIA value; + + if (virXMLPropEnumDefault(nodes[i], "value", virDomainAIATypeFromString, + VIR_XML_PROP_NONZERO, &value, + VIR_DOMAIN_AIA_NONE) < 0)
This should be changed to VIR_DOMAIN_AIA_DEFAULT
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 086c66b602..0a086d9cf4 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -264,6 +264,21 @@ qemuValidateDomainDefFeatures(const virDomainDef *def, } break;
+ case VIR_DOMAIN_FEATURE_AIA: + if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT && + !qemuDomainIsRISCVVirt(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("aia feature is only supported with RISC-V Virt machines")); + return -1; + } + if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
Copy-paste error. Even though this would work I'd rather you used VIR_DOMAIN_AIA_DEFAULT in both of the conditions above instead of the VIR_TRISTATE value. With the changes: Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

The 'aia' feature is added as a machine type option for the 'virt' RISC-V machine, e.g. "-machine virt,aia=<val>". Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> --- src/qemu/qemu_command.c | 5 +++ ...cv64-virt-features-aia.riscv64-latest.args | 31 +++++++++++++++++++ ...scv64-virt-features-aia.riscv64-latest.xml | 1 + .../riscv64-virt-features-aia.xml | 27 ++++++++++++++++ tests/qemuxmlconftest.c | 2 ++ 5 files changed, 66 insertions(+) create mode 100644 tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.args create mode 120000 tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.xml create mode 100644 tests/qemuxmlconfdata/riscv64-virt-features-aia.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1f28de6194..1f20189e89 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6741,6 +6741,11 @@ qemuAppendDomainFeaturesMachineParam(virBuffer *buf, virBufferAsprintf(buf, ",i8042=%s", str); } + if (def->features[VIR_DOMAIN_FEATURE_AIA] != VIR_DOMAIN_AIA_DEFAULT) { + const char *str = virDomainAIATypeToString(def->features[VIR_DOMAIN_FEATURE_AIA]); + virBufferAsprintf(buf, ",aia=%s", str); + } + return 0; } diff --git a/tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.args b/tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.args new file mode 100644 index 0000000000..0256026ba4 --- /dev/null +++ b/tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.args @@ -0,0 +1,31 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-riscv64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-machine virt,usb=off,aia=none,dump-guest-core=off,memory-backend=riscv_virt_board.ram,acpi=off \ +-accel tcg \ +-cpu rv64 \ +-m size=4194304k \ +-object '{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":4294967296}' \ +-overcommit mem-lock=off \ +-smp 4,sockets=4,cores=1,threads=1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.xml b/tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.xml new file mode 120000 index 0000000000..1ab55fc10e --- /dev/null +++ b/tests/qemuxmlconfdata/riscv64-virt-features-aia.riscv64-latest.xml @@ -0,0 +1 @@ +riscv64-virt-features-aia.xml \ No newline at end of file diff --git a/tests/qemuxmlconfdata/riscv64-virt-features-aia.xml b/tests/qemuxmlconfdata/riscv64-virt-features-aia.xml new file mode 100644 index 0000000000..60bbb82c74 --- /dev/null +++ b/tests/qemuxmlconfdata/riscv64-virt-features-aia.xml @@ -0,0 +1,27 @@ +<domain type='qemu'> + <name>guest</name> + <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid> + <memory unit='KiB'>4194304</memory> + <currentMemory unit='KiB'>4194304</currentMemory> + <vcpu placement='static'>4</vcpu> + <os> + <type arch='riscv64' machine='virt'>hvm</type> + <boot dev='hd'/> + </os> + <features> + <aia value='none'/> + </features> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>rv64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-riscv64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 5c95a49116..34d38f2c4b 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2930,6 +2930,8 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-tcg-q35-4.2", "x86_64"); DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-tcg-features", "x86_64"); + DO_TEST_CAPS_ARCH_LATEST("riscv64-virt-features-aia", "riscv64"); + DO_TEST_CAPS_LATEST("virtio-9p-multidevs"); DO_TEST_CAPS_LATEST("virtio-9p-createmode"); -- 2.48.1

On Wed, Jan 22, 2025 at 12:17:02PM -0300, Daniel Henrique Barboza wrote:
The 'aia' feature is added as a machine type option for the 'virt' RISC-V machine, e.g. "-machine virt,aia=<val>".
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
participants (2)
-
Daniel Henrique Barboza
-
Martin Kletzander