[Qemu-devel] [PATCH v2 4/6] spapr: Allow only supported dynamic sysbus devices

Eduardo Habkost posted 6 patches 8 years, 2 months ago
[Qemu-devel] [PATCH v2 4/6] spapr: Allow only supported dynamic sysbus devices
Posted by Eduardo Habkost 8 years, 2 months ago
TYPE_SPAPR_PCI_HOST_BRIDGE is the only dynamic sysbus device not
rejected by ppc_spapr_reset(), so it can be the only entry on the
allowed list.

Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Alexander Graf <agraf@suse.de>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes series v1 -> v2:
* New patch added to series
---
 hw/ppc/spapr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 82040cc5d1..3c6d6f2cea 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3603,8 +3603,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
     mc->default_boot_order = "";
     mc->default_ram_size = 512 * M_BYTE;
     mc->kvm_type = spapr_kvm_type;
-    /*TODO: allow only sysbus devices that really work with this machine */
-    machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SYS_BUS_DEVICE);
+    machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SPAPR_PCI_HOST_BRIDGE);
     mc->pci_allow_0_address = true;
     mc->get_hotplug_handler = spapr_get_hotplug_handler;
     hc->pre_plug = spapr_machine_device_pre_plug;
-- 
2.13.6


Re: [Qemu-devel] [PATCH v2 4/6] spapr: Allow only supported dynamic sysbus devices
Posted by Greg Kurz 8 years, 2 months ago
On Sat, 25 Nov 2017 13:16:08 -0200
Eduardo Habkost <ehabkost@redhat.com> wrote:

> TYPE_SPAPR_PCI_HOST_BRIDGE is the only dynamic sysbus device not
> rejected by ppc_spapr_reset(), so it can be the only entry on the
> allowed list.
> 

So we don't need the code that rejects other sysbus devices anymore, right ?
We should drop the related code then, but I guess this can be done in a 
followup patch.

Reviewed-by: Greg Kurz <groug@kaod.org>

> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: qemu-ppc@nongnu.org
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes series v1 -> v2:
> * New patch added to series
> ---
>  hw/ppc/spapr.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 82040cc5d1..3c6d6f2cea 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -3603,8 +3603,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
>      mc->default_boot_order = "";
>      mc->default_ram_size = 512 * M_BYTE;
>      mc->kvm_type = spapr_kvm_type;
> -    /*TODO: allow only sysbus devices that really work with this machine */
> -    machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SYS_BUS_DEVICE);
> +    machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SPAPR_PCI_HOST_BRIDGE);
>      mc->pci_allow_0_address = true;
>      mc->get_hotplug_handler = spapr_get_hotplug_handler;
>      hc->pre_plug = spapr_machine_device_pre_plug;


Re: [Qemu-devel] [PATCH v2 4/6] spapr: Allow only supported dynamic sysbus devices
Posted by David Gibson 8 years, 2 months ago
On Sat, Nov 25, 2017 at 01:16:08PM -0200, Eduardo Habkost wrote:
> TYPE_SPAPR_PCI_HOST_BRIDGE is the only dynamic sysbus device not
> rejected by ppc_spapr_reset(), so it can be the only entry on the
> allowed list.
> 
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: qemu-ppc@nongnu.org
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Acked-by: David Gibson <david@gibson.dropbear.id.au>

Again, do you need me to take this through my tree?

> ---
> Changes series v1 -> v2:
> * New patch added to series
> ---
>  hw/ppc/spapr.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 82040cc5d1..3c6d6f2cea 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -3603,8 +3603,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
>      mc->default_boot_order = "";
>      mc->default_ram_size = 512 * M_BYTE;
>      mc->kvm_type = spapr_kvm_type;
> -    /*TODO: allow only sysbus devices that really work with this machine */
> -    machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SYS_BUS_DEVICE);
> +    machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SPAPR_PCI_HOST_BRIDGE);
>      mc->pci_allow_0_address = true;
>      mc->get_hotplug_handler = spapr_get_hotplug_handler;
>      hc->pre_plug = spapr_machine_device_pre_plug;

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson