[PATCH v2 00/29] ppc64 PowerNV machines support

Hi, This v2 has changes proposed by Peter and Daniel on the v1 review. Peter's reviewed-by tags were kept when applicable. The usability change made is that, now, we'll fail to launch powernv domains that has a pnv-phb* device and it's running a QEMU version that doesn't support these devices to be user creatable. Trying to run the 'powernv8-basic' domain with a QEMU 6.2.0 binary will result in an error: $ sudo ./run tools/virsh define ../tests/qemuxml2argvdata/powernv8-basic.xml error: Failed to define domain from ../tests/qemuxml2argvdata/powernv8-basic.xml error: unsupported configuration: The 'pnv-phb3' device is not supported by this QEMU binary Using the current QEMU upstream will allow the domain to be defined and started. Changes from v1: - all tests are now using CAPS_LATEST; - QEMU_CAPS_DEVICE_PNV_PHB3_ROOT_PORT is no longer being used. Capability for the pnv-phb3-root-port is infered to exist if the capabilitity for its PHB (QEMU_CAPS_DEVICE_PNV_PHB3) is present. Same thing for the case of QEMU_CAPS_DEVICE_PNV_PHB4_ROOT_PORT and QEMU_CAPS_DEVICE_PNV_PHB4; - QEMU_CAPS_DEVICE_PNV_PHB3 and QEMU_CAPS_DEVICE_PNV_PHB4 are no longer being probed. They are being set by hand after checking for QEMU version in virQEMUCapsInitQMPVersionCaps(); - patch 01 (QEMU ppc64 capabilities for qemu 7.0): * dropped since it's already upstream - patch 09 (forbid powernv domains migration): * removed. This will be handled on QEMU side - patch 14 (new): * added documentation of the different semantics 'targetIndex' will have for PowerNV PHBs - several other minor changes suggested by Peter - v1 link: https://listman.redhat.com/archives/libvir-list/2022-January/msg00902.html Daniel Henrique Barboza (29): qemu_domain.c: add PowerNV machine helpers qemu_capabilities.c: use 'MachineIsPowerPC' in DeviceDiskCaps qemu_domain: turn qemuDomainMachineIsPSeries() static qemu_validate.c: use qemuDomainIsPowerPC() in qemuValidateDomainChrDef() qemu_domain.c: define ISA as default PowerNV serial qemu_validate.c: enhance 'machine type not supported' message qemu_domain.c: disable default devices for PowerNV machines tests: add basic PowerNV8 test qemu: introduce QEMU_CAPS_DEVICE_PNV_PHB3 conf, qemu: add 'pnv-phb3-root-port' PCI controller model name conf, qemu: add 'pnv-phb3' PCI controller model name domain_conf.c: fix identation in virDomainControllerDefParseXML() conf: parse and format <target chip-id='...'/> formatdomain.rst: add 'index' semantics for PowerNV domains introduce virDomainControllerIsPowerNVPHB conf, qemu: add default 'chip-id' value for pnv-phb3 controllers conf, qemu: add default 'targetIndex' value for pnv-phb3 devs qemu_command.c: add command line for the pnv-phb3 device qemu_domain_address.c: change pnv-phb3 minimal downstream slot domain_conf: format pnv-phb3-root-port empty addr tests: add pnv-phb3-root-port test domain_validate.c: allow targetIndex 0 out of idx 0 for PowerNV PHBs domain_conf.c: reject duplicated pnv-phb3 devices qemu: introduce QEMU_CAPS_DEVICE_PNV_PHB4 conf, qemu: add 'pnv-phb4-root-port' PCI controller model name domain_conf.c: add phb4-root-port to IsPowerNVRootPort() conf, qemu: add 'pnv-phb4' controller model name domain_conf.c: add pnv-phb4 to ControllerIsPowerNVPHB() tests: add PowerNV9 tests docs/formatdomain.rst | 12 +- docs/schemas/domaincommon.rng | 10 ++ src/conf/domain_conf.c | 157 ++++++++++++++---- src/conf/domain_conf.h | 8 + src/conf/domain_validate.c | 5 +- src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 28 +++- src/qemu/qemu_capabilities.h | 2 + src/qemu/qemu_command.c | 21 ++- src/qemu/qemu_domain.c | 56 ++++++- src/qemu/qemu_domain.h | 4 +- src/qemu/qemu_domain_address.c | 64 ++++++- src/qemu/qemu_validate.c | 62 ++++++- .../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 2 + .../powernv8-basic.ppc64-latest.args | 34 ++++ tests/qemuxml2argvdata/powernv8-basic.xml | 16 ++ tests/qemuxml2argvdata/powernv8-dupPHBs.err | 1 + .../powernv8-dupPHBs.ppc64-latest.err | 1 + tests/qemuxml2argvdata/powernv8-dupPHBs.xml | 27 +++ .../powernv8-root-port.ppc64-latest.args | 35 ++++ tests/qemuxml2argvdata/powernv8-root-port.xml | 17 ++ .../powernv8-two-sockets.ppc64-latest.args | 35 ++++ .../qemuxml2argvdata/powernv8-two-sockets.xml | 26 +++ .../powernv9-dupPHBs.ppc64-latest.err | 1 + tests/qemuxml2argvdata/powernv9-dupPHBs.xml | 27 +++ .../powernv9-root-port.ppc64-latest.args | 35 ++++ tests/qemuxml2argvdata/powernv9-root-port.xml | 17 ++ tests/qemuxml2argvtest.c | 7 + .../powernv8-basic.ppc64-latest.xml | 34 ++++ .../powernv8-root-port.ppc64-latest.xml | 39 +++++ .../powernv8-two-sockets.ppc64-latest.xml | 39 +++++ .../powernv9-root-port.ppc64-latest.xml | 39 +++++ .../qemuxml2xmloutdata/powernv9-root-port.xml | 36 ++++ tests/qemuxml2xmltest.c | 5 + 34 files changed, 855 insertions(+), 48 deletions(-) create mode 100644 tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-basic.xml create mode 100644 tests/qemuxml2argvdata/powernv8-dupPHBs.err create mode 100644 tests/qemuxml2argvdata/powernv8-dupPHBs.ppc64-latest.err create mode 100644 tests/qemuxml2argvdata/powernv8-dupPHBs.xml create mode 100644 tests/qemuxml2argvdata/powernv8-root-port.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-root-port.xml create mode 100644 tests/qemuxml2argvdata/powernv8-two-sockets.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-two-sockets.xml create mode 100644 tests/qemuxml2argvdata/powernv9-dupPHBs.ppc64-latest.err create mode 100644 tests/qemuxml2argvdata/powernv9-dupPHBs.xml create mode 100644 tests/qemuxml2argvdata/powernv9-root-port.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv9-root-port.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-root-port.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-two-sockets.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv9-root-port.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv9-root-port.xml -- 2.34.1

The PowerNV (Power Non-Virtualized) QEMU ppc64 machine is the emulation of a bare-metal IBM Power host. It follows the OPAL (OpenPower Abstration Layer) API/ABI, most specifically Skiboot [1]. For now, Libvirt has support for the pSeries QEMU machine, which is the emulation of a logical partition (guest) that would run on top of a bare-metal system. This patch introduces the helpers that are going to be used to add a basic support for PowerNV domains in Libvirt. Given that there are quite a few similarities in how pSeries and PowerNVv should be handled, we're also adding a 'qemuDomainIsPowerPC' helper that will be used in those instances. [1] https://open-power.github.io/skiboot/doc/overview.html Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain.c | 41 +++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 4 ++++ 2 files changed, 45 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index aa8f6b8d05..2e21a95f38 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8719,6 +8719,47 @@ qemuDomainIsPSeries(const virDomainDef *def) } +/* + * The PowerNV machine does not support KVM acceleration in Power + * hosts. We can skip the usual ARCH_IS_PPC64() since this machine + * is usable with TCG in all host archs. + */ +bool +qemuDomainIsPowerNV(const virDomainDef *def) +{ + if (STRPREFIX(def->os.machine, "powernv")) + return true; + + return false; +} + + +/* + * PowerNV and pSeries domains shares a lot of common traits. This + * helper avoids repeating "if (pseries || powernv)" everywhere this + * is applicable. + */ +bool +qemuDomainIsPowerPC(const virDomainDef *def) +{ + return qemuDomainIsPSeries(def) || qemuDomainIsPowerNV(def); +} + + +/* + * Similar to qemuDomainIsPowerPC(). Usable when the caller doesn't + * have access to a virDomainDef pointer. + */ +bool +qemuDomainMachineIsPowerPC(const char *machine, const virArch arch) +{ + if (STRPREFIX(machine, "powernv")) + return true; + + return qemuDomainMachineIsPSeries(machine, arch); +} + + bool qemuDomainHasPCIRoot(const virDomainDef *def) { diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index e5046367e3..d07a279a1b 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -761,6 +761,8 @@ bool qemuDomainMachineIsARMVirt(const char *machine, const virArch arch); bool qemuDomainMachineIsPSeries(const char *machine, const virArch arch); +bool qemuDomainMachineIsPowerPC(const char *machine, + const virArch arch); bool qemuDomainMachineHasBuiltinIDE(const char *machine, const virArch arch); @@ -770,6 +772,8 @@ bool qemuDomainIsS390CCW(const virDomainDef *def); bool qemuDomainIsARMVirt(const virDomainDef *def); bool qemuDomainIsRISCVVirt(const virDomainDef *def); bool qemuDomainIsPSeries(const virDomainDef *def); +bool qemuDomainIsPowerNV(const virDomainDef *def); +bool qemuDomainIsPowerPC(const virDomainDef *def); bool qemuDomainHasPCIRoot(const virDomainDef *def); bool qemuDomainHasPCIeRoot(const virDomainDef *def); bool qemuDomainHasBuiltinIDE(const virDomainDef *def); -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
The PowerNV (Power Non-Virtualized) QEMU ppc64 machine is the emulation of a bare-metal IBM Power host. It follows the OPAL (OpenPower Abstration Layer) API/ABI, most specifically Skiboot [1]. For now, Libvirt has support for the pSeries QEMU machine, which is the emulation
s/Libvirt/libvirt/
of a logical partition (guest) that would run on top of a bare-metal system.
This patch introduces the helpers that are going to be used to add a basic support for PowerNV domains in Libvirt. Given that there are quite
s/Libvirt/libvirt/
a few similarities in how pSeries and PowerNVv should be handled, we're also adding a 'qemuDomainIsPowerPC' helper that will be used in those instances.
[1] https://open-power.github.io/skiboot/doc/overview.html
Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain.c | 41 +++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 4 ++++ 2 files changed, 45 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index aa8f6b8d05..2e21a95f38 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8719,6 +8719,47 @@ qemuDomainIsPSeries(const virDomainDef *def) }
+/* + * The PowerNV machine does not support KVM acceleration in Power + * hosts.
We can skip the usual ARCH_IS_PPC64() since this machine + * is usable with TCG in all host archs.
I don't understand the comment. We use these ARCH_ macros to check the guest arch, not the host arch. So the check should be here too.
+ */ +bool +qemuDomainIsPowerNV(const virDomainDef *def) +{ + if (STRPREFIX(def->os.machine, "powernv")) + return true; + + return false; +} + +
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

On 2/21/22 09:47, Ján Tomko wrote:
On a Tuesday in 2022, Daniel Henrique Barboza wrote:
The PowerNV (Power Non-Virtualized) QEMU ppc64 machine is the emulation of a bare-metal IBM Power host. It follows the OPAL (OpenPower Abstration Layer) API/ABI, most specifically Skiboot [1]. For now, Libvirt has support for the pSeries QEMU machine, which is the emulation
s/Libvirt/libvirt/
I think I've been using capital L for a long time now. I'll make sure to pay attention next time.
of a logical partition (guest) that would run on top of a bare-metal system.
This patch introduces the helpers that are going to be used to add a basic support for PowerNV domains in Libvirt. Given that there are quite
s/Libvirt/libvirt/
a few similarities in how pSeries and PowerNVv should be handled, we're also adding a 'qemuDomainIsPowerPC' helper that will be used in those instances.
[1] https://open-power.github.io/skiboot/doc/overview.html
Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain.c | 41 +++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 4 ++++ 2 files changed, 45 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index aa8f6b8d05..2e21a95f38 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8719,6 +8719,47 @@ qemuDomainIsPSeries(const virDomainDef *def) }
+/* + * The PowerNV machine does not support KVM acceleration in Power + * hosts.
We can skip the usual ARCH_IS_PPC64() since this machine + * is usable with TCG in all host archs.
I don't understand the comment. We use these ARCH_ macros to check the guest arch, not the host arch. So the check should be here too.
True. I removed the comment. Thanks, Daniel
+ */ +bool +qemuDomainIsPowerNV(const virDomainDef *def) +{ + if (STRPREFIX(def->os.machine, "powernv")) + return true; + + return false; +} + +
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Jano

Both pSeries and PowerNV machines don't have floppy device support. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_capabilities.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index dae9d1163d..bb90715569 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -6178,8 +6178,8 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCaps *qemuCaps, VIR_DOMAIN_DISK_DEVICE_CDROM, VIR_DOMAIN_DISK_DEVICE_LUN); - /* PowerPC pseries based VMs do not support floppy device */ - if (!qemuDomainMachineIsPSeries(machine, qemuCaps->arch)) { + /* PowerPC domains do not support floppy device */ + if (!qemuDomainMachineIsPowerPC(machine, qemuCaps->arch)) { VIR_DOMAIN_CAPS_ENUM_SET(disk->diskDevice, VIR_DOMAIN_DISK_DEVICE_FLOPPY); VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_FDC); } -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Both pSeries and PowerNV machines don't have floppy device support.
Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_capabilities.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

