qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen
@ 2014-05-23 12:03 Igor Mammedov
  2014-05-23 14:28 ` Stefano Stabellini
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Igor Mammedov @ 2014-05-23 12:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: anthony.perard, tiejun.chen, stefano.stabellini, aliguori, mst

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.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 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;
+    if (!fw_cfg) {
+        s->use_acpi_pci_hotplug = false;
+    }
 
     qdev_init_nofail(dev);
 
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index a13e8d6..067ff0c 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen
  2014-05-23 12:03 [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen Igor Mammedov
@ 2014-05-23 14:28 ` Stefano Stabellini
  2014-11-04  4:48 ` Wu, Feng
  2014-11-10  4:01 ` Zhang, Yang Z
  2 siblings, 0 replies; 9+ messages in thread
From: Stefano Stabellini @ 2014-05-23 14:28 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: stefano.stabellini, mst, qemu-devel, aliguori, anthony.perard,
	tiejun.chen

On Fri, 23 May 2014, Igor Mammedov wrote:
> 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.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
>
>  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;
> +    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.


> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index a13e8d6..067ff0c 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -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
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen
  2014-05-23 12:03 [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen Igor Mammedov
  2014-05-23 14:28 ` Stefano Stabellini
@ 2014-11-04  4:48 ` Wu, Feng
  2014-11-04 10:36   ` Stefano Stabellini
  2014-11-10  4:01 ` Zhang, Yang Z
  2 siblings, 1 reply; 9+ messages in thread
From: Wu, Feng @ 2014-11-04  4:48 UTC (permalink / raw)
  To: Igor Mammedov, qemu-devel@nongnu.org
  Cc: anthony.perard@citrix.com, Chen, Tiejun, mst@redhat.com,
	aliguori@amazon.com, stefano.stabellini@eu.citrix.com

I still see this error in the latest QEMU. I find that this patch is not merged in. Anybody knows why?

Thanks,
Feng

> -----Original Message-----
> From: qemu-devel-bounces+feng.wu=intel.com@nongnu.org
> [mailto:qemu-devel-bounces+feng.wu=intel.com@nongnu.org] On Behalf Of
> Igor Mammedov
> Sent: Friday, May 23, 2014 8:04 PM
> To: qemu-devel@nongnu.org
> Cc: anthony.perard@citrix.com; Chen, Tiejun; stefano.stabellini@eu.citrix.com;
> aliguori@amazon.com; mst@redhat.com
> Subject: [Qemu-devel] [PATCH] 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.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
>  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;
> +    if (!fw_cfg) {
> +        s->use_acpi_pci_hotplug = false;
> +    }
> 
>      qdev_init_nofail(dev);
> 
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index a13e8d6..067ff0c 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -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
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen
  2014-11-04  4:48 ` Wu, Feng
@ 2014-11-04 10:36   ` Stefano Stabellini
  2014-11-04 14:07     ` Paolo Bonzini
  0 siblings, 1 reply; 9+ messages in thread
From: Stefano Stabellini @ 2014-11-04 10:36 UTC (permalink / raw)
  To: Wu, Feng
  Cc: stefano.stabellini@eu.citrix.com, mst@redhat.com,
	qemu-devel@nongnu.org, Paolo Bonzini, aliguori@amazon.com,
	Chen, Tiejun, anthony.perard@citrix.com, Igor Mammedov

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?


On Tue, 4 Nov 2014, Wu, Feng wrote:
> I still see this error in the latest QEMU. I find that this patch is not merged in. Anybody knows why?
> 
> Thanks,
> Feng
> 
> > -----Original Message-----
> > From: qemu-devel-bounces+feng.wu=intel.com@nongnu.org
> > [mailto:qemu-devel-bounces+feng.wu=intel.com@nongnu.org] On Behalf Of
> > Igor Mammedov
> > Sent: Friday, May 23, 2014 8:04 PM
> > To: qemu-devel@nongnu.org
> > Cc: anthony.perard@citrix.com; Chen, Tiejun; stefano.stabellini@eu.citrix.com;
> > aliguori@amazon.com; mst@redhat.com
> > Subject: [Qemu-devel] [PATCH] 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.
> > 
> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> > ---
> >  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;
> > +    if (!fw_cfg) {
> > +        s->use_acpi_pci_hotplug = false;
> > +    }
> > 
> >      qdev_init_nofail(dev);
> > 
> > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> > index a13e8d6..067ff0c 100644
> > --- a/hw/i386/pc_piix.c
> > +++ b/hw/i386/pc_piix.c
> > @@ -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
> > 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen
  2014-11-04 10:36   ` Stefano Stabellini
@ 2014-11-04 14:07     ` Paolo Bonzini
  2014-11-04 15:24       ` Stefano Stabellini
  0 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2014-11-04 14:07 UTC (permalink / raw)
  To: Stefano Stabellini, Wu, Feng
  Cc: mst@redhat.com, qemu-devel@nongnu.org, aliguori@amazon.com,
	Chen, Tiejun, anthony.perard@citrix.com, Igor Mammedov

On 04/11/2014 11:36, Stefano Stabellini wrote:
> 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

>>> 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;
>>> +    if (!fw_cfg) {
>>> +        s->use_acpi_pci_hotplug = false;
>>> +    }
>>>
>>>      qdev_init_nofail(dev);
>>>
>>> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
>>> index a13e8d6..067ff0c 100644
>>> --- a/hw/i386/pc_piix.c
>>> +++ b/hw/i386/pc_piix.c
>>> @@ -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
>>>
>>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen
  2014-11-04 14:07     ` Paolo Bonzini
@ 2014-11-04 15:24       ` Stefano Stabellini
  0 siblings, 0 replies; 9+ messages in thread
From: Stefano Stabellini @ 2014-11-04 15:24 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Wu, Feng, Stefano Stabellini, mst@redhat.com,
	qemu-devel@nongnu.org, aliguori@amazon.com, Chen, Tiejun,
	anthony.perard@citrix.com, Igor Mammedov

On Tue, 4 Nov 2014, Paolo Bonzini wrote:
> On 04/11/2014 11:36, Stefano Stabellini wrote:
> > 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())".
 
