Patchwork [v2,2/4] piix: tag as not hotpluggable.

login
register
mail settings
Submitter Gerd Hoffmann
Date Jan. 6, 2011, 2:14 p.m.
Message ID <1294323280-21692-3-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/77720/
State New
Headers show

Comments

Gerd Hoffmann - Jan. 6, 2011, 2:14 p.m.
This patch tags all pci devices which belong to the piix3/4 chipsets as
not hotpluggable (Host bridge, ISA bridge, IDE controller, ACPI bridge).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/acpi_piix4.c |    2 ++
 hw/ide/piix.c   |    2 ++
 hw/piix4.c      |    1 +
 hw/piix_pci.c   |    2 ++
 4 files changed, 7 insertions(+), 0 deletions(-)
Aurelien Jarno - Jan. 7, 2011, 2:42 p.m.
On Thu, Jan 06, 2011 at 03:14:38PM +0100, Gerd Hoffmann wrote:
> This patch tags all pci devices which belong to the piix3/4 chipsets as
> not hotpluggable (Host bridge, ISA bridge, IDE controller, ACPI bridge).
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/acpi_piix4.c |    2 ++
>  hw/ide/piix.c   |    2 ++
>  hw/piix4.c      |    1 +
>  hw/piix_pci.c   |    2 ++
>  4 files changed, 7 insertions(+), 0 deletions(-)

I don't know a lot about piix4, but the change looks sane. I have
verified it doesn't break the MIPS malta target.

Acked-by: Aurelien Jarno <aurelien@aurel32.net>

> diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
> index 173d781..273097d 100644
> --- a/hw/acpi_piix4.c
> +++ b/hw/acpi_piix4.c
> @@ -428,6 +428,8 @@ static PCIDeviceInfo piix4_pm_info = {
>      .qdev.desc          = "PM",
>      .qdev.size          = sizeof(PIIX4PMState),
>      .qdev.vmsd          = &vmstate_acpi,
> +    .qdev.no_user       = 1,
> +    .no_hotplug         = 1,
>      .init               = piix4_pm_initfn,
>      .config_write       = pm_write_config,
>      .qdev.props         = (Property[]) {
> diff --git a/hw/ide/piix.c b/hw/ide/piix.c
> index 1cad906..d4289af 100644
> --- a/hw/ide/piix.c
> +++ b/hw/ide/piix.c
> @@ -194,11 +194,13 @@ static PCIDeviceInfo piix_ide_info[] = {
>          .qdev.name    = "piix3-ide",
>          .qdev.size    = sizeof(PCIIDEState),
>          .qdev.no_user = 1,
> +        .no_hotplug   = 1,
>          .init         = pci_piix3_ide_initfn,
>      },{
>          .qdev.name    = "piix4-ide",
>          .qdev.size    = sizeof(PCIIDEState),
>          .qdev.no_user = 1,
> +        .no_hotplug   = 1,
>          .init         = pci_piix4_ide_initfn,
>      },{
>          /* end of list */
> diff --git a/hw/piix4.c b/hw/piix4.c
> index 5489386..72073cd 100644
> --- a/hw/piix4.c
> +++ b/hw/piix4.c
> @@ -113,6 +113,7 @@ static PCIDeviceInfo piix4_info[] = {
>          .qdev.desc    = "ISA bridge",
>          .qdev.size    = sizeof(PCIDevice),
>          .qdev.no_user = 1,
> +        .no_hotplug   = 1,
>          .init         = piix4_initfn,
>      },{
>          /* end of list */
> diff --git a/hw/piix_pci.c b/hw/piix_pci.c
> index 38f9d9e..358da58 100644
> --- a/hw/piix_pci.c
> +++ b/hw/piix_pci.c
> @@ -348,6 +348,7 @@ static PCIDeviceInfo i440fx_info[] = {
>          .qdev.size    = sizeof(PCII440FXState),
>          .qdev.vmsd    = &vmstate_i440fx,
>          .qdev.no_user = 1,
> +        .no_hotplug   = 1,
>          .init         = i440fx_initfn,
>          .config_write = i440fx_write_config,
>      },{
> @@ -356,6 +357,7 @@ static PCIDeviceInfo i440fx_info[] = {
>          .qdev.size    = sizeof(PIIX3State),
>          .qdev.vmsd    = &vmstate_piix3,
>          .qdev.no_user = 1,
> +        .no_hotplug   = 1,
>          .init         = piix3_initfn,
>      },{
>          /* end of list */
> -- 
> 1.7.1
> 
> 
>
Markus Armbruster - Jan. 12, 2011, 12:22 p.m.
Gerd Hoffmann <kraxel@redhat.com> writes:

> This patch tags all pci devices which belong to the piix3/4 chipsets as
> not hotpluggable (Host bridge, ISA bridge, IDE controller, ACPI bridge).
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/acpi_piix4.c |    2 ++
>  hw/ide/piix.c   |    2 ++
>  hw/piix4.c      |    1 +
>  hw/piix_pci.c   |    2 ++
>  4 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
> index 173d781..273097d 100644
> --- a/hw/acpi_piix4.c
> +++ b/hw/acpi_piix4.c
> @@ -428,6 +428,8 @@ static PCIDeviceInfo piix4_pm_info = {
>      .qdev.desc          = "PM",
>      .qdev.size          = sizeof(PIIX4PMState),
>      .qdev.vmsd          = &vmstate_acpi,
> +    .qdev.no_user       = 1,

Makes sense, but the commit message doesn't mention it.

> +    .no_hotplug         = 1,
>      .init               = piix4_pm_initfn,
>      .config_write       = pm_write_config,
>      .qdev.props         = (Property[]) {
> diff --git a/hw/ide/piix.c b/hw/ide/piix.c
> index 1cad906..d4289af 100644
> --- a/hw/ide/piix.c
> +++ b/hw/ide/piix.c
> @@ -194,11 +194,13 @@ static PCIDeviceInfo piix_ide_info[] = {
>          .qdev.name    = "piix3-ide",
>          .qdev.size    = sizeof(PCIIDEState),
>          .qdev.no_user = 1,
> +        .no_hotplug   = 1,
>          .init         = pci_piix3_ide_initfn,
>      },{
>          .qdev.name    = "piix4-ide",
>          .qdev.size    = sizeof(PCIIDEState),
>          .qdev.no_user = 1,
> +        .no_hotplug   = 1,
>          .init         = pci_piix4_ide_initfn,
>      },{
>          /* end of list */
> diff --git a/hw/piix4.c b/hw/piix4.c
> index 5489386..72073cd 100644
> --- a/hw/piix4.c
> +++ b/hw/piix4.c
> @@ -113,6 +113,7 @@ static PCIDeviceInfo piix4_info[] = {
>          .qdev.desc    = "ISA bridge",
>          .qdev.size    = sizeof(PCIDevice),
>          .qdev.no_user = 1,
> +        .no_hotplug   = 1,
>          .init         = piix4_initfn,
>      },{
>          /* end of list */
> diff --git a/hw/piix_pci.c b/hw/piix_pci.c
> index 38f9d9e..358da58 100644
> --- a/hw/piix_pci.c
> +++ b/hw/piix_pci.c
> @@ -348,6 +348,7 @@ static PCIDeviceInfo i440fx_info[] = {
>          .qdev.size    = sizeof(PCII440FXState),
>          .qdev.vmsd    = &vmstate_i440fx,
>          .qdev.no_user = 1,
> +        .no_hotplug   = 1,
>          .init         = i440fx_initfn,
>          .config_write = i440fx_write_config,
>      },{
> @@ -356,6 +357,7 @@ static PCIDeviceInfo i440fx_info[] = {
>          .qdev.size    = sizeof(PIIX3State),
>          .qdev.vmsd    = &vmstate_piix3,
>          .qdev.no_user = 1,
> +        .no_hotplug   = 1,
>          .init         = piix3_initfn,
>      },{
>          /* end of list */

What about "piix3-usb-uhci" & friends?
Gerd Hoffmann - Jan. 13, 2011, 12:19 p.m.
Hi,

>> +        .no_hotplug   = 1,

> What about "piix3-usb-uhci"&  friends?

Hmm.  Good question.  UHCI controllers are hotpluggable.  But of course 
it isn't when it is a function of the chipset because pci can hotplug 
slots only.

Guess the best way to handle this for now is to just disable hotplugging 
for multifunction slots+devices as qemu currently lacks the 
infrastructure to handle this correctly.

cheers,
   Gerd

Patch

diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 173d781..273097d 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -428,6 +428,8 @@  static PCIDeviceInfo piix4_pm_info = {
     .qdev.desc          = "PM",
     .qdev.size          = sizeof(PIIX4PMState),
     .qdev.vmsd          = &vmstate_acpi,
+    .qdev.no_user       = 1,
+    .no_hotplug         = 1,
     .init               = piix4_pm_initfn,
     .config_write       = pm_write_config,
     .qdev.props         = (Property[]) {
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 1cad906..d4289af 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -194,11 +194,13 @@  static PCIDeviceInfo piix_ide_info[] = {
         .qdev.name    = "piix3-ide",
         .qdev.size    = sizeof(PCIIDEState),
         .qdev.no_user = 1,
+        .no_hotplug   = 1,
         .init         = pci_piix3_ide_initfn,
     },{
         .qdev.name    = "piix4-ide",
         .qdev.size    = sizeof(PCIIDEState),
         .qdev.no_user = 1,
+        .no_hotplug   = 1,
         .init         = pci_piix4_ide_initfn,
     },{
         /* end of list */
diff --git a/hw/piix4.c b/hw/piix4.c
index 5489386..72073cd 100644
--- a/hw/piix4.c
+++ b/hw/piix4.c
@@ -113,6 +113,7 @@  static PCIDeviceInfo piix4_info[] = {
         .qdev.desc    = "ISA bridge",
         .qdev.size    = sizeof(PCIDevice),
         .qdev.no_user = 1,
+        .no_hotplug   = 1,
         .init         = piix4_initfn,
     },{
         /* end of list */
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 38f9d9e..358da58 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -348,6 +348,7 @@  static PCIDeviceInfo i440fx_info[] = {
         .qdev.size    = sizeof(PCII440FXState),
         .qdev.vmsd    = &vmstate_i440fx,
         .qdev.no_user = 1,
+        .no_hotplug   = 1,
         .init         = i440fx_initfn,
         .config_write = i440fx_write_config,
     },{
@@ -356,6 +357,7 @@  static PCIDeviceInfo i440fx_info[] = {
         .qdev.size    = sizeof(PIIX3State),
         .qdev.vmsd    = &vmstate_piix3,
         .qdev.no_user = 1,
+        .no_hotplug   = 1,
         .init         = piix3_initfn,
     },{
         /* end of list */