The function is now unused outside of qemu_domain.c. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_domain.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2e21a95f38..98a6a2657d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8631,7 +8631,7 @@ qemuDomainMachineIsRISCVVirt(const char *machine, /* You should normally avoid this function and use * qemuDomainIsPSeries() instead. */ -bool +static bool qemuDomainMachineIsPSeries(const char *machine, const virArch arch) { diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index d07a279a1b..fe4420bf83 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -759,8 +759,6 @@ virDomainChrDef *qemuFindAgentConfig(virDomainDef *def); * doesn't have "Machine" in the name instead. */ bool qemuDomainMachineIsARMVirt(const char *machine, const virArch arch); -bool qemuDomainMachineIsPSeries(const char *machine, - const virArch arch); bool qemuDomainMachineIsPowerPC(const char *machine, const virArch arch); bool qemuDomainMachineHasBuiltinIDE(const char *machine, -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
The function is now unused outside of qemu_domain.c.
Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_domain.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Both PowerNV and pSeries machines don't support parallel ports. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_validate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 0a879f0115..8453413b3c 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2007,7 +2007,7 @@ qemuValidateDomainChrDef(const virDomainChrDef *dev, return -1; if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL && - (ARCH_IS_S390(def->os.arch) || qemuDomainIsPSeries(def))) { + (ARCH_IS_S390(def->os.arch) || qemuDomainIsPowerPC(def))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("parallel ports are not supported")); return -1; -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Both PowerNV and pSeries machines don't support parallel ports.
Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_validate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

The PowerNV machines uses ISA as the default serial type. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 98a6a2657d..1b4b293388 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5167,6 +5167,8 @@ qemuDomainChrDefPostParse(virDomainChrDef *chr, chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM; } else if (ARCH_IS_S390(def->os.arch)) { chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP; + } else if (qemuDomainIsPowerNV(def)) { + chr->targetType = VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA; } } -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
The PowerNV machines uses ISA as the default serial type.
Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain.c | 2 ++ 1 file changed, 2 insertions(+)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Add 'virt type' to allow for an easier time debugging. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_validate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 8453413b3c..aa686246f5 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1101,8 +1101,9 @@ qemuValidateDomainDef(const virDomainDef *def, if (!virQEMUCapsIsMachineSupported(qemuCaps, def->virtType, def->os.machine)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Emulator '%s' does not support machine type '%s'"), - def->emulator, def->os.machine); + _("Emulator '%s' does not support machine type '%s' for virt type '%s'"), + def->emulator, def->os.machine, + virDomainVirtTypeToString(def->virtType)); return -1; } -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Add 'virt type' to allow for an easier time debugging.
Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_validate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

PowerNV domains will support pcie-root devices as PHBs, in a similar fashion as pSeries domains supports the spapr-pci-host-bridge as a pci-root model. Set 'addPCIRoot' to false since we'll not be using this buses in this machine. 'addDefaultMemballoon' is also set to false since the balloon driver wasn't really tested with the PowerNV kernel. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 1b4b293388..89dbc20eee 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3670,6 +3670,15 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, * add the definition if not already present */ if (qemuDomainIsPSeries(def)) addPanicDevice = true; + + if (qemuDomainIsPowerNV(def)) { + addPCIRoot = false; + addDefaultUSB = false; + addDefaultUSBKBD = false; + addDefaultUSBMouse = false; + addDefaultMemballoon = false; + } + break; case VIR_ARCH_ALPHA: -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
PowerNV domains will support pcie-root devices as PHBs, in a similar fashion as pSeries domains supports the spapr-pci-host-bridge as a pci-root model.
Set 'addPCIRoot' to false since we'll not be using this buses in this machine. 'addDefaultMemballoon' is also set to false since the balloon driver wasn't really tested with the PowerNV kernel.
Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain.c | 9 +++++++++ 1 file changed, 9 insertions(+)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

We're now able to boot a simple PowerNV8 domain in Libvirt. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- .../powernv8-basic.ppc64-latest.args | 33 +++++++++++++++++++ tests/qemuxml2argvdata/powernv8-basic.xml | 16 +++++++++ tests/qemuxml2argvtest.c | 2 ++ .../powernv8-basic.ppc64-latest.xml | 31 +++++++++++++++++ tests/qemuxml2xmltest.c | 2 ++ 5 files changed, 84 insertions(+) create mode 100644 tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-basic.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml diff --git a/tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args b/tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args new file mode 100644 index 0000000000..c9616ded13 --- /dev/null +++ b/tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args @@ -0,0 +1,33 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-ppc64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine powernv8,usb=off,dump-guest-core=off,memory-backend=pnv.ram \ +-accel tcg \ +-cpu POWER8 \ +-m 2048 \ +-object '{"qom-type":"memory-backend-ram","id":"pnv.ram","size":2147483648}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid b20fcfe3-4a0a-4039-8735-9e024256e0f7 \ +-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 \ +-usb \ +-chardev pty,id=charserial0 \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/powernv8-basic.xml b/tests/qemuxml2argvdata/powernv8-basic.xml new file mode 100644 index 0000000000..a92fc1282c --- /dev/null +++ b/tests/qemuxml2argvdata/powernv8-basic.xml @@ -0,0 +1,16 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid> + <memory unit='KiB'>2097152</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='powernv8'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <console type='pty'> + <target type='serial' port='0'/> + </console> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 96d30f2475..de5582a52c 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2242,6 +2242,8 @@ mymain(void) DO_TEST_PARSE_ERROR_NOCAPS("seclabel-multiple"); DO_TEST_PARSE_ERROR_NOCAPS("seclabel-device-duplicates"); + DO_TEST_CAPS_ARCH_LATEST("powernv8-basic", "ppc64"); + DO_TEST("pseries-basic", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_DEVICE_SPAPR_VTY); diff --git a/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml b/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml new file mode 100644 index 0000000000..cb9b3cf86f --- /dev/null +++ b/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml @@ -0,0 +1,31 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='powernv8'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>POWER8</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-ppc64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <serial type='pty'> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <audio id='1' type='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 935fd955f4..1815d9ac1d 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -662,6 +662,8 @@ mymain(void) QEMU_CAPS_OBJECT_RNG_EGD); DO_TEST_CAPS_LATEST("virtio-rng-builtin"); + DO_TEST_CAPS_ARCH_LATEST("powernv8-basic", "ppc64"); + DO_TEST("pseries-nvram", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_DEVICE_NVRAM); -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
We're now able to boot a simple PowerNV8 domain in Libvirt.
*libvirt
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- .../powernv8-basic.ppc64-latest.args | 33 +++++++++++++++++++ tests/qemuxml2argvdata/powernv8-basic.xml | 16 +++++++++ tests/qemuxml2argvtest.c | 2 ++ .../powernv8-basic.ppc64-latest.xml | 31 +++++++++++++++++ tests/qemuxml2xmltest.c | 2 ++ 5 files changed, 84 insertions(+) create mode 100644 tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-basic.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

QEMU_CAPS_DEVICE_PNV_PHB3 indicates binary support for the pnv-phb3 device, the pcie-root controller for PowerNV8 domains, and also the pnv-phb3-root-port device, its pcie-root-port device. This capability is present in QEMU since 5.0.0 but these devices are user-creatable only after QEMU 6.2.0. This means that probing it as default will be misleading for users. Instead, let's use virQEMUCapsInitQMPVersionCaps() to check for the adequate QEMU version and arch and set it manually. Suggested-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_capabilities.c | 19 +++++++++++++++++++ src/qemu/qemu_capabilities.h | 1 + .../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 1 + 3 files changed, 21 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index bb90715569..d60240912c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -662,6 +662,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 420 */ "device.json+hotplug", /* QEMU_CAPS_DEVICE_JSON */ "hvf", /* QEMU_CAPS_HVF */ + "pnv-phb3", /* QEMU_CAPS_DEVICE_PNV_PHB3 */ ); @@ -1397,6 +1398,17 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-vga-gl", QEMU_CAPS_VIRTIO_VGA_GL }, { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST }, { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI }, + /* + * We don't probe the following PowerNV devices: + * + * { "pnv-phb3", QEMU_CAPS_DEVICE_PNV_PHB3 }, + * { "pnv-phb3-root-port", QEMU_CAPS_DEVICE_PNV_PHB3 }, + * + * Because they are present in QEMU binaries since QEMU 5.0.0 + * but became user creatable only in the QEMU 7.0.0 development + * cycle. Their respective capabilities are being set in + * virQEMUCapsInitQMPVersionCaps(). + */ }; @@ -5231,6 +5243,13 @@ virQEMUCapsInitQMPVersionCaps(virQEMUCaps *qemuCaps) */ if (qemuCaps->version < 5002000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_ENABLE_FIPS); + + /* PowerNV pnv-phb devices weren't user creatable up to + * QEMU 6.2.0. The version value set here was taken from a + * binary post 6.2.0 release that has user creatable pnv-phb + * support. */ + if (qemuCaps->version >= 6002050 && ARCH_IS_PPC64(qemuCaps->arch)) + virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_PNV_PHB3); } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index c6fb87a73a..ed3973c0ba 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -637,6 +637,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 420 */ QEMU_CAPS_DEVICE_JSON, /* -device accepts JSON (and works with hot-unplug) */ QEMU_CAPS_HVF, /* Whether Hypervisor.framework is available */ + QEMU_CAPS_DEVICE_PNV_PHB3, /* devices pnv-phb3 and pnv-phb3-root-port */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml index 88eee87587..cb6c146a28 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml @@ -200,6 +200,7 @@ <flag name='rbd-encryption'/> <flag name='sev-guest-kernel-hashes'/> <flag name='device.json+hotplug'/> + <flag name='pnv-phb3'/> <version>6002050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>42900243</microcodeVersion> -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
QEMU_CAPS_DEVICE_PNV_PHB3 indicates binary support for the pnv-phb3 device, the pcie-root controller for PowerNV8 domains, and also the pnv-phb3-root-port device, its pcie-root-port device.
This capability is present in QEMU since 5.0.0 but these devices are user-creatable only after QEMU 6.2.0. This means that probing it as default will be misleading for users. Instead, let's use virQEMUCapsInitQMPVersionCaps() to check for the adequate QEMU version and arch and set it manually.
Suggested-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_capabilities.c | 19 +++++++++++++++++++ src/qemu/qemu_capabilities.h | 1 + .../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 1 + 3 files changed, 21 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index bb90715569..d60240912c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -662,6 +662,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 420 */ "device.json+hotplug", /* QEMU_CAPS_DEVICE_JSON */ "hvf", /* QEMU_CAPS_HVF */ + "pnv-phb3", /* QEMU_CAPS_DEVICE_PNV_PHB3 */ );
@@ -1397,6 +1398,17 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-vga-gl", QEMU_CAPS_VIRTIO_VGA_GL }, { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST }, { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI }, + /* + * We don't probe the following PowerNV devices: + *
If we don't probe them, then this comment does not belong here. Rather it should be documented in the commit message and the place that sets it based on the version.
+ * { "pnv-phb3", QEMU_CAPS_DEVICE_PNV_PHB3 }, + * { "pnv-phb3-root-port", QEMU_CAPS_DEVICE_PNV_PHB3 }, + * + * Because they are present in QEMU binaries since QEMU 5.0.0 + * but became user creatable only in the QEMU 7.0.0 development + * cycle. Their respective capabilities are being set in + * virQEMUCapsInitQMPVersionCaps().
Alternatively, you can probe the device here (just "pnv-phb3", no need to look at both) and clear the capability if QEMU is too old to let the user create it. That way it will be easier to delete years from now when we raise minimum QEMU version.
+ */ };
@@ -5231,6 +5243,13 @@ virQEMUCapsInitQMPVersionCaps(virQEMUCaps *qemuCaps) */ if (qemuCaps->version < 5002000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_ENABLE_FIPS); + + /* PowerNV pnv-phb devices weren't user creatable up to + * QEMU 6.2.0. The version value set here was taken from a + * binary post 6.2.0 release that has user creatable pnv-phb + * support. */ + if (qemuCaps->version >= 6002050 && ARCH_IS_PPC64(qemuCaps->arch))
I'd rather not use the git version in here. If nothing better, at least rewrite this to: > 6002000 Even better if we waited for 7.0.0 or QEMU had some property we could look for (looking at QEMU history there were some properties removed for phb4 as a part of making them user creatable but I don't see anything for phb3).
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_PNV_PHB3); }
With the comment removed and/or the code probing first then clearing based on version number: Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