Well spotted! The original patch was submitted before we introduced
-kernel to hvm guests.

If (xen_enabled()) would work.



> >>> 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;
> >>> +    if (!fw_cfg) {
> >>> +        s->use_acpi_pci_hotplug = false;
> >>> +    }
> >>>
> >>>      qdev_init_nofail(dev);
> >>>
> >>> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> >>> index a13e8d6..067ff0c 100644
> >>> --- a/hw/i386/pc_piix.c
> >>> +++ b/hw/i386/pc_piix.c
> >>> @@ -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
> >>>
> >>
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen
  2014-05-23 12:03 [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen Igor Mammedov
  2014-05-23 14:28 ` Stefano Stabellini
  2014-11-04  4:48 ` Wu, Feng
@ 2014-11-10  4:01 ` Zhang, Yang Z
  2014-11-10 11:42   ` Stefano Stabellini
  2 siblings, 1 reply; 9+ messages in thread
From: Zhang, Yang Z @ 2014-11-10  4:01 UTC (permalink / raw)
  To: Igor Mammedov, qemu-devel@nongnu.org
  Cc: anthony.perard@citrix.com, Chen, Tiejun, mst@redhat.com,
	aliguori@amazon.com, stefano.stabellini@eu.citrix.com

Igor Mammedov wrote on 2014-05-23:
> 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.

I am wondering why Xen cannot use new mechanism to do the hotplug.

> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
>  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;
> +    if (!fw_cfg) {
> +        s->use_acpi_pci_hotplug = false;
> +    }
> 
>      qdev_init_nofail(dev);
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index
> a13e8d6..067ff0c 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c
> @@ -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


Best regards,
Yang

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen
  2014-11-10  4:01 ` Zhang, Yang Z
@ 2014-11-10 11:42   ` Stefano Stabellini
  2014-11-11  3:32     ` Zhang, Yang Z
  0 siblings, 1 reply; 9+ messages in thread
From: Stefano Stabellini @ 2014-11-10 11:42 UTC (permalink / raw)
  To: Zhang, Yang Z
  Cc: stefano.stabellini@eu.citrix.com, mst@redhat.com,
	qemu-devel@nongnu.org, aliguori@amazon.com, Chen, Tiejun,
	anthony.perard@citrix.com, Igor Mammedov

On Mon, 10 Nov 2014, Zhang, Yang Z wrote:
> Igor Mammedov wrote on 2014-05-23:
> > 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.
> 
> 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.


> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> > ---
> >  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;
> > +    if (!fw_cfg) {
> > +        s->use_acpi_pci_hotplug = false;
> > +    }
> > 
> >      qdev_init_nofail(dev);
> > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index
> > a13e8d6..067ff0c 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c
> > @@ -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
> 
> 
> Best regards,
> Yang
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen
  2014-11-10 11:42   ` Stefano Stabellini
@ 2014-11-11  3:32     ` Zhang, Yang Z
  0 siblings, 0 replies; 9+ messages in thread
From: Zhang, Yang Z @ 2014-11-11  3:32 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: mst@redhat.com, qemu-devel@nongnu.org, aliguori@amazon.com,
	Chen, Tiejun, anthony.perard@citrix.com, Igor Mammedov

Stefano Stabellini wrote on 2014-11-10:
> On Mon, 10 Nov 2014, Zhang, Yang Z wrote:
>> Igor Mammedov wrote on 2014-05-23:
>>> 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.
>> 
>> 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.

Right. I forget that ACPI is built by hvmloader in Xen. :)

> 
> 
>>> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
>>> ---
>>>  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;
>>> +    if (!fw_cfg) {
>>> +        s->use_acpi_pci_hotplug = false;
>>> +    }
>>> 
>>>      qdev_init_nofail(dev);
>>> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index
>>> a13e8d6..067ff0c 100644 --- a/hw/i386/pc_piix.c +++
>>> b/hw/i386/pc_piix.c @@ -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
>> 
>> 
>> Best regards,
>> Yang
>>


Best regards,
Yang

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-11-11  3:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-23 12:03 [Qemu-devel] [PATCH] pc: piix4_pm: init legacy PCI hotplug when running on Xen Igor Mammedov
2014-05-23 14:28 ` Stefano Stabellini
2014-11-04  4:48 ` Wu, Feng
2014-11-04 10:36   ` Stefano Stabellini
2014-11-04 14:07     ` Paolo Bonzini
2014-11-04 15:24       ` Stefano Stabellini
2014-11-10  4:01 ` Zhang, Yang Z
2014-11-10 11:42   ` Stefano Stabellini
2014-11-11  3:32     ` Zhang, Yang Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).