Skip to content

Commit 329afc7

Browse files
nvmochsberrange
authored andcommitted
qemu: Add command line support for PCI high memory MMIO size
Add support for generating QEMU command line with PCI high memory MMIO size: - Add highmem-mmio-size to machine command line generation using size conveyed through pcihole64 - Add validation for aarch64/virt machine type requirement - Add capability check for QEMU support This enables configuring the PCI high memory MMIO window size for aarch64 virt machine types using the existing pcihole64 element. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>
1 parent 91e1b2c commit 329afc7

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/qemu/qemu_command.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6197,7 +6197,8 @@ qemuBuildGlobalControllerCommandLine(virCommand *cmd,
61976197
for (i = 0; i < def->ncontrollers; i++) {
61986198
virDomainControllerDef *cont = def->controllers[i];
61996199
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI &&
6200-
cont->opts.pciopts.pcihole64) {
6200+
cont->opts.pciopts.pcihole64 &&
6201+
(qemuDomainIsQ35(def) || qemuDomainIsI440FX(def))) {
62016202
const char *hoststr = NULL;
62026203

62036204
switch (cont->model) {
@@ -7114,6 +7115,17 @@ qemuBuildMachineCommandLine(virCommand *cmd,
71147115

71157116
qemuBuildMachineACPI(&buf, def, qemuCaps);
71167117

7118+
if (qemuDomainIsARMVirt(def)) {
7119+
for (i = 0; i < def->ncontrollers; i++) {
7120+
virDomainControllerDef *cont = def->controllers[i];
7121+
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI &&
7122+
cont->opts.pciopts.pcihole64) {
7123+
virBufferAsprintf(&buf, ",highmem-mmio-size=%lluK", cont->opts.pciopts.pcihole64size);
7124+
break;
7125+
}
7126+
}
7127+
}
7128+
71177129
virCommandAddArgBuffer(cmd, &buf);
71187130

71197131
return 0;

src/qemu/qemu_validate.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4085,7 +4085,9 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont,
40854085

40864086
case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT:
40874087
if (pciopts->pcihole64 || pciopts->pcihole64size != 0) {
4088-
if (!qemuDomainIsQ35(def)) {
4088+
if (!qemuDomainIsQ35(def) &&
4089+
!(qemuDomainIsARMVirt(def) && virQEMUCapsGet(qemuCaps,
4090+
QEMU_CAPS_MACHINE_VIRT_HIGHMEM_MMIO_SIZE))) {
40894091
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
40904092
_("Setting the 64-bit PCI hole size is not supported for machine '%1$s'"),
40914093
def->os.machine);

0 commit comments

Comments
 (0)