On 2/21/22 10:07, Ján Tomko wrote:
On a Tuesday in 2022, Daniel Henrique Barboza wrote:
QEMU_CAPS_DEVICE_PNV_PHB3 indicates binary support for the pnv-phb3 device, the pcie-root controller for PowerNV8 domains, and also the pnv-phb3-root-port device, its pcie-root-port device.
This capability is present in QEMU since 5.0.0 but these devices are user-creatable only after QEMU 6.2.0. This means that probing it as default will be misleading for users. Instead, let's use virQEMUCapsInitQMPVersionCaps() to check for the adequate QEMU version and arch and set it manually.
Suggested-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_capabilities.c | 19 +++++++++++++++++++ src/qemu/qemu_capabilities.h | 1 + .../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 1 + 3 files changed, 21 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index bb90715569..d60240912c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -662,6 +662,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 420 */ "device.json+hotplug", /* QEMU_CAPS_DEVICE_JSON */ "hvf", /* QEMU_CAPS_HVF */ + "pnv-phb3", /* QEMU_CAPS_DEVICE_PNV_PHB3 */ );
@@ -1397,6 +1398,17 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-vga-gl", QEMU_CAPS_VIRTIO_VGA_GL }, { "s390-pv-guest", QEMU_CAPS_S390_PV_GUEST }, { "virtio-mem-pci", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI }, + /* + * We don't probe the following PowerNV devices: + *
If we don't probe them, then this comment does not belong here. Rather it should be documented in the commit message and the place that sets it based on the version.
Ok.
+ * { "pnv-phb3", QEMU_CAPS_DEVICE_PNV_PHB3 }, + * { "pnv-phb3-root-port", QEMU_CAPS_DEVICE_PNV_PHB3 }, + * + * Because they are present in QEMU binaries since QEMU 5.0.0 + * but became user creatable only in the QEMU 7.0.0 development + * cycle. Their respective capabilities are being set in + * virQEMUCapsInitQMPVersionCaps().
Alternatively, you can probe the device here (just "pnv-phb3", no need to look at both) and clear the capability if QEMU is too old to let the user create it. That way it will be easier to delete years from now when we raise minimum QEMU version.
Got it.
+ */ };
@@ -5231,6 +5243,13 @@ virQEMUCapsInitQMPVersionCaps(virQEMUCaps *qemuCaps) */ if (qemuCaps->version < 5002000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_ENABLE_FIPS); + + /* PowerNV pnv-phb devices weren't user creatable up to + * QEMU 6.2.0. The version value set here was taken from a + * binary post 6.2.0 release that has user creatable pnv-phb + * support. */ + if (qemuCaps->version >= 6002050 && ARCH_IS_PPC64(qemuCaps->arch))
I'd rather not use the git version in here.
If nothing better, at least rewrite this to: > 6002000
I'll change to 6002000 and, together with the change you proposed above, we will assume that the caps exists and remove them if we're running with QEMU 6.2.0 or older. This support went live right after 6.2.0 released, so even if in theory there is some QEMU builds where this assumption would fail, it is highly unlikely for one to grab a post 6.2.0 QEMU commit that happens to not have it today.
Even better if we waited for 7.0.0 or QEMU had some property we could
What if I bump the minimal version to 7.0.0 after QEMU 7.0.0 is released? This would prevent these series to be postponed for another 2 months, we would cover the small version gap that I mentioned above and I can proceed with adding more devices on top of it (e.g. the BMC devices).
look for (looking at QEMU history there were some properties removed for phb4 as a part of making them user creatable but I don't see anything for phb3).
There's a bit of QEMU lore here but long story short: both powernv8 and powernv9 machines weren't libvirt material (the PHBs weren't user creatable, so -nodefaults would create a domain without any PHBs). Upstream QEMU made post 6.2.0 changes to make it happen. The changes you are referring to were part of this process. The powernv9 machine was a little bloated and we took this opportunity to clean up the model. Thanks, Daniel
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_PNV_PHB3); }
With the comment removed and/or the code probing first then clearing based on version number:
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Jano

