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

Hi, This version has changes in patch 2 proposed by Martin. An extra patch was added to add my contact info in .mailmap, also suggested by Martin. Changes from v2: - patch 2: - use VIR_DOMAIN_AIA_DEFAULT instead of VIR_DOMAIN_AIA_NONE in virDomainFeaturesDefParse() - use VIR_DOMAIN_AIA_DEFAULT instead of VIR_TRISTATE_SWITCH_ABSENT in both checks in qemuValidateDomainDefFeatures() - patch 4 (new): - add my address info in .mailmap - v2 link: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/EAPFE... Daniel Henrique Barboza (4): qemu: add capability for RISC-V AIA feature conf,qemu: implement RISC-V 'aia' virt domain feature qemu: add RISC-V 'aia' command line .mailmap: add my contact info .mailmap | 2 + 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 + 16 files changed, 165 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

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> --- 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

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> Reviewed-by: Martin Kletzander <mkletzan@redhat.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..45c2cd09f1 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_DEFAULT) < 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..07a505d106 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_DOMAIN_AIA_DEFAULT && + !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_DOMAIN_AIA_DEFAULT && + !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

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> --- 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

Most of my historical libvirt contributions are PowerPC related but at this moment I'm working with RISC-V enablement (mostly on the QEMU side). Feel free to reach out for RISC-V related matters w.r.t libvirt and QEMU-KVM support. Suggested-by: Martin Kletzander <mkletzan@redhat.com> Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> --- .mailmap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.mailmap b/.mailmap index 9dfb7a832b..24a2782144 100644 --- a/.mailmap +++ b/.mailmap @@ -48,6 +48,7 @@ <shi_lei@massclouds.com> <shilei.massclouds@gmx.com> <adrian.brzezinski@eo.pl> <redhat@adrb.pl> <matt@datto.com> <mcoleman@datto.com> +<dbarboza@ventanamicro.com> <danielhb413@gmail.com> # Name consolidation: # Preferred author spelling <preferred email> @@ -70,6 +71,7 @@ Wang Yufei (James) <james.wangyufei@huawei.com> Deepak C Shetty <dpkshetty@gmail.com> Dave Allan <dallan@redhat.com> Richard W.M. Jones <rjones@redhat.com> +Daniel Henrique Barboza <dbarboza@ventanamicro.com> # Non-trivial consolidation: # see git documentation for information about the format -- 2.48.1

On Thu, Jan 23, 2025 at 09:17:25AM -0300, Daniel Henrique Barboza wrote:
Hi,
This version has changes in patch 2 proposed by Martin. An extra patch was added to add my contact info in .mailmap, also suggested by Martin.
Changes from v2: - patch 2: - use VIR_DOMAIN_AIA_DEFAULT instead of VIR_DOMAIN_AIA_NONE in virDomainFeaturesDefParse() - use VIR_DOMAIN_AIA_DEFAULT instead of VIR_TRISTATE_SWITCH_ABSENT in both checks in qemuValidateDomainDefFeatures() - patch 4 (new): - add my address info in .mailmap - v2 link: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/EAPFE...
Daniel Henrique Barboza (4): qemu: add capability for RISC-V AIA feature conf,qemu: implement RISC-V 'aia' virt domain feature qemu: add RISC-V 'aia' command line .mailmap: add my contact info
To all four patches: Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
.mailmap | 2 + 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 + 16 files changed, 165 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

On Thu, Jan 23, 2025 at 03:40:40PM +0100, Martin Kletzander wrote:
On Thu, Jan 23, 2025 at 09:17:25AM -0300, Daniel Henrique Barboza wrote:
Daniel Henrique Barboza (4): qemu: add capability for RISC-V AIA feature conf,qemu: implement RISC-V 'aia' virt domain feature qemu: add RISC-V 'aia' command line .mailmap: add my contact info
To all four patches:
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Feel free to add my Reviewed-by: Andrea Bolognani <abologna@redhat.com> as well. I had marked this series for review but then failed to get back to it, thanks a lot Martin for stepping up! Just one question: is there a way to figure out what the default for the machine type will be ahead of time so that we can record that information in the XML when the domain is defined? I'm assuming that changing the value has user-visible consequences... -- Andrea Bolognani / Red Hat / Virtualization

