pc: piix4_pm: init legacy PCI hotplug when running on Xen
PATCH 1/1 pc: piix4_pm: init legacy PCI hotplug when running on Xen
if user starts QEMU with "-machine pc,accel=xen", then compat property in xenfv won't work and it would
cause error:
"Unsupported bus. Bus doesn't have property 'acpi-pcihp-bsel' set" when PCI device is added with -device on QEMU CLI.
In case of Xen instead of using compat property,
just use the fact that xen doesn't use QEMU's
fw_cfg/acpi tables to switch piix4_pm into legacy
PCI hotplug mode when Xen is enabled.
--- hw/acpi/piix4.c | 3 +++ hw/i386/pc_piix.c | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-)
hw/acpi/piix4.c +3 -0
@@ -501,6 +501,9 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, s->irq = sci_irq; s->smi_irq = smi_irq; s->kvm_enabled = kvm_enabled; +if (!fw_cfg) { + s->use_acpi_pci_hotplug = false; + }qdev_init_nofail (dev);
hw/i386/pc_piix.c +0 -11
@@ -840,17 +840,6 @@ static QEMUMachine xenfv_machine = { .max_cpus = HVM_MAX_VCPUS, .default_machine_opts = "accel=xen", .hot_add_cpu = pc_hot_add_cpu, - .compat_props = (GlobalProperty []) { -/* xenfv has no fwcfg and so does not load acpi from QEMU. -* as such new acpi features don't work. -*/ - { - .driver ="PIIX4_PM" , - .property ="acpi-pci-hotplug-with-bridge-support" , - .value ="off" , - }, - {/* end of list */ } - }, };#endif
Signature · 1 line
1.9.0
Quoted 22 lines · Igor Mammedov
if user starts QEMU with "-machine pc,accel=xen", then compat property in xenfv won't work and it would
cause error:
"Unsupported bus. Bus doesn't have property 'acpi-pcihp-bsel' set" when PCI device is added with -device on QEMU CLI.In case of Xen instead of using compat property,
just use the fact that xen doesn't use QEMU's
fw_cfg/acpi tables to switchpiix4_pminto legacy
PCI hotplug mode when Xen is enabled.Signed-off-by Igor Mammedov <[email protected]>hw/acpi/piix4.c | 3 +++ hw/i386/pc_piix.c | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-)hw/acpi/piix4.c +0
-0
hw/acpi/piix4.c I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, · line 508
Quoted 8 lines
hw/acpi/piix4.c +3
-0@@ -501,6 +501,9 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, s->irq = sci_irq; s->smi_irq = smi_irq; s->kvm_enabled = kvm_enabled; +if (!fw_cfg) { + s->use_acpi_pci_hotplug = false; + }qdev_init_nofail (dev);
This seems like a good change to have regardless of everything else. I am not sure I would remove the default off for acpi-pci-hotplug-with-bridge-support on xenfv but I underestand it wouldn't be needed anyway.
So the patch is fine by me.
Quoted 25 lines
hw/i386/pc_piix.c +0
-11@@ -840,17 +840,6 @@ static QEMUMachine xenfv_machine = { .max_cpus = HVM_MAX_VCPUS, .default_machine_opts = "accel=xen", .hot_add_cpu = pc_hot_add_cpu, - .compat_props = (GlobalProperty []) { -/* xenfv has no fwcfg and so does not load acpi from QEMU. -* as such new acpi features don't work. -*/ - { - .driver ="PIIX4_PM" , - .property ="acpi-pci-hotplug-with-bridge-support" , - .value ="off" , - }, - {/* end of list */ } - }, };#endif Signature · 1 line
1.9.0
I still see this error in the latest QEMU. I find that this patch is not merged in. Anybody knows why?
Thanks,
Feng
Quoted 68 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Igor Mammedov
Sent: Friday, May 23, 2014 8:04 PM
To: [email protected]
Cc: [email protected]; Chen, Tiejun; [email protected]; [email protected]; [email protected]
Subject: [Qemu-devel] [PATCH] pc:piix4_pm: init legacy PCI hotplug when running on Xenif user starts QEMU with "-machine pc,accel=xen", then compat property in xenfv won't work and it would
cause error:
"Unsupported bus. Bus doesn't have property 'acpi-pcihp-bsel' set" when PCI device is added with -device on QEMU CLI.In case of Xen instead of using compat property,
just use the fact that xen doesn't use QEMU's
fw_cfg/acpi tables to switchpiix4_pminto legacy
PCI hotplug mode when Xen is enabled.Signed-off-by Igor Mammedov <[email protected]>--- hw/acpi/piix4.c | 3 +++ hw/i386/pc_piix.c | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-)hw/acpi/piix4.c +3
-0@@ -501,6 +501,9 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn,uint32_t smb_io_base, s->irq = sci_irq; s->smi_irq = smi_irq; s->kvm_enabled = kvm_enabled; +if (!fw_cfg) { + s->use_acpi_pci_hotplug = false; + }qdev_init_nofail (dev);hw/i386/pc_piix.c +0
-12@@ -840,17 +840,6 @@ static QEMUMachine xenfv_machine = { .max_cpus = HVM_MAX_VCPUS, .default_machine_opts = "accel=xen", .hot_add_cpu = pc_hot_add_cpu, - .compat_props = (GlobalProperty []) { -/* xenfv has no fwcfg and so does not load acpi from QEMU. -* as such new acpi features don't work. -*/ - { - .driver ="PIIX4_PM" , - .property ="acpi-pci-hotplug-with-bridge-support" , - .value ="off" , - }, - {/* end of list */ } - }, };#endif --1.9.0
Feng, thanks for the email.
I was assuming that one of the other maintainers would take care of the patch, but I am happy to submit a pull request for it too.
Paolo, Michael?
Quoted 74 lines · Feng
I still see this error in the latest QEMU. I find that this patch is not merged in. Anybody knows why?
Thanks,
FengQuoted 68 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Igor Mammedov
Sent: Friday, May 23, 2014 8:04 PM
To: [email protected]
Cc: [email protected]; Chen, Tiejun; [email protected]; [email protected]; [email protected]
Subject: [Qemu-devel] [PATCH] pc:piix4_pm: init legacy PCI hotplug when running on Xenif user starts QEMU with "-machine pc,accel=xen", then compat property in xenfv won't work and it would
cause error:
"Unsupported bus. Bus doesn't have property 'acpi-pcihp-bsel' set" when PCI device is added with -device on QEMU CLI.In case of Xen instead of using compat property,
just use the fact that xen doesn't use QEMU's
fw_cfg/acpi tables to switchpiix4_pminto legacy
PCI hotplug mode when Xen is enabled.Signed-off-by Igor Mammedov <[email protected]>--- hw/acpi/piix4.c | 3 +++ hw/i386/pc_piix.c | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-)hw/acpi/piix4.c +3
-0@@ -501,6 +501,9 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn,uint32_t smb_io_base, s->irq = sci_irq; s->smi_irq = smi_irq; s->kvm_enabled = kvm_enabled; +if (!fw_cfg) { + s->use_acpi_pci_hotplug = false; + }qdev_init_nofail (dev);hw/i386/pc_piix.c +0
-12@@ -840,17 +840,6 @@ static QEMUMachine xenfv_machine = { .max_cpus = HVM_MAX_VCPUS, .default_machine_opts = "accel=xen", .hot_add_cpu = pc_hot_add_cpu, - .compat_props = (GlobalProperty []) { -/* xenfv has no fwcfg and so does not load acpi from QEMU. -* as such new acpi features don't work. -*/ - { - .driver ="PIIX4_PM" , - .property ="acpi-pci-hotplug-with-bridge-support" , - .value ="off" , - }, - {/* end of list */ } - }, };#endif --1.9.0
Quoted 6 lines · Stefano Stabellini
Feng, thanks for the email.
I was assuming that one of the other maintainers would take care of the patch, but I am happy to submit a pull request for it too.
Paolo, Michael?
I think this patch is not okay, because Xen does use fw_cfg when you have -kernel. So I think you should really use "if (xen_enabled())".
Paolo
Quoted 41 lines
Quoted 41 lines
Quoted 40 lines
hw/acpi/piix4.c +3
-0@@ -501,6 +501,9 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn,uint32_t smb_io_base, s->irq = sci_irq; s->smi_irq = smi_irq; s->kvm_enabled = kvm_enabled; +if (!fw_cfg) { + s->use_acpi_pci_hotplug = false; + }qdev_init_nofail (dev);hw/i386/pc_piix.c +0
-12@@ -840,17 +840,6 @@ static QEMUMachine xenfv_machine = { .max_cpus = HVM_MAX_VCPUS, .default_machine_opts = "accel=xen", .hot_add_cpu = pc_hot_add_cpu, - .compat_props = (GlobalProperty []) { -/* xenfv has no fwcfg and so does not load acpi from QEMU. -* as such new acpi features don't work. -*/ - { - .driver ="PIIX4_PM" , - .property ="acpi-pci-hotplug-with-bridge-support" , - .value ="off" , - }, - {/* end of list */ } - }, };#endif --1.9.0
Quoted 10 lines · Paolo Bonzini
Quoted 6 lines · Stefano Stabellini
Feng, thanks for the email.
I was assuming that one of the other maintainers would take care of the patch, but I am happy to submit a pull request for it too.
Paolo, Michael?
I think this patch is not okay, because Xen does use
fw_cfgwhen you have -kernel. So I think you should really use "if (xen_enabled())".
Well spotted! The original patch was submitted before we introduced -kernel to hvm guests.
If (xen_enabled()) would work.
Quoted 42 lines
Quoted 41 lines
Quoted 41 lines
Quoted 40 lines
hw/acpi/piix4.c +3
-0@@ -501,6 +501,9 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn,uint32_t smb_io_base, s->irq = sci_irq; s->smi_irq = smi_irq; s->kvm_enabled = kvm_enabled; +if (!fw_cfg) { + s->use_acpi_pci_hotplug = false; + }qdev_init_nofail (dev);hw/i386/pc_piix.c +0
-12@@ -840,17 +840,6 @@ static QEMUMachine xenfv_machine = { .max_cpus = HVM_MAX_VCPUS, .default_machine_opts = "accel=xen", .hot_add_cpu = pc_hot_add_cpu, - .compat_props = (GlobalProperty []) { -/* xenfv has no fwcfg and so does not load acpi from QEMU. -* as such new acpi features don't work. -*/ - { - .driver ="PIIX4_PM" , - .property ="acpi-pci-hotplug-with-bridge-support" , - .value ="off" , - }, - {/* end of list */ } - }, };#endif --1.9.0
Igor Mammedov wrote on 2014-05-23:
Quoted 8 lines
if user starts QEMU with "-machine pc,accel=xen", then compat property in xenfv won't work and it would cause error:
"Unsupported bus. Bus doesn't have property 'acpi-pcihp-bsel' set" when PCI device is added with -device on QEMU CLI.In case of Xen instead of using compat property, just use the fact that xen doesn't use QEMU's fw_cfg/acpi tables to switch
piix4_pminto legacy PCI hotplug mode when Xen is enabled.
I am wondering why Xen cannot use new mechanism to do the hotplug.
Quoted 26 lines
Signed-off-by Igor Mammedov <[email protected]>--- hw/acpi/piix4.c | 3 +++ hw/i386/pc_piix.c | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-)hw/acpi/piix4.c index 227ea30..12542c3 renamed from hw/acpi/piix4.c +0
-0100644 ---
a/hw/acpi/piix4.c+++b/hw/acpi/piix4.c@@ -501,6 +501,9 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn,uint32_tsmb_io_base,s->irq = sci_irq; s->smi_irq = smi_irq; s->kvm_enabled = kvm_enabled;hw/acpi/piix4.c index 227ea30..12542c3 renamed from hw/acpi/piix4.c +3
-0+ if (!fw_cfg) { + s->use_acpi_pci_hotplug = false; + } qdev_init_nofail(dev);hw/i386/pc_piix.c index renamed from hw/i386/pc_piix.c +0
-0a13e8d6..067ff0c 100644 ---
a/hw/i386/pc_piix.c+++b/hw/i386/pc_piix.chw/i386/pc_piix.c index renamed from hw/i386/pc_piix.c +0
-3@@ -840,17 +840,6 @@ static QEMUMachine xenfv_machine = { .max_cpus = HVM_MAX_VCPUS, .default_machine_opts = "accel=xen", .hot_add_cpu = pc_hot_add_cpu, - .compat_props = (GlobalProperty[]) { - /* xenfv has no fwcfg and so does not load acpi from QEMU. - * as such new acpi features don't work.
hw/i386/pc_piix.c index static QEMUMachine xenfv_machine = { · line 844
Quoted 10 lines
hw/i386/pc_piix.c index renamed from hw/i386/pc_piix.c +0
-8- */ - { - .driver = "PIIX4_PM", - .property = "acpi-pci-hotplug-with-bridge-support", - .value = "off", - }, - { /* end of list */ } - }, }; #endif
Best regards,
Yang
Quoted 11 lines · Yang Z
Igor Mammedov wrote on 2014-05-23:
Quoted 8 lines
if user starts QEMU with "-machine pc,accel=xen", then compat property in xenfv won't work and it would cause error:
"Unsupported bus. Bus doesn't have property 'acpi-pcihp-bsel' set" when PCI device is added with -device on QEMU CLI.In case of Xen instead of using compat property, just use the fact that xen doesn't use QEMU's fw_cfg/acpi tables to switch
piix4_pminto legacy PCI hotplug mode when Xen is enabled.I am wondering why Xen cannot use new mechanism to do the hotplug.
If I recall correctly the new mechanism is based on fw_cfg, right? Xen doesn't have fw_cfg and it uses a different set of ACPI table, built by one additional piece of firmware call "hvmloader" that KVM or QEMU don't use.
Quoted 40 lines
Quoted 25 lines
Signed-off-by Igor Mammedov <[email protected]>--- hw/acpi/piix4.c | 3 +++ hw/i386/pc_piix.c | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-)hw/acpi/piix4.c index 227ea30..12542c3 renamed from hw/acpi/piix4.c +0
-0100644 ---
a/hw/acpi/piix4.c+++b/hw/acpi/piix4.c@@ -501,6 +501,9 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn,uint32_tsmb_io_base,s->irq = sci_irq; s->smi_irq = smi_irq; s->kvm_enabled = kvm_enabled;hw/acpi/piix4.c index 227ea30..12542c3 renamed from hw/acpi/piix4.c +3
-0+ if (!fw_cfg) { + s->use_acpi_pci_hotplug = false; + } qdev_init_nofail(dev);hw/i386/pc_piix.c index renamed from hw/i386/pc_piix.c +0
-0a13e8d6..067ff0c 100644 ---
a/hw/i386/pc_piix.c+++b/hw/i386/pc_piix.chw/i386/pc_piix.c index renamed from hw/i386/pc_piix.c +0
-3@@ -840,17 +840,6 @@ static QEMUMachine xenfv_machine = { .max_cpus = HVM_MAX_VCPUS, .default_machine_opts = "accel=xen", .hot_add_cpu = pc_hot_add_cpu, - .compat_props = (GlobalProperty[]) { - /* xenfv has no fwcfg and so does not load acpi from QEMU. - * as such new acpi features don't work.hw/i386/pc_piix.c index static QEMUMachine xenfv_machine = { · line 844
Quoted 10 lines
hw/i386/pc_piix.c index renamed from hw/i386/pc_piix.c +0
-8- */ - { - .driver = "PIIX4_PM", - .property = "acpi-pci-hotplug-with-bridge-support", - .value = "off", - }, - { /* end of list */ } - }, }; #endifBest regards,
Yang
Stefano Stabellini wrote on 2014-11-10:
Quoted 11 lines · Yang Z
Quoted 10 lines
Igor Mammedov wrote on 2014-05-23:
Quoted 8 lines
if user starts QEMU with "-machine pc,accel=xen", then compat property in xenfv won't work and it would cause error:
"Unsupported bus. Bus doesn't have property 'acpi-pcihp-bsel' set" when PCI device is added with -device on QEMU CLI.In case of Xen instead of using compat property, just use the fact that xen doesn't use QEMU's fw_cfg/acpi tables to switch
piix4_pminto legacy PCI hotplug mode when Xen is enabled.
Quoted 5 lines
Quoted 1 line
I am wondering why Xen cannot use new mechanism to do the hotplug.
If I recall correctly the new mechanism is based on
fw_cfg, right?
Xen doesn't havefw_cfgand it uses a different set of ACPI table,
built by one additional piece of firmware call "hvmloader" that KVM or QEMU don't use.
Right. I forget that ACPI is built by hvmloader in Xen. :)
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Signed-off-by Igor Mammedov <[email protected]>--- hw/acpi/piix4.c | 3 +++ hw/i386/pc_piix.c | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 227ea30..12542c3 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -501,6 +501,9 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, s->irq = sci_irq; s->smi_irq = smi_irq; s->kvm_enabled = kvm_enabled;hw/acpi/piix4.c +3
-0+if (!fw_cfg) { + s->use_acpi_pci_hotplug = false; + }
Quoted 26 lines
Quoted 4 lines
Quoted 4 lines
qdev_init_nofail(dev);hw/i386/pc_piix.c index renamed from hw/i386/pc_piix.c +0
-0a13e8d6..067ff0c 100644 ---
a/hw/i386/pc_piix.c+++b/hw/i386/pc_piix.c@@ -840,17 +840,6 @@ static QEMUMachine
xenfv_machine= {Quoted 21 lines
Quoted 6 lines
.max_cpus =
HVM_MAX_VCPUS,
.default_machine_opts = "accel=xen",
.hot_add_cpu =pc_hot_add_cpu,hw/i386/pc_piix.c index renamed from hw/i386/pc_piix.c +0
-3- .compat_props = (GlobalProperty[]) { - /* xenfv has no fwcfg and so does not load acpi from QEMU. - * as such new acpi features don't work.hw/i386/pc_piix.c index
Quoted 10 lines
hw/i386/pc_piix.c index renamed from hw/i386/pc_piix.c +0
-8- */ - { - .driver = "PIIX4_PM", - .property = "acpi-pci-hotplug-with-bridge-support", - .value = "off", - }, - { /* end of list */ } - }, }; #endifBest regards,
Yang
Best regards,
Yang