Apart from being usable only with pnv-phb3 PCIE host bridges (to be added soon), this device acts as a regular pcie-root-port but with a specific model name. No doc changes in formatdomain.rst were made because the PCI model name isn't something that users are supposed to be setting or changing. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_domain_address.c | 5 +++++ src/qemu/qemu_validate.c | 12 +++++++++++- 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 64a797de46..a467fc1437 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2602,6 +2602,7 @@ <!-- implementations of "pcie-root-port" --> <value>ioh3420</value> <value>pcie-root-port</value> + <value>pnv-phb3-root-port</value> <!-- implementations of "pcie-switch-upstream-port" --> <value>x3130-upstream</value> <!-- implementations of "pcie-switch-downstream-port" --> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f5b15cff33..8db4d44d28 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -438,6 +438,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName, "pcie-root-port", "spapr-pci-host-bridge", "pcie-pci-bridge", + "pnv-phb3-root-port", ); VIR_ENUM_IMPL(virDomainControllerModelSCSI, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index d7352b60e6..7aef7659e9 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -646,6 +646,7 @@ typedef enum { VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE, + VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST } virDomainControllerPCIModelName; diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 3e6eed6ec9..eeececa936 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2420,6 +2420,11 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef *cont, *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: + if (qemuDomainIsPowerNV(def)) { + *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT; + break; + } + /* Use generic PCIe Root Ports if available, falling back to * ioh3420 otherwise */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCIE_ROOT_PORT)) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index aa686246f5..ea7861b232 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3428,6 +3428,8 @@ virValidateControllerPCIModelNameToQEMUCaps(int modelName) return QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE: return QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE; + case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT: + return QEMU_CAPS_DEVICE_PNV_PHB3; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE: return 0; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST: @@ -3595,10 +3597,18 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: if (pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420 && - pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT) { + pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT && + pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT) { virReportControllerInvalidValue(cont, model, modelName, "modelName"); return -1; } + + if (pciopts->modelName == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT && + !qemuDomainIsPowerNV(def)) { + virReportControllerInvalidValue(cont, model, modelName, "modelName"); + return -1; + } + break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT: -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Apart from being usable only with pnv-phb3 PCIE host bridges (to be added soon), this device acts as a regular pcie-root-port but with a specific model name.
No doc changes in formatdomain.rst were made because the PCI model name isn't something that users are supposed to be setting or changing.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_domain_address.c | 5 +++++ src/qemu/qemu_validate.c | 12 +++++++++++- 5 files changed, 19 insertions(+), 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Add support for the pcie-root implementation that PowerNV8 domains uses, pnv-phb3. It consists of a PCI model name that isn't supposed to be changed by users, so no doc changes in formatdomain.rst were made. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/schemas/domaincommon.rng | 2 ++ src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_domain_address.c | 3 +++ src/qemu/qemu_validate.c | 8 ++++++-- tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml | 4 +++- 6 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index a467fc1437..4c3a1c28a7 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2597,6 +2597,8 @@ <value>pci-bridge</value> <!-- implementations of "dmi-to-pci-bridge" --> <value>i82801b11-bridge</value> + <!-- implementations of "pcie-root" --> + <value>pnv-phb3</value> <!-- implementations of "pcie-to-pci-bridge" --> <value>pcie-pci-bridge</value> <!-- implementations of "pcie-root-port" --> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8db4d44d28..57ab5b19dd 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -439,6 +439,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName, "spapr-pci-host-bridge", "pcie-pci-bridge", "pnv-phb3-root-port", + "pnv-phb3", ); VIR_ENUM_IMPL(virDomainControllerModelSCSI, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 7aef7659e9..1d9c689e83 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -647,6 +647,7 @@ typedef enum { VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT, + VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST } virDomainControllerPCIModelName; diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index eeececa936..f08fea32f5 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2449,6 +2449,9 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef *cont, *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: + if (qemuDomainIsPowerNV(def)) + *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3; + break; case VIR_DOMAIN_CONTROLLER_MODEL_PCI_DEFAULT: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: break; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index ea7861b232..e8d86a2280 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3430,6 +3430,8 @@ virValidateControllerPCIModelNameToQEMUCaps(int modelName) return QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT: return QEMU_CAPS_DEVICE_PNV_PHB3; + case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3: + return QEMU_CAPS_DEVICE_PNV_PHB3; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE: return 0; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST: @@ -3558,7 +3560,8 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: - if (pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE) { + if (pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE && + !qemuDomainIsPowerNV(def)) { virReportControllerInvalidOption(cont, model, modelName, "modelName"); return -1; } @@ -3640,7 +3643,8 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: - if (pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE) { + if (pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE && + !qemuDomainIsPowerNV(def)) { virReportControllerInvalidValue(cont, model, modelName, "modelName"); return -1; } diff --git a/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml b/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml index cb9b3cf86f..ebbc0653ca 100644 --- a/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml +++ b/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml @@ -17,7 +17,9 @@ <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/qemu-system-ppc64</emulator> - <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='0' model='pcie-root'> + <model name='pnv-phb3'/> + </controller> <serial type='pty'> <target type='isa-serial' port='0'> <model name='isa-serial'/> -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Add support for the pcie-root implementation that PowerNV8 domains uses, pnv-phb3.
It consists of a PCI model name that isn't supposed to be changed by users, so no doc changes in formatdomain.rst were made.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/schemas/domaincommon.rng | 2 ++ src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_domain_address.c | 3 +++ src/qemu/qemu_validate.c | 8 ++++++-- tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml | 4 +++- 6 files changed, 16 insertions(+), 3 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

The identation of VIR_DOMAIN_CONTROLLER_TYPE_PCI elements are in the same level as the parent 'if (def->type == ...TYPE_PCI)' clause, and the closing bracket of this 'if' looks like a misplaced bracket of the 'targetIndex' clause that comes right before it. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_conf.c | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 57ab5b19dd..72ee46026a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9550,40 +9550,40 @@ virDomainControllerDefParseXML(virDomainXMLOption *xmlopt, ntargetNodes = virXPathNodeSet("./target", ctxt, &targetNodes); if (ntargetNodes == 1) { if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) { - if (virXMLPropInt(targetNodes[0], "chassisNr", 0, VIR_XML_PROP_NONE, - &def->opts.pciopts.chassisNr, - def->opts.pciopts.chassisNr) < 0) - return NULL; + if (virXMLPropInt(targetNodes[0], "chassisNr", 0, VIR_XML_PROP_NONE, + &def->opts.pciopts.chassisNr, + def->opts.pciopts.chassisNr) < 0) + return NULL; - if (virXMLPropInt(targetNodes[0], "chassis", 0, VIR_XML_PROP_NONE, - &def->opts.pciopts.chassis, - def->opts.pciopts.chassis) < 0) - return NULL; + if (virXMLPropInt(targetNodes[0], "chassis", 0, VIR_XML_PROP_NONE, + &def->opts.pciopts.chassis, + def->opts.pciopts.chassis) < 0) + return NULL; - if (virXMLPropInt(targetNodes[0], "port", 0, VIR_XML_PROP_NONE, - &def->opts.pciopts.port, - def->opts.pciopts.port) < 0) - return NULL; + if (virXMLPropInt(targetNodes[0], "port", 0, VIR_XML_PROP_NONE, + &def->opts.pciopts.port, + def->opts.pciopts.port) < 0) + return NULL; - if (virXMLPropInt(targetNodes[0], "busNr", 0, VIR_XML_PROP_NONE, - &def->opts.pciopts.busNr, - def->opts.pciopts.busNr) < 0) - return NULL; + if (virXMLPropInt(targetNodes[0], "busNr", 0, VIR_XML_PROP_NONE, + &def->opts.pciopts.busNr, + def->opts.pciopts.busNr) < 0) + return NULL; - if (virXMLPropTristateSwitch(targetNodes[0], "hotplug", - VIR_XML_PROP_NONE, - &def->opts.pciopts.hotplug) < 0) - return NULL; + if (virXMLPropTristateSwitch(targetNodes[0], "hotplug", + VIR_XML_PROP_NONE, + &def->opts.pciopts.hotplug) < 0) + return NULL; - if ((rc = virXMLPropInt(targetNodes[0], "index", 0, VIR_XML_PROP_NONE, - &def->opts.pciopts.targetIndex, - def->opts.pciopts.targetIndex)) < 0) - return NULL; + if ((rc = virXMLPropInt(targetNodes[0], "index", 0, VIR_XML_PROP_NONE, + &def->opts.pciopts.targetIndex, + def->opts.pciopts.targetIndex)) < 0) + return NULL; - if ((rc == 1) && def->opts.pciopts.targetIndex == -1) - virReportError(VIR_ERR_XML_ERROR, - _("Invalid target index '%i' in PCI controller"), - def->opts.pciopts.targetIndex); + if ((rc == 1) && def->opts.pciopts.targetIndex == -1) + virReportError(VIR_ERR_XML_ERROR, + _("Invalid target index '%i' in PCI controller"), + def->opts.pciopts.targetIndex); } } else if (ntargetNodes > 1) { virReportError(VIR_ERR_XML_ERROR, "%s", -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
The identation of VIR_DOMAIN_CONTROLLER_TYPE_PCI elements are in the same level as the parent 'if (def->type == ...TYPE_PCI)' clause, and the closing bracket of this 'if' looks like a misplaced bracket of the 'targetIndex' clause that comes right before it.
Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_conf.c | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

The 'chip-id' attribute indicates which chip/socket that owns the PowerNV pcie-root controller. Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/formatdomain.rst | 6 ++++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 15 +++++++++++++++ src/conf/domain_conf.h | 1 + 4 files changed, 27 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index e2f99c60a6..1e44d9a987 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3898,6 +3898,12 @@ generated by libvirt. :since:`Since 1.2.19 (QEMU only).` ``index`` pci-root controllers for pSeries guests use this attribute to record the order they will show up in the guest. :since:`Since 3.6.0` +``chip-id`` + pcie-root controllers for ``powernv`` domains use this attribute to indicate + the chip that will own the controller. A chip is equivalent to a CPU socket. + E.g. a ``powernv`` domain with ``<topology> sockets=3`` will have 3 chips. + chip-id=0 refers to the first chip, chip-id=1 refers to the second chip and + so on. :since:`Since 8.1.0` For machine types which provide an implicit PCI bus, the pci-root controller with index=0 is auto-added and required to use PCI devices. pci-root has no diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 4c3a1c28a7..47a3107ea1 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2655,6 +2655,11 @@ <ref name="unsignedInt"/> </element> </optional> + <optional> + <attribute name="chip-id"> + <ref name="uint8"/> + </attribute> + </optional> </element> </optional> <!-- *-root controllers have an optional element "pcihole64"--> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 72ee46026a..803c51d63a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2380,6 +2380,7 @@ virDomainControllerDefNew(virDomainControllerType type) def->opts.pciopts.busNr = -1; def->opts.pciopts.targetIndex = -1; def->opts.pciopts.numaNode = -1; + def->opts.pciopts.chipId = -1; break; case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: def->opts.xenbusopts.maxGrantFrames = -1; @@ -9584,6 +9585,16 @@ virDomainControllerDefParseXML(virDomainXMLOption *xmlopt, virReportError(VIR_ERR_XML_ERROR, _("Invalid target index '%i' in PCI controller"), def->opts.pciopts.targetIndex); + + if ((rc = virXMLPropInt(targetNodes[0], "chip-id", 0, VIR_XML_PROP_NONE, + &def->opts.pciopts.chipId, + def->opts.pciopts.chipId)) < 0) + return NULL; + + if ((rc == 1) && def->opts.pciopts.chipId == -1) + virReportError(VIR_ERR_XML_ERROR, + _("Invalid target chip-id '%i' in PCI controller"), + def->opts.pciopts.chipId); } } else if (ntargetNodes > 1) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -23888,6 +23899,7 @@ virDomainControllerDefFormat(virBuffer *buf, def->opts.pciopts.busNr != -1 || def->opts.pciopts.targetIndex != -1 || def->opts.pciopts.numaNode != -1 || + def->opts.pciopts.chipId != -1 || def->opts.pciopts.hotplug != VIR_TRISTATE_SWITCH_ABSENT) { virBufferAddLit(&childBuf, "<target"); if (def->opts.pciopts.chassisNr != -1) @@ -23905,6 +23917,9 @@ virDomainControllerDefFormat(virBuffer *buf, if (def->opts.pciopts.targetIndex != -1) virBufferAsprintf(&childBuf, " index='%d'", def->opts.pciopts.targetIndex); + if (def->opts.pciopts.chipId != -1) + virBufferAsprintf(&childBuf, " chip-id='%d'", + def->opts.pciopts.chipId); if (def->opts.pciopts.hotplug != VIR_TRISTATE_SWITCH_ABSENT) { virBufferAsprintf(&childBuf, " hotplug='%s'", virTristateSwitchTypeToString(def->opts.pciopts.hotplug)); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 1d9c689e83..93c5092f35 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -751,6 +751,7 @@ struct _virDomainPCIControllerOpts { int port; int busNr; /* used by pci-expander-bus, -1 == unspecified */ int targetIndex; /* used by spapr-pci-host-bridge, -1 == unspecified */ + int chipId; /* used by powernv pcie-root controllers, -1 == unspecified */ /* numaNode is a *subelement* of target (to match existing * item in memory target config) -1 == unspecified */ -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
The 'chip-id' attribute indicates which chip/socket that owns the PowerNV pcie-root controller.
Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/formatdomain.rst | 6 ++++++ docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 15 +++++++++++++++ src/conf/domain_conf.h | 1 + 4 files changed, 27 insertions(+)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

We're going to use the 'targetIndex' element for PowerNV PHBs. Clarify that the same attribute will have a different meaning in this context. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/formatdomain.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 1e44d9a987..d700049c1c 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3896,8 +3896,10 @@ generated by libvirt. :since:`Since 1.2.19 (QEMU only).` the user of the libvirt API to attach host devices to the correct pci-expander-bus when assigning them to the domain). ``index`` - pci-root controllers for pSeries guests use this attribute to record the - order they will show up in the guest. :since:`Since 3.6.0` + pci-root controllers for ``pSeries`` guests use this attribute to record the + order they will show up in the guest (:since:`Since 3.6.0`). :since:`Since 8.1.0`, + ``powernv`` domains uses this attribute to indicate the chip/socket slot a + pcie-root controller will use. ``chip-id`` pcie-root controllers for ``powernv`` domains use this attribute to indicate the chip that will own the controller. A chip is equivalent to a CPU socket. -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
We're going to use the 'targetIndex' element for PowerNV PHBs. Clarify that the same attribute will have a different meaning in this context.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/formatdomain.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 1e44d9a987..d700049c1c 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3896,8 +3896,10 @@ generated by libvirt. :since:`Since 1.2.19 (QEMU only).` the user of the libvirt API to attach host devices to the correct pci-expander-bus when assigning them to the domain). ``index`` - pci-root controllers for pSeries guests use this attribute to record the - order they will show up in the guest. :since:`Since 3.6.0` + pci-root controllers for ``pSeries`` guests use this attribute to record the + order they will show up in the guest (:since:`Since 3.6.0`). :since:`Since 8.1.0`, + ``powernv`` domains uses this attribute to indicate the chip/socket slot a + pcie-root controller will use.
The clarification did not help me. I see no difference between this description and the one for the chip-id attribute Jano
``chip-id`` pcie-root controllers for ``powernv`` domains use this attribute to indicate the chip that will own the controller. A chip is equivalent to a CPU socket. -- 2.34.1

On 2/21/22 10:21, Ján Tomko wrote:
On a Tuesday in 2022, Daniel Henrique Barboza wrote:
We're going to use the 'targetIndex' element for PowerNV PHBs. Clarify that the same attribute will have a different meaning in this context.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/formatdomain.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 1e44d9a987..d700049c1c 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3896,8 +3896,10 @@ generated by libvirt. :since:`Since 1.2.19 (QEMU only).` the user of the libvirt API to attach host devices to the correct pci-expander-bus when assigning them to the domain). ``index`` - pci-root controllers for pSeries guests use this attribute to record the - order they will show up in the guest. :since:`Since 3.6.0` + pci-root controllers for ``pSeries`` guests use this attribute to record the + order they will show up in the guest (:since:`Since 3.6.0`). :since:`Since 8.1.0`, + ``powernv`` domains uses this attribute to indicate the chip/socket slot a + pcie-root controller will use.
The clarification did not help me. I see no difference between this description and the one for the chip-id attribute
Changed the description to: ``index`` pci-root controllers for ``pSeries`` guests use this attribute to record the order they will show up in the guest (:since:`Since 3.6.0`). :since:`Since 8.1.0`, ``powernv`` domains uses this attribute to indicate which slot inside the chip the pcie-root controller will use. Thanks, Daniel
Jano
``chip-id`` pcie-root controllers for ``powernv`` domains use this attribute to indicate the chip that will own the controller. A chip is equivalent to a CPU socket. -- 2.34.1

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_conf.c | 21 +++++++++++++++++++++ src/conf/domain_conf.h | 1 + src/libvirt_private.syms | 1 + 3 files changed, 23 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 803c51d63a..13d5eb5b9d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2442,6 +2442,27 @@ virDomainControllerIsPSeriesPHB(const virDomainControllerDef *cont) } +bool +virDomainControllerIsPowerNVPHB(const virDomainControllerDef *cont) +{ + virDomainControllerPCIModelName name; + + /* PowerNV PHBs are pcie-root controllers */ + if (cont->type != VIR_DOMAIN_CONTROLLER_TYPE_PCI || + cont->model != VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) { + return false; + } + + name = cont->opts.pciopts.modelName; + + /* The actual device used for PHBs is pnv-phb3 */ + if (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3) + return false; + + return true; +} + + virDomainFSDef * virDomainFSDefNew(virDomainXMLOption *xmlopt) { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 93c5092f35..adeafa83e7 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3333,6 +3333,7 @@ virDomainControllerDef *virDomainControllerDefNew(virDomainControllerType type); void virDomainControllerDefFree(virDomainControllerDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainControllerDef, virDomainControllerDefFree); bool virDomainControllerIsPSeriesPHB(const virDomainControllerDef *cont); +bool virDomainControllerIsPowerNVPHB(const virDomainControllerDef *cont); virDomainFSDef *virDomainFSDefNew(virDomainXMLOption *xmlopt); void virDomainFSDefFree(virDomainFSDef *def); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index ba3462d849..a18fbd4bb8 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -287,6 +287,7 @@ virDomainControllerFindByType; virDomainControllerFindUnusedIndex; virDomainControllerInsert; virDomainControllerInsertPreAlloced; +virDomainControllerIsPowerNVPHB; virDomainControllerIsPSeriesPHB; virDomainControllerModelIDETypeFromString; virDomainControllerModelIDETypeToString; -- 2.34.1

Missing conf: prefix On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_conf.c | 21 +++++++++++++++++++++ src/conf/domain_conf.h | 1 + src/libvirt_private.syms | 1 + 3 files changed, 23 insertions(+)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

If ommited from the controller definition, chip-id defaults to zero. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain_address.c | 16 +++++++++++++++- src/qemu/qemu_validate.c | 5 +++++ .../powernv8-basic.ppc64-latest.xml | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index f08fea32f5..17c2649fb1 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2844,10 +2844,24 @@ qemuDomainAssignPCIAddresses(virDomainDef *def, goto cleanup; } break; + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: + if (!qemuDomainIsPowerNV(def)) + break; + + /* + * Default to chip-id = 0 since it's guaranteed that one socket + * will always be present. + * + * chipId validation requires CPU topology information that isn't + * available at this point and will be done later on. + */ + if (options->chipId == -1) + options->chipId = 0; + + break; case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE: case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE: case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT: - case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_DEFAULT: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: break; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index e8d86a2280..bce52269a6 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3648,6 +3648,11 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, virReportControllerInvalidValue(cont, model, modelName, "modelName"); return -1; } + + if (pciopts->chipId != -1 && !virDomainControllerIsPowerNVPHB(cont)) { + virReportControllerInvalidOption(cont, model, modelName, "chip-id"); + return -1; + } break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE: diff --git a/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml b/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml index ebbc0653ca..28d86d7d9e 100644 --- a/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml +++ b/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml @@ -19,6 +19,7 @@ <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='pci' index='0' model='pcie-root'> <model name='pnv-phb3'/> + <target chip-id='0'/> </controller> <serial type='pty'> <target type='isa-serial' port='0'> -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
If ommited from the controller definition, chip-id defaults to zero.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain_address.c | 16 +++++++++++++++- src/qemu/qemu_validate.c | 5 +++++ .../powernv8-basic.ppc64-latest.xml | 1 + 3 files changed, 21 insertions(+), 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

As done with the 'chip-id' attribute, use zero as a default targetIndex value for pnv-phb3 devices in case it's absent from the controller definition. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain_address.c | 2 ++ src/qemu/qemu_validate.c | 19 ++++++++++++++++++- .../powernv8-basic.ppc64-latest.xml | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 17c2649fb1..e7a9e6adda 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2858,6 +2858,8 @@ qemuDomainAssignPCIAddresses(virDomainDef *def, if (options->chipId == -1) options->chipId = 0; + if (options->targetIndex == -1) + options->targetIndex = 0; break; case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE: case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE: diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index bce52269a6..765a1d5811 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3732,6 +3732,24 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, } break; + case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: + /* PHBs for PowerNV domains must have a targetIndex */ + if (pciopts->targetIndex == -1 && + virDomainControllerIsPowerNVPHB(cont)) { + virReportControllerMissingOption(cont, model, modelName, "targetIndex"); + return -1; + } + + /* + * targetIndex for pcie-root controllers only applies to + * PowerNV PHBs. + */ + if (pciopts->targetIndex != -1 && + !virDomainControllerIsPowerNVPHB(cont)) { + virReportControllerInvalidOption(cont, model, modelName, "targetIndex"); + return -1; + } + break; case VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE: case VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE: case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: @@ -3739,7 +3757,6 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS: case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS: - case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_TO_PCI_BRIDGE: if (pciopts->targetIndex != -1) { virReportControllerInvalidOption(cont, model, modelName, "targetIndex"); diff --git a/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml b/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml index 28d86d7d9e..bd22d85f6a 100644 --- a/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml +++ b/tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml @@ -19,7 +19,7 @@ <emulator>/usr/bin/qemu-system-ppc64</emulator> <controller type='pci' index='0' model='pcie-root'> <model name='pnv-phb3'/> - <target chip-id='0'/> + <target index='0' chip-id='0'/> </controller> <serial type='pty'> <target type='isa-serial' port='0'> -- 2.34.1

The command line for the pnv-phb3 device is similar to the spapr-pci-host-bridge command line but adding the extra 'chip-id' attribute. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_command.c | 21 +++++++++++++++++-- .../powernv8-basic.ppc64-latest.args | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 2a1fe27297..afb3bf3612 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3221,6 +3221,22 @@ qemuBuildControllerPCIDevProps(virDomainControllerDef *def, break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: + if (!virDomainControllerIsPowerNVPHB(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Unsupported PCI Express root controller")); + return -1; + } + + if (virJSONValueObjectAdd(&props, + "s:driver", modelName, + "i:index", pciopts->targetIndex, + "i:chip-id", pciopts->chipId, + "s:id", def->info.alias, + NULL) < 0) + return -1; + + break; + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Unsupported PCI Express root controller")); return -1; @@ -3408,8 +3424,9 @@ static bool qemuBuildSkipController(const virDomainControllerDef *controller, const virDomainDef *def) { - /* skip pcie-root */ - if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI && + /* skip pcie-root for non PowerVM domains */ + if (!qemuDomainIsPowerNV(def) && + controller->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI && controller->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) return true; diff --git a/tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args b/tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args index c9616ded13..224e2adba8 100644 --- a/tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args +++ b/tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args @@ -26,6 +26,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ +-device '{"driver":"pnv-phb3","index":0,"chip-id":0,"id":"pcie.0"}' \ -usb \ -chardev pty,id=charserial0 \ -device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
The command line for the pnv-phb3 device is similar to the spapr-pci-host-bridge command line but adding the extra 'chip-id' attribute.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_command.c | 21 +++++++++++++++++-- .../powernv8-basic.ppc64-latest.args | 1 + 2 files changed, 20 insertions(+), 2 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

The PowerNV PHB3 bus has minimal slot zero. In fact, at this moment, the root complex accepts only a single device, at slot 0x0, due to firmware limitations. The single device restriction is subject to change in upstream QEMU and it's not worth adding this limitation to Libvirt. However, the minimal slot presents a problem. When setting a pnv-phb3-root-port address with slot=0x0, Libvirt changes it to 0x1. This happens because the pnv-phb3 controller is a PCIE_ROOT model, and this model is being set with 'bus->minSlot=1' in domain_addr.c, virDomainPCIAddressBusSetModel(). This means that the root-port is launched with 'addr=0x1' in the QEMU command line and it's not usable by the domain. It is not worth to create a new controller model, replicating all the already existing logic for PCIE_ROOT controllers, just to have a similar PCIE_ROOT bus with minSlots=0. Changing the existing PCIE_ROOT min slot to 0 doesn't make sense either - we would change existing behavior of existing devices. This patch works around this situation by adding a verification in qemuDomainPCIAddressSetCreate() to change the minBus values of the pnv-phb3 devices right before virDomainDeviceInfoIterate(). This is enough to allow for a root port to be added in slot 0 of a pnv-phb3 bus while not being intrusive with existing devices. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_domain_address.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index e7a9e6adda..7d60d277e8 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1628,6 +1628,17 @@ qemuDomainCollectPCIAddressExtension(virDomainDef *def G_GNUC_UNUSED, return virDomainPCIAddressExtensionReserveAddr(addrs, addr); } +static void +qemuDomainTunePowerNVPhbBuses(virDomainPCIAddressSet *addrs) +{ + size_t i; + + for (i = 0; i < addrs->nbuses; i++) { + if (addrs->buses[i].model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) + addrs->buses[i].minSlot = 0; + } +} + static virDomainPCIAddressSet * qemuDomainPCIAddressSetCreate(virDomainDef *def, virQEMUCaps *qemuCaps, @@ -1720,6 +1731,9 @@ qemuDomainPCIAddressSetCreate(virDomainDef *def, virDomainControllerModelPCITypeToString(defaultModel), i); } + if (qemuDomainIsPowerNV(def)) + qemuDomainTunePowerNVPhbBuses(addrs); + if (virDomainDeviceInfoIterate(def, qemuDomainCollectPCIAddress, addrs) < 0) goto error; -- 2.34.1

Hiding the empty (0000:00:0.0) PCI address in the case of devices that will connect to slot 0x0 can be counterintuitive to the user, which will see something like this: <controller type='pci' index='0' model='pcie-root'/> <controller type='pci' index='1' model='pcie-root-port'> <model name='pnv-phb3-root-port'/> <target chassis='1' port='0x8'/> </controller> Even if the user deliberately adds the root-port <address> element: <address type='pci' domain='0x0000' bus='0x00' slot='0x00' function='0x0'/> We end up removing the <address> element after saving the domain file. This happens because virPCIDeviceAddressIsEmpty() can't distinguish between a zeroed address that was set by the user versus an address that wasn't filled at all. Given that all root-ports of PowerNV domains will connect to slot 0 of the PHB, if the PHB controller has index = 0 this scenario will occur every time. This patch aims to alleaviate this behavior by adding a new virDomainDefFormatFlags that will allow an empty address to be formatted in the XML. This flag is then used only when formatting PowerNV root ports. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_conf.c | 25 ++++++++++++++++++++++++- src/conf/domain_conf.h | 2 ++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 13d5eb5b9d..026d801682 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2463,6 +2463,25 @@ virDomainControllerIsPowerNVPHB(const virDomainControllerDef *cont) } +static bool +virDomainControllerIsPowerNVRootPort(const virDomainControllerDef *cont) +{ + virDomainControllerPCIModelName name; + + if (cont->type != VIR_DOMAIN_CONTROLLER_TYPE_PCI || + cont->model != VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT) { + return false; + } + + name = cont->opts.pciopts.modelName; + + if (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT) + return false; + + return true; +} + + virDomainFSDef * virDomainFSDefNew(virDomainXMLOption *xmlopt) { @@ -6490,7 +6509,8 @@ virDomainDeviceInfoFormat(virBuffer *buf, switch ((virDomainDeviceAddressType) info->type) { case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI: - if (!virPCIDeviceAddressIsEmpty(&info->addr.pci)) { + if (!virPCIDeviceAddressIsEmpty(&info->addr.pci) || + flags & VIR_DOMAIN_DEF_FORMAT_EMPTY_PCI_ADDR) { virBufferAsprintf(&attrBuf, " domain='0x%04x' bus='0x%02x' " "slot='0x%02x' function='0x%d'", info->addr.pci.domain, @@ -23958,6 +23978,9 @@ virDomainControllerDefFormat(virBuffer *buf, } } + if (virDomainControllerIsPowerNVRootPort(def)) + flags |= VIR_DOMAIN_DEF_FORMAT_EMPTY_PCI_ADDR; + virDomainControllerDriverFormat(&childBuf, def); virDomainDeviceInfoFormat(&childBuf, &def->info, flags); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index adeafa83e7..dd3d942a35 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3502,6 +3502,8 @@ typedef enum { VIR_DOMAIN_DEF_FORMAT_ALLOW_ROM = 1 << 6, VIR_DOMAIN_DEF_FORMAT_ALLOW_BOOT = 1 << 7, VIR_DOMAIN_DEF_FORMAT_CLOCK_ADJUST = 1 << 8, + /* format empty PCI addr (0000:00:0.0) */ + VIR_DOMAIN_DEF_FORMAT_EMPTY_PCI_ADDR = 1 << 9, } virDomainDefFormatFlags; /* Use these flags to skip specific domain ABI consistency checks done -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Hiding the empty (0000:00:0.0) PCI address in the case of devices that will connect to slot 0x0 can be counterintuitive to the user, which will see something like this:
<controller type='pci' index='0' model='pcie-root'/> <controller type='pci' index='1' model='pcie-root-port'> <model name='pnv-phb3-root-port'/> <target chassis='1' port='0x8'/> </controller>
Even if the user deliberately adds the root-port <address> element:
<address type='pci' domain='0x0000' bus='0x00' slot='0x00' function='0x0'/>
We end up removing the <address> element after saving the domain file. This happens because virPCIDeviceAddressIsEmpty() can't distinguish between a zeroed address that was set by the user versus an address that wasn't filled at all.
I'm afraid this is incomplete. virPCIDeviceAddressIsEmpty is for example used to figure out whether the device needs an address assigned too. So we'll need an extra field to distinguish between empty and zero addresses, which will probably need adjustment in a lot of callers :( Jano
Given that all root-ports of PowerNV domains will connect to slot 0 of the PHB, if the PHB controller has index = 0 this scenario will occur every time. This patch aims to alleaviate this behavior by adding a new virDomainDefFormatFlags that will allow an empty address to be formatted in the XML. This flag is then used only when formatting PowerNV root ports.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_conf.c | 25 ++++++++++++++++++++++++- src/conf/domain_conf.h | 2 ++ 2 files changed, 26 insertions(+), 1 deletion(-)

On 2/21/22 10:36, Ján Tomko wrote:
On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Hiding the empty (0000:00:0.0) PCI address in the case of devices that will connect to slot 0x0 can be counterintuitive to the user, which will see something like this:
<controller type='pci' index='0' model='pcie-root'/> <controller type='pci' index='1' model='pcie-root-port'> <model name='pnv-phb3-root-port'/> <target chassis='1' port='0x8'/> </controller>
Even if the user deliberately adds the root-port <address> element:
<address type='pci' domain='0x0000' bus='0x00' slot='0x00' function='0x0'/>
We end up removing the <address> element after saving the domain file. This happens because virPCIDeviceAddressIsEmpty() can't distinguish between a zeroed address that was set by the user versus an address that wasn't filled at all.
I'm afraid this is incomplete.
virPCIDeviceAddressIsEmpty is for example used to figure out whether the device needs an address assigned too.
So we'll need an extra field to distinguish between empty and zero addresses, which will probably need adjustment in a lot of callers :(
Hmmm I don't think this is a hill I want to die on in this series. This patch is already adding a "VIR_DOMAIN_DEF_FORMAT_EMPTY_PCI_ADDR" flag to force the address formatting regardless of virPCIDeviceAddressIsEmpty(). I believe that I can rename it to "VIR_DOMAIN_DEF_FORMAT_PCI_ADDR", making it clear that the idea is to force the <addr> formatting at all times for the device, regardless of any assumptions about the address being empty, or not assigned, or any other cases where virPCIDeviceAddressIsEmpty() might apply. Thanks, Daniel
Jano
Given that all root-ports of PowerNV domains will connect to slot 0 of the PHB, if the PHB controller has index = 0 this scenario will occur every time. This patch aims to alleaviate this behavior by adding a new virDomainDefFormatFlags that will allow an empty address to be formatted in the XML. This flag is then used only when formatting PowerNV root ports.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_conf.c | 25 ++++++++++++++++++++++++- src/conf/domain_conf.h | 2 ++ 2 files changed, 26 insertions(+), 1 deletion(-)

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- .../powernv8-root-port.ppc64-latest.args | 35 +++++++++++++++++ tests/qemuxml2argvdata/powernv8-root-port.xml | 17 ++++++++ tests/qemuxml2argvtest.c | 1 + .../powernv8-root-port.ppc64-latest.xml | 39 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 5 files changed, 93 insertions(+) create mode 100644 tests/qemuxml2argvdata/powernv8-root-port.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-root-port.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-root-port.ppc64-latest.xml diff --git a/tests/qemuxml2argvdata/powernv8-root-port.ppc64-latest.args b/tests/qemuxml2argvdata/powernv8-root-port.ppc64-latest.args new file mode 100644 index 0000000000..b32e49c54e --- /dev/null +++ b/tests/qemuxml2argvdata/powernv8-root-port.ppc64-latest.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-ppc64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine powernv8,usb=off,dump-guest-core=off,memory-backend=pnv.ram \ +-accel tcg \ +-cpu POWER8 \ +-m 2048 \ +-object '{"qom-type":"memory-backend-ram","id":"pnv.ram","size":2147483648}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid b20fcfe3-4a0a-4039-8735-9e024256e0f7 \ +-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 \ +-device '{"driver":"pnv-phb3","index":0,"chip-id":0,"id":"pcie.0"}' \ +-device '{"driver":"pnv-phb3-root-port","port":0,"chassis":1,"id":"pci.1","bus":"pcie.0","addr":"0x0"}' \ +-usb \ +-chardev pty,id=charserial0 \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/powernv8-root-port.xml b/tests/qemuxml2argvdata/powernv8-root-port.xml new file mode 100644 index 0000000000..1acb37222d --- /dev/null +++ b/tests/qemuxml2argvdata/powernv8-root-port.xml @@ -0,0 +1,17 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid> + <memory unit='KiB'>2097152</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='powernv8'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'/> + <console type='pty'> + <target type='serial' port='0'/> + </console> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index de5582a52c..70b57a239f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2243,6 +2243,7 @@ mymain(void) DO_TEST_PARSE_ERROR_NOCAPS("seclabel-device-duplicates"); DO_TEST_CAPS_ARCH_LATEST("powernv8-basic", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("powernv8-root-port", "ppc64"); DO_TEST("pseries-basic", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, diff --git a/tests/qemuxml2xmloutdata/powernv8-root-port.ppc64-latest.xml b/tests/qemuxml2xmloutdata/powernv8-root-port.ppc64-latest.xml new file mode 100644 index 0000000000..a24154c47f --- /dev/null +++ b/tests/qemuxml2xmloutdata/powernv8-root-port.ppc64-latest.xml @@ -0,0 +1,39 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='powernv8'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>POWER8</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-ppc64</emulator> + <controller type='pci' index='0' model='pcie-root'> + <model name='pnv-phb3'/> + <target index='0' chip-id='0'/> + </controller> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pnv-phb3-root-port'/> + <target chassis='1' port='0x0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x00' function='0x0'/> + </controller> + <serial type='pty'> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <audio id='1' type='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 1815d9ac1d..596907a25e 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -663,6 +663,7 @@ mymain(void) DO_TEST_CAPS_LATEST("virtio-rng-builtin"); DO_TEST_CAPS_ARCH_LATEST("powernv8-basic", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("powernv8-root-port", "ppc64"); DO_TEST("pseries-nvram", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- .../powernv8-root-port.ppc64-latest.args | 35 +++++++++++++++++ tests/qemuxml2argvdata/powernv8-root-port.xml | 17 ++++++++ tests/qemuxml2argvtest.c | 1 + .../powernv8-root-port.ppc64-latest.xml | 39 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 5 files changed, 93 insertions(+) create mode 100644 tests/qemuxml2argvdata/powernv8-root-port.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-root-port.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-root-port.ppc64-latest.xml
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

PowerNV PHBs uses the 'targetIndex' attribute in a different manner than pSeries PHBs, having no restiction of targetIndex = 0 in controllers with non-zero indexes. This can happen when the domain has 2 or more sockets and the pnv-phb3 controller can have targetIndex=0 in a different chip-id. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_validate.c | 5 ++- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_validate.c | 5 +++ .../powernv8-two-sockets.ppc64-latest.args | 35 +++++++++++++++++ .../qemuxml2argvdata/powernv8-two-sockets.xml | 26 +++++++++++++ tests/qemuxml2argvtest.c | 1 + .../powernv8-two-sockets.ppc64-latest.xml | 39 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 8 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 tests/qemuxml2argvdata/powernv8-two-sockets.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-two-sockets.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-two-sockets.ppc64-latest.xml diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index e9baf1d41a..5510cb073b 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -1055,8 +1055,9 @@ virDomainControllerDefValidate(const virDomainControllerDef *controller) return -1; } - if ((controller->idx == 0 && opts->targetIndex != 0) || - (controller->idx != 0 && opts->targetIndex == 0)) { + if (!virDomainControllerIsPowerNVPHB(controller) && + ((controller->idx == 0 && opts->targetIndex != 0) || + (controller->idx != 0 && opts->targetIndex == 0))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Only the PCI controller with index 0 can " "have target index 0, and vice versa")); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 89dbc20eee..b58f35390d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5092,7 +5092,7 @@ qemuDomainControllerDefPostParse(virDomainControllerDef *cont, /* pSeries guests can have multiple pci-root controllers, * but other machine types only support a single one */ - if (!qemuDomainIsPSeries(def) && + if (!qemuDomainIsPowerPC(def) && (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT || cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT) && cont->idx != 0) { diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 765a1d5811..bb6ff2e70e 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3696,6 +3696,11 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, break; } + /* PowerNV domains, like pSeries guest, can also have + * multiple PHBs. */ + if (virDomainControllerIsPowerNVPHB(cont)) + break; + /* For all other pci-root and pcie-root controllers, though, * the index must be zero */ if (cont->idx != 0) { diff --git a/tests/qemuxml2argvdata/powernv8-two-sockets.ppc64-latest.args b/tests/qemuxml2argvdata/powernv8-two-sockets.ppc64-latest.args new file mode 100644 index 0000000000..67f0611d79 --- /dev/null +++ b/tests/qemuxml2argvdata/powernv8-two-sockets.ppc64-latest.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-ppc64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine powernv8,usb=off,dump-guest-core=off,memory-backend=pnv.ram \ +-accel tcg \ +-cpu POWER8 \ +-m 2048 \ +-object '{"qom-type":"memory-backend-ram","id":"pnv.ram","size":2147483648}' \ +-overcommit mem-lock=off \ +-smp 2,sockets=2,dies=1,cores=1,threads=1 \ +-uuid b20fcfe3-4a0a-4039-8735-9e024256e0f7 \ +-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 \ +-device '{"driver":"pnv-phb3","index":0,"chip-id":0,"id":"pcie.0"}' \ +-device '{"driver":"pnv-phb3","index":0,"chip-id":1,"id":"pcie.1"}' \ +-usb \ +-chardev pty,id=charserial0 \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/powernv8-two-sockets.xml b/tests/qemuxml2argvdata/powernv8-two-sockets.xml new file mode 100644 index 0000000000..c6f2024a33 --- /dev/null +++ b/tests/qemuxml2argvdata/powernv8-two-sockets.xml @@ -0,0 +1,26 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid> + <memory unit='KiB'>2097152</memory> + <vcpu placement='static'>2</vcpu> + <os> + <type arch='ppc64' machine='powernv8'>hvm</type> + </os> + <cpu> + <topology sockets='2' dies='1' cores='1' threads='1'/> + </cpu> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='pci' index='0' model='pcie-root'> + <model name='pnv-phb3'/> + <target index='0' chip-id='0'/> + </controller> + <controller type='pci' index='1' model='pcie-root'> + <model name='pnv-phb3'/> + <target index='0' chip-id='1'/> + </controller> + <console type='pty'> + <target type='serial' port='0'/> + </console> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 70b57a239f..313d082d46 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2244,6 +2244,7 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("powernv8-basic", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("powernv8-root-port", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("powernv8-two-sockets", "ppc64"); DO_TEST("pseries-basic", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, diff --git a/tests/qemuxml2xmloutdata/powernv8-two-sockets.ppc64-latest.xml b/tests/qemuxml2xmloutdata/powernv8-two-sockets.ppc64-latest.xml new file mode 100644 index 0000000000..5d48b79b9f --- /dev/null +++ b/tests/qemuxml2xmloutdata/powernv8-two-sockets.ppc64-latest.xml @@ -0,0 +1,39 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>2</vcpu> + <os> + <type arch='ppc64' machine='powernv8'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>POWER8</model> + <topology sockets='2' dies='1' cores='1' threads='1'/> + </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-ppc64</emulator> + <controller type='pci' index='0' model='pcie-root'> + <model name='pnv-phb3'/> + <target index='0' chip-id='0'/> + </controller> + <controller type='pci' index='1' model='pcie-root'> + <model name='pnv-phb3'/> + <target index='0' chip-id='1'/> + </controller> + <serial type='pty'> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <audio id='1' type='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 596907a25e..4171a83953 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -664,6 +664,7 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("powernv8-basic", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("powernv8-root-port", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("powernv8-two-sockets", "ppc64"); DO_TEST("pseries-nvram", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -- 2.34.1

These devices must have unique targetIndex/chip-id pairs. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_conf.c | 35 +++++++++++++++++++ tests/qemuxml2argvdata/powernv8-dupPHBs.err | 1 + .../powernv8-dupPHBs.ppc64-latest.err | 1 + tests/qemuxml2argvdata/powernv8-dupPHBs.xml | 27 ++++++++++++++ tests/qemuxml2argvtest.c | 1 + 5 files changed, 65 insertions(+) create mode 100644 tests/qemuxml2argvdata/powernv8-dupPHBs.err create mode 100644 tests/qemuxml2argvdata/powernv8-dupPHBs.ppc64-latest.err create mode 100644 tests/qemuxml2argvdata/powernv8-dupPHBs.xml diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 026d801682..d27aafd771 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2482,6 +2482,33 @@ virDomainControllerIsPowerNVRootPort(const virDomainControllerDef *cont) } +/* Caller must ensure that 'cont' is a PowerNV PHB device */ +static bool +virDomainControllerDuplicatedPHB(virDomainDef *def, + virDomainControllerDef *cont) +{ + int chipId = cont->opts.pciopts.chipId; + int targetIndex = cont->opts.pciopts.targetIndex; + size_t i; + + for (i = 0; i < def->ncontrollers; i++) { + virDomainControllerDef *cont2 = def->controllers[i]; + + if (!virDomainControllerIsPowerNVPHB(cont2)) + continue; + + if (cont2 == cont) + continue; + + if (cont2->opts.pciopts.chipId == chipId && + cont2->opts.pciopts.targetIndex == targetIndex) + return true; + } + + return false; +} + + virDomainFSDef * virDomainFSDefNew(virDomainXMLOption *xmlopt) { @@ -4738,6 +4765,14 @@ virDomainDefRejectDuplicateControllers(virDomainDef *def) cont->idx); goto cleanup; } + + if (virDomainControllerIsPowerNVPHB(cont) && + virDomainControllerDuplicatedPHB(def, cont)) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("Multiple pnv-phb controllers with same chip-id and index")); + goto cleanup; + } + ignore_value(virBitmapSetBit(bitmaps[cont->type], cont->idx)); } diff --git a/tests/qemuxml2argvdata/powernv8-dupPHBs.err b/tests/qemuxml2argvdata/powernv8-dupPHBs.err new file mode 100644 index 0000000000..bc5879640d --- /dev/null +++ b/tests/qemuxml2argvdata/powernv8-dupPHBs.err @@ -0,0 +1 @@ +XML error: Multiple pnv-phb controllers with same chip-id and index diff --git a/tests/qemuxml2argvdata/powernv8-dupPHBs.ppc64-latest.err b/tests/qemuxml2argvdata/powernv8-dupPHBs.ppc64-latest.err new file mode 100644 index 0000000000..bc5879640d --- /dev/null +++ b/tests/qemuxml2argvdata/powernv8-dupPHBs.ppc64-latest.err @@ -0,0 +1 @@ +XML error: Multiple pnv-phb controllers with same chip-id and index diff --git a/tests/qemuxml2argvdata/powernv8-dupPHBs.xml b/tests/qemuxml2argvdata/powernv8-dupPHBs.xml new file mode 100644 index 0000000000..43ee3051eb --- /dev/null +++ b/tests/qemuxml2argvdata/powernv8-dupPHBs.xml @@ -0,0 +1,27 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid> + <memory unit='KiB'>2097152</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='powernv8'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='pci' index='0' model='pcie-root'> + <model name='pnv-phb3'/> + <target index='0' chip-id='0'/> + </controller> + <controller type='pci' index='1' model='pcie-root'> + <model name='pnv-phb3'/> + <target index='1' chip-id='0'/> + </controller> + <controller type='pci' index='2' model='pcie-root'> + <model name='pnv-phb3'/> + <target index='1' chip-id='0'/> + </controller> + <console type='pty'> + <target type='serial' port='0'/> + </console> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 313d082d46..1ca0fd4633 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2245,6 +2245,7 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("powernv8-basic", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("powernv8-root-port", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("powernv8-two-sockets", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("powernv8-dupPHBs", "ppc64"); DO_TEST("pseries-basic", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -- 2.34.1

This capability enables two devices: - pnv-phb4 device, the pcie-root controller for PowerNV9 domains - pnv-phb4-root-port, the pcie-root-port model that is used with the pnv-phb4 device. As with the pnv-phb3 devices, these are also user creatable only after QEMU 6.2.0 but the capability is available since 5.0.0, meaning that we need to check QEMU version and arch manually before setting it. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/qemu/qemu_capabilities.c | 7 ++++++- src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index d60240912c..668579dbcc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -663,6 +663,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "device.json+hotplug", /* QEMU_CAPS_DEVICE_JSON */ "hvf", /* QEMU_CAPS_HVF */ "pnv-phb3", /* QEMU_CAPS_DEVICE_PNV_PHB3 */ + "pnv-phb4", /* QEMU_CAPS_DEVICE_PNV_PHB4 */ ); @@ -1403,6 +1404,8 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { * * { "pnv-phb3", QEMU_CAPS_DEVICE_PNV_PHB3 }, * { "pnv-phb3-root-port", QEMU_CAPS_DEVICE_PNV_PHB3 }, + * { "pnv-phb4", QEMU_CAPS_DEVICE_PNV_PHB4 }, + * { "pnv-phb4-root-port", QEMU_CAPS_DEVICE_PNV_PHB4 }, * * Because they are present in QEMU binaries since QEMU 5.0.0 * but became user creatable only in the QEMU 7.0.0 development @@ -5248,8 +5251,10 @@ virQEMUCapsInitQMPVersionCaps(virQEMUCaps *qemuCaps) * QEMU 6.2.0. The version value set here was taken from a * binary post 6.2.0 release that has user creatable pnv-phb * support. */ - if (qemuCaps->version >= 6002050 && ARCH_IS_PPC64(qemuCaps->arch)) + if (qemuCaps->version >= 6002050 && ARCH_IS_PPC64(qemuCaps->arch)) { virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_PNV_PHB3); + virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_PNV_PHB4); + } } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index ed3973c0ba..f69155f863 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -638,6 +638,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_DEVICE_JSON, /* -device accepts JSON (and works with hot-unplug) */ QEMU_CAPS_HVF, /* Whether Hypervisor.framework is available */ QEMU_CAPS_DEVICE_PNV_PHB3, /* devices pnv-phb3 and pnv-phb3-root-port */ + QEMU_CAPS_DEVICE_PNV_PHB4, /* devices pnv-phb4 and pnv-phb4-root-port */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml index cb6c146a28..9833c5548e 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0.ppc64.xml @@ -201,6 +201,7 @@ <flag name='sev-guest-kernel-hashes'/> <flag name='device.json+hotplug'/> <flag name='pnv-phb3'/> + <flag name='pnv-phb4'/> <version>6002050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>42900243</microcodeVersion> -- 2.34.1

This device is an implementation of pcie-root-port, similar to its sibling pnv-phb3-root-port. Since it's a new model name that Libvirt automatically sets, we refrain from documenting it to users. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_domain_address.c | 14 +++++++++++++- src/qemu/qemu_validate.c | 8 ++++++-- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 47a3107ea1..116fedc19e 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2605,6 +2605,7 @@ <value>ioh3420</value> <value>pcie-root-port</value> <value>pnv-phb3-root-port</value> + <value>pnv-phb4-root-port</value> <!-- implementations of "pcie-switch-upstream-port" --> <value>x3130-upstream</value> <!-- implementations of "pcie-switch-downstream-port" --> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d27aafd771..2b862ffb86 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -440,6 +440,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName, "pcie-pci-bridge", "pnv-phb3-root-port", "pnv-phb3", + "pnv-phb4-root-port", ); VIR_ENUM_IMPL(virDomainControllerModelSCSI, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index dd3d942a35..6532b78322 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -648,6 +648,7 @@ typedef enum { VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_PCI_BRIDGE, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3, + VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST } virDomainControllerPCIModelName; diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 7d60d277e8..e18cc81f04 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2412,6 +2412,18 @@ qemuDomainAssignDevicePCISlots(virDomainDef *def, } +static virDomainControllerPCIModelName +virDomainControllerGetPowerNVRootPortName(virDomainDef *def) +{ + if (STREQ(def->os.machine, "powernv8")) + return VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT; + else if (STREQ(def->os.machine, "powernv9")) + return VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT; + + return VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE; +} + + static void qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef *cont, virDomainDef *def, @@ -2435,7 +2447,7 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef *cont, break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: if (qemuDomainIsPowerNV(def)) { - *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT; + *modelName = virDomainControllerGetPowerNVRootPortName(def); break; } diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index bb6ff2e70e..6f49a5f17b 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3432,6 +3432,8 @@ virValidateControllerPCIModelNameToQEMUCaps(int modelName) return QEMU_CAPS_DEVICE_PNV_PHB3; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3: return QEMU_CAPS_DEVICE_PNV_PHB3; + case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT: + return QEMU_CAPS_DEVICE_PNV_PHB4; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE: return 0; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST: @@ -3601,12 +3603,14 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT: if (pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420 && pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT && - pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT) { + pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT && + pciopts->modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT) { virReportControllerInvalidValue(cont, model, modelName, "modelName"); return -1; } - if (pciopts->modelName == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT && + if ((pciopts->modelName == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT || + pciopts->modelName == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT) && !qemuDomainIsPowerNV(def)) { virReportControllerInvalidValue(cont, model, modelName, "modelName"); return -1; -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
This device is an implementation of pcie-root-port, similar to its sibling pnv-phb3-root-port. Since it's a new model name that Libvirt automatically sets, we refrain from documenting it to users.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 1 + src/conf/domain_conf.h | 1 + src/qemu/qemu_domain_address.c | 14 +++++++++++++- src/qemu/qemu_validate.c | 8 ++++++-- 5 files changed, 22 insertions(+), 3 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Make the virDomainControllerIsPowerNVRootPort() helper recognize pnv-phb4-root-port as a PowerNV root port. This will spare us from duplicating checks where the constraints of pnv-phb3-root-port also applies for the pnv-phb4-root-port device. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2b862ffb86..0305c913d9 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2476,7 +2476,8 @@ virDomainControllerIsPowerNVRootPort(const virDomainControllerDef *cont) name = cont->opts.pciopts.modelName; - if (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT) + if ((name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT) && + (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT)) return false; return true; -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Make the virDomainControllerIsPowerNVRootPort() helper recognize pnv-phb4-root-port as a PowerNV root port. This will spare us from duplicating checks where the constraints of pnv-phb3-root-port also applies for the pnv-phb4-root-port device.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Similar to the existing pnv-phb3 device, pnv-phb4 is also an implementation of pcie-root. No user doc is needed in this case since the user doesn't ideally set PCI model names manually. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 1 + src/qemu/qemu_domain_address.c | 14 +++++++++++++- src/qemu/qemu_validate.c | 2 ++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 116fedc19e..dce2548825 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2599,6 +2599,7 @@ <value>i82801b11-bridge</value> <!-- implementations of "pcie-root" --> <value>pnv-phb3</value> + <value>pnv-phb4</value> <!-- implementations of "pcie-to-pci-bridge" --> <value>pcie-pci-bridge</value> <!-- implementations of "pcie-root-port" --> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0305c913d9..585e7d9dae 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -441,6 +441,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName, "pnv-phb3-root-port", "pnv-phb3", "pnv-phb4-root-port", + "pnv-phb4", ); VIR_ENUM_IMPL(virDomainControllerModelSCSI, @@ -2456,7 +2457,6 @@ virDomainControllerIsPowerNVPHB(const virDomainControllerDef *cont) name = cont->opts.pciopts.modelName; - /* The actual device used for PHBs is pnv-phb3 */ if (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3) return false; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 6532b78322..2755a19e2d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -649,6 +649,7 @@ typedef enum { VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3_ROOT_PORT, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT, + VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4, VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST } virDomainControllerPCIModelName; diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index e18cc81f04..615182cb85 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -2424,6 +2424,18 @@ virDomainControllerGetPowerNVRootPortName(virDomainDef *def) } +static virDomainControllerPCIModelName +virDomainControllerGetPowerNVPHBName(virDomainDef *def) +{ + if (STREQ(def->os.machine, "powernv8")) + return VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3; + else if (STREQ(def->os.machine, "powernv9")) + return VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4; + + return VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE; +} + + static void qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef *cont, virDomainDef *def, @@ -2476,7 +2488,7 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef *cont, break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT: if (qemuDomainIsPowerNV(def)) - *modelName = VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3; + *modelName = virDomainControllerGetPowerNVPHBName(def); break; case VIR_DOMAIN_CONTROLLER_MODEL_PCI_DEFAULT: case VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST: diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 6f49a5f17b..fb907a3109 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3434,6 +3434,8 @@ virValidateControllerPCIModelNameToQEMUCaps(int modelName) return QEMU_CAPS_DEVICE_PNV_PHB3; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4_ROOT_PORT: return QEMU_CAPS_DEVICE_PNV_PHB4; + case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4: + return QEMU_CAPS_DEVICE_PNV_PHB4; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE: return 0; case VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_LAST: -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Similar to the existing pnv-phb3 device, pnv-phb4 is also an implementation of pcie-root. No user doc is needed in this case since the user doesn't ideally set PCI model names manually.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 1 + src/qemu/qemu_domain_address.c | 14 +++++++++++++- src/qemu/qemu_validate.c | 2 ++ 5 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 116fedc19e..dce2548825 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2599,6 +2599,7 @@ <value>i82801b11-bridge</value> <!-- implementations of "pcie-root" --> <value>pnv-phb3</value> + <value>pnv-phb4</value> <!-- implementations of "pcie-to-pci-bridge" --> <value>pcie-pci-bridge</value> <!-- implementations of "pcie-root-port" --> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0305c913d9..585e7d9dae 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -441,6 +441,7 @@ VIR_ENUM_IMPL(virDomainControllerPCIModelName, "pnv-phb3-root-port", "pnv-phb3", "pnv-phb4-root-port", + "pnv-phb4", );
VIR_ENUM_IMPL(virDomainControllerModelSCSI, @@ -2456,7 +2457,6 @@ virDomainControllerIsPowerNVPHB(const virDomainControllerDef *cont)
name = cont->opts.pciopts.modelName;
- /* The actual device used for PHBs is pnv-phb3 */
This removal is suspicious. Better to not add the comment in the first place.
if (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3) return false;
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Update the virDomainControllerIsPowerNVPHB() helper to make the pnv-phb4 device receive the same handling as the existing pnv-phb3. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 585e7d9dae..42c0bd29da 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2457,7 +2457,8 @@ virDomainControllerIsPowerNVPHB(const virDomainControllerDef *cont) name = cont->opts.pciopts.modelName; - if (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3) + if ((name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB3) && + (name != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PNV_PHB4)) return false; return true; -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Update the virDomainControllerIsPowerNVPHB() helper to make the pnv-phb4 device receive the same handling as the existing pnv-phb3.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- src/conf/domain_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Since the nuances of PowerNV PHBs and root ports were already handled when adding support for pnv-phb3* devices, we're already set to support PowerNV9 PHBs and root ports as well. Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- .../powernv9-dupPHBs.ppc64-latest.err | 1 + tests/qemuxml2argvdata/powernv9-dupPHBs.xml | 27 +++++++++++++ .../powernv9-root-port.ppc64-latest.args | 35 +++++++++++++++++ tests/qemuxml2argvdata/powernv9-root-port.xml | 17 ++++++++ tests/qemuxml2argvtest.c | 2 + .../powernv9-root-port.ppc64-latest.xml | 39 +++++++++++++++++++ .../qemuxml2xmloutdata/powernv9-root-port.xml | 36 +++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 8 files changed, 158 insertions(+) create mode 100644 tests/qemuxml2argvdata/powernv9-dupPHBs.ppc64-latest.err create mode 100644 tests/qemuxml2argvdata/powernv9-dupPHBs.xml create mode 100644 tests/qemuxml2argvdata/powernv9-root-port.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv9-root-port.xml create mode 100644 tests/qemuxml2xmloutdata/powernv9-root-port.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv9-root-port.xml diff --git a/tests/qemuxml2argvdata/powernv9-dupPHBs.ppc64-latest.err b/tests/qemuxml2argvdata/powernv9-dupPHBs.ppc64-latest.err new file mode 100644 index 0000000000..bc5879640d --- /dev/null +++ b/tests/qemuxml2argvdata/powernv9-dupPHBs.ppc64-latest.err @@ -0,0 +1 @@ +XML error: Multiple pnv-phb controllers with same chip-id and index diff --git a/tests/qemuxml2argvdata/powernv9-dupPHBs.xml b/tests/qemuxml2argvdata/powernv9-dupPHBs.xml new file mode 100644 index 0000000000..49af69e6c4 --- /dev/null +++ b/tests/qemuxml2argvdata/powernv9-dupPHBs.xml @@ -0,0 +1,27 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid> + <memory unit='KiB'>2097152</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='powernv9'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='pci' index='0' model='pcie-root'> + <model name='pnv-phb4'/> + <target index='0' chip-id='0'/> + </controller> + <controller type='pci' index='1' model='pcie-root'> + <model name='pnv-phb4'/> + <target index='1' chip-id='0'/> + </controller> + <controller type='pci' index='2' model='pcie-root'> + <model name='pnv-phb4'/> + <target index='1' chip-id='0'/> + </controller> + <console type='pty'> + <target type='serial' port='0'/> + </console> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/powernv9-root-port.ppc64-latest.args b/tests/qemuxml2argvdata/powernv9-root-port.ppc64-latest.args new file mode 100644 index 0000000000..007f425273 --- /dev/null +++ b/tests/qemuxml2argvdata/powernv9-root-port.ppc64-latest.args @@ -0,0 +1,35 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/tmp/lib/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-ppc64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine powernv9,usb=off,dump-guest-core=off,memory-backend=pnv.ram \ +-accel tcg \ +-cpu POWER9 \ +-m 2048 \ +-object '{"qom-type":"memory-backend-ram","id":"pnv.ram","size":2147483648}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid b20fcfe3-4a0a-4039-8735-9e024256e0f7 \ +-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 \ +-device '{"driver":"pnv-phb4","index":0,"chip-id":0,"id":"pcie.0"}' \ +-device '{"driver":"pnv-phb4-root-port","port":0,"chassis":1,"id":"pci.1","bus":"pcie.0","addr":"0x0"}' \ +-usb \ +-chardev pty,id=charserial0 \ +-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-msg timestamp=on diff --git a/tests/qemuxml2argvdata/powernv9-root-port.xml b/tests/qemuxml2argvdata/powernv9-root-port.xml new file mode 100644 index 0000000000..dfd74446f9 --- /dev/null +++ b/tests/qemuxml2argvdata/powernv9-root-port.xml @@ -0,0 +1,17 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid> + <memory unit='KiB'>2097152</memory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='powernv9'>hvm</type> + </os> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <controller type='pci' index='1' model='pcie-root-port'/> + <console type='pty'> + <target type='serial' port='0'/> + </console> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1ca0fd4633..ee831b81b0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2246,6 +2246,8 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("powernv8-root-port", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("powernv8-two-sockets", "ppc64"); DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("powernv8-dupPHBs", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("powernv9-root-port", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("powernv9-dupPHBs", "ppc64"); DO_TEST("pseries-basic", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, diff --git a/tests/qemuxml2xmloutdata/powernv9-root-port.ppc64-latest.xml b/tests/qemuxml2xmloutdata/powernv9-root-port.ppc64-latest.xml new file mode 100644 index 0000000000..135489cf6e --- /dev/null +++ b/tests/qemuxml2xmloutdata/powernv9-root-port.ppc64-latest.xml @@ -0,0 +1,39 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='powernv9'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>POWER9</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-ppc64</emulator> + <controller type='pci' index='0' model='pcie-root'> + <model name='pnv-phb4'/> + <target index='0' chip-id='0'/> + </controller> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pnv-phb4-root-port'/> + <target chassis='1' port='0x0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x00' function='0x0'/> + </controller> + <serial type='pty'> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <audio id='1' type='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmloutdata/powernv9-root-port.xml b/tests/qemuxml2xmloutdata/powernv9-root-port.xml new file mode 100644 index 0000000000..5649526969 --- /dev/null +++ b/tests/qemuxml2xmloutdata/powernv9-root-port.xml @@ -0,0 +1,36 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid> + <memory unit='KiB'>2097152</memory> + <currentMemory unit='KiB'>2097152</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='ppc64' machine='powernv9'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-ppc64</emulator> + <controller type='pci' index='0' model='pcie-root'> + <model name='pnv-phb4'/> + <target index='0' chip-id='0'/> + </controller> + <controller type='pci' index='1' model='pcie-root-port'> + <model name='pnv-phb4-root-port'/> + <target chassis='1' port='0x0'/> + <address type='pci' domain='0x0000' bus='0x00' slot='0x00' function='0x0'/> + </controller> + <serial type='pty'> + <target type='isa-serial' port='0'> + <model name='isa-serial'/> + </target> + </serial> + <console type='pty'> + <target type='serial' port='0'/> + </console> + <audio id='1' type='none'/> + </devices> +</domain> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 4171a83953..0dce792b32 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -665,6 +665,7 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("powernv8-basic", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("powernv8-root-port", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("powernv8-two-sockets", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("powernv9-root-port", "ppc64"); DO_TEST("pseries-nvram", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, -- 2.34.1

On a Tuesday in 2022, Daniel Henrique Barboza wrote:
Since the nuances of PowerNV PHBs and root ports were already handled when adding support for pnv-phb3* devices, we're already set to support PowerNV9 PHBs and root ports as well.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> --- .../powernv9-dupPHBs.ppc64-latest.err | 1 + tests/qemuxml2argvdata/powernv9-dupPHBs.xml | 27 +++++++++++++ .../powernv9-root-port.ppc64-latest.args | 35 +++++++++++++++++ tests/qemuxml2argvdata/powernv9-root-port.xml | 17 ++++++++ tests/qemuxml2argvtest.c | 2 + .../powernv9-root-port.ppc64-latest.xml | 39 +++++++++++++++++++ .../qemuxml2xmloutdata/powernv9-root-port.xml | 36 +++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 8 files changed, 158 insertions(+) create mode 100644 tests/qemuxml2argvdata/powernv9-dupPHBs.ppc64-latest.err create mode 100644 tests/qemuxml2argvdata/powernv9-dupPHBs.xml create mode 100644 tests/qemuxml2argvdata/powernv9-root-port.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv9-root-port.xml create mode 100644 tests/qemuxml2xmloutdata/powernv9-root-port.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv9-root-port.xml
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Hi, The patches doesn't apply on master anymore due to new capabilities being added in mainline, so I've rebased the patches with latest master here in case someone wants to test them: https://gitlab.com/danielhb/libvirt/-/tree/pnv_v2 Thanks, Daniel On 1/25/22 17:48, Daniel Henrique Barboza wrote:
Hi,
This v2 has changes proposed by Peter and Daniel on the v1 review. Peter's reviewed-by tags were kept when applicable.
The usability change made is that, now, we'll fail to launch powernv domains that has a pnv-phb* device and it's running a QEMU version that doesn't support these devices to be user creatable. Trying to run the 'powernv8-basic' domain with a QEMU 6.2.0 binary will result in an error:
$ sudo ./run tools/virsh define ../tests/qemuxml2argvdata/powernv8-basic.xml error: Failed to define domain from ../tests/qemuxml2argvdata/powernv8-basic.xml error: unsupported configuration: The 'pnv-phb3' device is not supported by this QEMU binary
Using the current QEMU upstream will allow the domain to be defined and started.
Changes from v1: - all tests are now using CAPS_LATEST;
- QEMU_CAPS_DEVICE_PNV_PHB3_ROOT_PORT is no longer being used. Capability for the pnv-phb3-root-port is infered to exist if the capabilitity for its PHB (QEMU_CAPS_DEVICE_PNV_PHB3) is present. Same thing for the case of QEMU_CAPS_DEVICE_PNV_PHB4_ROOT_PORT and QEMU_CAPS_DEVICE_PNV_PHB4;
- QEMU_CAPS_DEVICE_PNV_PHB3 and QEMU_CAPS_DEVICE_PNV_PHB4 are no longer being probed. They are being set by hand after checking for QEMU version in virQEMUCapsInitQMPVersionCaps();
- patch 01 (QEMU ppc64 capabilities for qemu 7.0): * dropped since it's already upstream
- patch 09 (forbid powernv domains migration): * removed. This will be handled on QEMU side
- patch 14 (new): * added documentation of the different semantics 'targetIndex' will have for PowerNV PHBs
- several other minor changes suggested by Peter
- v1 link: https://listman.redhat.com/archives/libvir-list/2022-January/msg00902.html
Daniel Henrique Barboza (29): qemu_domain.c: add PowerNV machine helpers qemu_capabilities.c: use 'MachineIsPowerPC' in DeviceDiskCaps qemu_domain: turn qemuDomainMachineIsPSeries() static qemu_validate.c: use qemuDomainIsPowerPC() in qemuValidateDomainChrDef() qemu_domain.c: define ISA as default PowerNV serial qemu_validate.c: enhance 'machine type not supported' message qemu_domain.c: disable default devices for PowerNV machines tests: add basic PowerNV8 test qemu: introduce QEMU_CAPS_DEVICE_PNV_PHB3 conf, qemu: add 'pnv-phb3-root-port' PCI controller model name conf, qemu: add 'pnv-phb3' PCI controller model name domain_conf.c: fix identation in virDomainControllerDefParseXML() conf: parse and format <target chip-id='...'/> formatdomain.rst: add 'index' semantics for PowerNV domains introduce virDomainControllerIsPowerNVPHB conf, qemu: add default 'chip-id' value for pnv-phb3 controllers conf, qemu: add default 'targetIndex' value for pnv-phb3 devs qemu_command.c: add command line for the pnv-phb3 device qemu_domain_address.c: change pnv-phb3 minimal downstream slot domain_conf: format pnv-phb3-root-port empty addr tests: add pnv-phb3-root-port test domain_validate.c: allow targetIndex 0 out of idx 0 for PowerNV PHBs domain_conf.c: reject duplicated pnv-phb3 devices qemu: introduce QEMU_CAPS_DEVICE_PNV_PHB4 conf, qemu: add 'pnv-phb4-root-port' PCI controller model name domain_conf.c: add phb4-root-port to IsPowerNVRootPort() conf, qemu: add 'pnv-phb4' controller model name domain_conf.c: add pnv-phb4 to ControllerIsPowerNVPHB() tests: add PowerNV9 tests
docs/formatdomain.rst | 12 +- docs/schemas/domaincommon.rng | 10 ++ src/conf/domain_conf.c | 157 ++++++++++++++---- src/conf/domain_conf.h | 8 + src/conf/domain_validate.c | 5 +- src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 28 +++- src/qemu/qemu_capabilities.h | 2 + src/qemu/qemu_command.c | 21 ++- src/qemu/qemu_domain.c | 56 ++++++- src/qemu/qemu_domain.h | 4 +- src/qemu/qemu_domain_address.c | 64 ++++++- src/qemu/qemu_validate.c | 62 ++++++- .../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 2 + .../powernv8-basic.ppc64-latest.args | 34 ++++ tests/qemuxml2argvdata/powernv8-basic.xml | 16 ++ tests/qemuxml2argvdata/powernv8-dupPHBs.err | 1 + .../powernv8-dupPHBs.ppc64-latest.err | 1 + tests/qemuxml2argvdata/powernv8-dupPHBs.xml | 27 +++ .../powernv8-root-port.ppc64-latest.args | 35 ++++ tests/qemuxml2argvdata/powernv8-root-port.xml | 17 ++ .../powernv8-two-sockets.ppc64-latest.args | 35 ++++ .../qemuxml2argvdata/powernv8-two-sockets.xml | 26 +++ .../powernv9-dupPHBs.ppc64-latest.err | 1 + tests/qemuxml2argvdata/powernv9-dupPHBs.xml | 27 +++ .../powernv9-root-port.ppc64-latest.args | 35 ++++ tests/qemuxml2argvdata/powernv9-root-port.xml | 17 ++ tests/qemuxml2argvtest.c | 7 + .../powernv8-basic.ppc64-latest.xml | 34 ++++ .../powernv8-root-port.ppc64-latest.xml | 39 +++++ .../powernv8-two-sockets.ppc64-latest.xml | 39 +++++ .../powernv9-root-port.ppc64-latest.xml | 39 +++++ .../qemuxml2xmloutdata/powernv9-root-port.xml | 36 ++++ tests/qemuxml2xmltest.c | 5 + 34 files changed, 855 insertions(+), 48 deletions(-) create mode 100644 tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-basic.xml create mode 100644 tests/qemuxml2argvdata/powernv8-dupPHBs.err create mode 100644 tests/qemuxml2argvdata/powernv8-dupPHBs.ppc64-latest.err create mode 100644 tests/qemuxml2argvdata/powernv8-dupPHBs.xml create mode 100644 tests/qemuxml2argvdata/powernv8-root-port.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-root-port.xml create mode 100644 tests/qemuxml2argvdata/powernv8-two-sockets.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-two-sockets.xml create mode 100644 tests/qemuxml2argvdata/powernv9-dupPHBs.ppc64-latest.err create mode 100644 tests/qemuxml2argvdata/powernv9-dupPHBs.xml create mode 100644 tests/qemuxml2argvdata/powernv9-root-port.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv9-root-port.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-root-port.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-two-sockets.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv9-root-port.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv9-root-port.xml

Ping On 1/25/22 17:48, Daniel Henrique Barboza wrote:
Hi,
This v2 has changes proposed by Peter and Daniel on the v1 review. Peter's reviewed-by tags were kept when applicable.
The usability change made is that, now, we'll fail to launch powernv domains that has a pnv-phb* device and it's running a QEMU version that doesn't support these devices to be user creatable. Trying to run the 'powernv8-basic' domain with a QEMU 6.2.0 binary will result in an error:
$ sudo ./run tools/virsh define ../tests/qemuxml2argvdata/powernv8-basic.xml error: Failed to define domain from ../tests/qemuxml2argvdata/powernv8-basic.xml error: unsupported configuration: The 'pnv-phb3' device is not supported by this QEMU binary
Using the current QEMU upstream will allow the domain to be defined and started.
Changes from v1: - all tests are now using CAPS_LATEST;
- QEMU_CAPS_DEVICE_PNV_PHB3_ROOT_PORT is no longer being used. Capability for the pnv-phb3-root-port is infered to exist if the capabilitity for its PHB (QEMU_CAPS_DEVICE_PNV_PHB3) is present. Same thing for the case of QEMU_CAPS_DEVICE_PNV_PHB4_ROOT_PORT and QEMU_CAPS_DEVICE_PNV_PHB4;
- QEMU_CAPS_DEVICE_PNV_PHB3 and QEMU_CAPS_DEVICE_PNV_PHB4 are no longer being probed. They are being set by hand after checking for QEMU version in virQEMUCapsInitQMPVersionCaps();
- patch 01 (QEMU ppc64 capabilities for qemu 7.0): * dropped since it's already upstream
- patch 09 (forbid powernv domains migration): * removed. This will be handled on QEMU side
- patch 14 (new): * added documentation of the different semantics 'targetIndex' will have for PowerNV PHBs
- several other minor changes suggested by Peter
- v1 link: https://listman.redhat.com/archives/libvir-list/2022-January/msg00902.html
Daniel Henrique Barboza (29): qemu_domain.c: add PowerNV machine helpers qemu_capabilities.c: use 'MachineIsPowerPC' in DeviceDiskCaps qemu_domain: turn qemuDomainMachineIsPSeries() static qemu_validate.c: use qemuDomainIsPowerPC() in qemuValidateDomainChrDef() qemu_domain.c: define ISA as default PowerNV serial qemu_validate.c: enhance 'machine type not supported' message qemu_domain.c: disable default devices for PowerNV machines tests: add basic PowerNV8 test qemu: introduce QEMU_CAPS_DEVICE_PNV_PHB3 conf, qemu: add 'pnv-phb3-root-port' PCI controller model name conf, qemu: add 'pnv-phb3' PCI controller model name domain_conf.c: fix identation in virDomainControllerDefParseXML() conf: parse and format <target chip-id='...'/> formatdomain.rst: add 'index' semantics for PowerNV domains introduce virDomainControllerIsPowerNVPHB conf, qemu: add default 'chip-id' value for pnv-phb3 controllers conf, qemu: add default 'targetIndex' value for pnv-phb3 devs qemu_command.c: add command line for the pnv-phb3 device qemu_domain_address.c: change pnv-phb3 minimal downstream slot domain_conf: format pnv-phb3-root-port empty addr tests: add pnv-phb3-root-port test domain_validate.c: allow targetIndex 0 out of idx 0 for PowerNV PHBs domain_conf.c: reject duplicated pnv-phb3 devices qemu: introduce QEMU_CAPS_DEVICE_PNV_PHB4 conf, qemu: add 'pnv-phb4-root-port' PCI controller model name domain_conf.c: add phb4-root-port to IsPowerNVRootPort() conf, qemu: add 'pnv-phb4' controller model name domain_conf.c: add pnv-phb4 to ControllerIsPowerNVPHB() tests: add PowerNV9 tests
docs/formatdomain.rst | 12 +- docs/schemas/domaincommon.rng | 10 ++ src/conf/domain_conf.c | 157 ++++++++++++++---- src/conf/domain_conf.h | 8 + src/conf/domain_validate.c | 5 +- src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 28 +++- src/qemu/qemu_capabilities.h | 2 + src/qemu/qemu_command.c | 21 ++- src/qemu/qemu_domain.c | 56 ++++++- src/qemu/qemu_domain.h | 4 +- src/qemu/qemu_domain_address.c | 64 ++++++- src/qemu/qemu_validate.c | 62 ++++++- .../qemucapabilitiesdata/caps_7.0.0.ppc64.xml | 2 + .../powernv8-basic.ppc64-latest.args | 34 ++++ tests/qemuxml2argvdata/powernv8-basic.xml | 16 ++ tests/qemuxml2argvdata/powernv8-dupPHBs.err | 1 + .../powernv8-dupPHBs.ppc64-latest.err | 1 + tests/qemuxml2argvdata/powernv8-dupPHBs.xml | 27 +++ .../powernv8-root-port.ppc64-latest.args | 35 ++++ tests/qemuxml2argvdata/powernv8-root-port.xml | 17 ++ .../powernv8-two-sockets.ppc64-latest.args | 35 ++++ .../qemuxml2argvdata/powernv8-two-sockets.xml | 26 +++ .../powernv9-dupPHBs.ppc64-latest.err | 1 + tests/qemuxml2argvdata/powernv9-dupPHBs.xml | 27 +++ .../powernv9-root-port.ppc64-latest.args | 35 ++++ tests/qemuxml2argvdata/powernv9-root-port.xml | 17 ++ tests/qemuxml2argvtest.c | 7 + .../powernv8-basic.ppc64-latest.xml | 34 ++++ .../powernv8-root-port.ppc64-latest.xml | 39 +++++ .../powernv8-two-sockets.ppc64-latest.xml | 39 +++++ .../powernv9-root-port.ppc64-latest.xml | 39 +++++ .../qemuxml2xmloutdata/powernv9-root-port.xml | 36 ++++ tests/qemuxml2xmltest.c | 5 + 34 files changed, 855 insertions(+), 48 deletions(-) create mode 100644 tests/qemuxml2argvdata/powernv8-basic.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-basic.xml create mode 100644 tests/qemuxml2argvdata/powernv8-dupPHBs.err create mode 100644 tests/qemuxml2argvdata/powernv8-dupPHBs.ppc64-latest.err create mode 100644 tests/qemuxml2argvdata/powernv8-dupPHBs.xml create mode 100644 tests/qemuxml2argvdata/powernv8-root-port.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-root-port.xml create mode 100644 tests/qemuxml2argvdata/powernv8-two-sockets.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv8-two-sockets.xml create mode 100644 tests/qemuxml2argvdata/powernv9-dupPHBs.ppc64-latest.err create mode 100644 tests/qemuxml2argvdata/powernv9-dupPHBs.xml create mode 100644 tests/qemuxml2argvdata/powernv9-root-port.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/powernv9-root-port.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-basic.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-root-port.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv8-two-sockets.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv9-root-port.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/powernv9-root-port.xml
participants (2)
-
Daniel Henrique Barboza
-
Ján Tomko