On 1/23/25 1:15 PM, Andrea Bolognani wrote:
On Thu, Jan 23, 2025 at 03:40:40PM +0100, Martin Kletzander wrote:
On Thu, Jan 23, 2025 at 09:17:25AM -0300, Daniel Henrique Barboza wrote:
Daniel Henrique Barboza (4): qemu: add capability for RISC-V AIA feature conf,qemu: implement RISC-V 'aia' virt domain feature qemu: add RISC-V 'aia' command line .mailmap: add my contact info
To all four patches:
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Feel free to add my
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
as well. I had marked this series for review but then failed to get back to it, thanks a lot Martin for stepping up!
Thanks! Should I go ahead and push it (I think I still have write access to the repo) or do you guys handle it?
Just one question: is there a way to figure out what the default for the machine type will be ahead of time so that we can record that information in the XML when the domain is defined? I'm assuming that changing the value has user-visible consequences...
Unless we have a way of querying machine properties in QEMU I don't think we have a way of knowing beforehand the default for this particular prop (or any other machine prop for that matter). We have QEMU apis such as 'query-current-machine' that could be used for this purpose, I guess ... Thanks, Daniel

On Thu, Jan 23, 2025 at 02:51:50PM -0300, Daniel Henrique Barboza wrote:
On 1/23/25 1:15 PM, Andrea Bolognani wrote:
On Thu, Jan 23, 2025 at 03:40:40PM +0100, Martin Kletzander wrote:
On Thu, Jan 23, 2025 at 09:17:25AM -0300, Daniel Henrique Barboza wrote:
Daniel Henrique Barboza (4): qemu: add capability for RISC-V AIA feature conf,qemu: implement RISC-V 'aia' virt domain feature qemu: add RISC-V 'aia' command line .mailmap: add my contact info
To all four patches:
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Feel free to add my
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
as well. I had marked this series for review but then failed to get back to it, thanks a lot Martin for stepping up!
Thanks! Should I go ahead and push it (I think I still have write access to the repo) or do you guys handle it?
Sure, go ahead.
Just one question: is there a way to figure out what the default for the machine type will be ahead of time so that we can record that information in the XML when the domain is defined? I'm assuming that changing the value has user-visible consequences...
Unless we have a way of querying machine properties in QEMU I don't think we have a way of knowing beforehand the default for this particular prop (or any other machine prop for that matter). We have QEMU apis such as 'query-current-machine' that could be used for this purpose, I guess ...
Oh, that's the one thing I wanted to mention and forgot. If we have a way to query that information even after starting the guest then it would be nice to update the XML so that we keep the same default (even though it probably will be kept stable thanks to the machine type). What that would help with is when potentially migrating (or restoring from a managed save) specifying the same value would not trigger the ABI compatibility error. But that's a pretty niche case I guess.
Thanks,
Daniel

Applied. Thanks, Daniel On 1/23/25 9:17 AM, Daniel Henrique Barboza wrote:
Hi,
This version has changes in patch 2 proposed by Martin. An extra patch was added to add my contact info in .mailmap, also suggested by Martin.
Changes from v2: - patch 2: - use VIR_DOMAIN_AIA_DEFAULT instead of VIR_DOMAIN_AIA_NONE in virDomainFeaturesDefParse() - use VIR_DOMAIN_AIA_DEFAULT instead of VIR_TRISTATE_SWITCH_ABSENT in both checks in qemuValidateDomainDefFeatures() - patch 4 (new): - add my address info in .mailmap - v2 link: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/EAPFE...
Daniel Henrique Barboza (4): qemu: add capability for RISC-V AIA feature conf,qemu: implement RISC-V 'aia' virt domain feature qemu: add RISC-V 'aia' command line .mailmap: add my contact info
.mailmap | 2 + 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 + 16 files changed, 165 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
participants (3)
-
Andrea Bolognani
-
Daniel Henrique Barboza
-
Martin Kletzander