diff mbox series

[V11,6/8] hw/arm/virt: add configure interface for pvpanic-mmio

Message ID 1543865209-50994-7-git-send-email-peng.hao2@zte.com.cn (mailing list archive)
State New, archived
Headers show
Series add pvpanic mmio support | expand

Commit Message

Peng Hao Dec. 3, 2018, 7:26 p.m. UTC
Add configure interface for pvpanic-mmio device in virt machine.

Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 hw/arm/virt.c         | 23 +++++++++++++++++++++++
 include/hw/arm/virt.h |  1 +
 2 files changed, 24 insertions(+)

Comments

Andrew Jones Dec. 3, 2018, 11:18 a.m. UTC | #1
On Tue, Dec 04, 2018 at 03:26:47AM +0800, Peng Hao wrote:
> Add configure interface for pvpanic-mmio device in virt machine.
> 
> Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
> ---
>  hw/arm/virt.c         | 23 +++++++++++++++++++++++
>  include/hw/arm/virt.h |  1 +
>  2 files changed, 24 insertions(+)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index a4541fa..fdd3f20 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1655,6 +1655,20 @@ static void virt_set_its(Object *obj, bool value, Error **errp)
>      vms->its = value;
>  }
>  
> +static bool virt_get_pvpanic(Object *obj, Error **errp)
> +{
> +    VirtMachineState *vms = VIRT_MACHINE(obj);
> +
> +    return vms->pvpanic;
> +}
> +
> +static void virt_set_pvpanic(Object *obj, bool value, Error **errp)
> +{
> +    VirtMachineState *vms = VIRT_MACHINE(obj);
> +
> +    vms->pvpanic = value;
> +}
> +
>  static char *virt_get_gic_version(Object *obj, Error **errp)
>  {
>      VirtMachineState *vms = VIRT_MACHINE(obj);
> @@ -1884,6 +1898,15 @@ static void virt_3_1_instance_init(Object *obj)
>                                      "Valid values are none and smmuv3",
>                                      NULL);
>  
> +    /* Default disallows pvpanic-mmio instantiation */
> +    vms->pvpanic = false;
> +    object_property_add_bool(obj, "pvpanic", virt_get_pvpanic,
> +                             virt_set_pvpanic, NULL);
> +    object_property_set_description(obj, "pvpanic",
> +                                    "Set on/off to enable/disable "
> +                                    "PVPANIC MMIO device",
> +                                    NULL);
> +
>      vms->memmap = a15memmap;
>      vms->irqmap = a15irqmap;
>  }
> diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
> index 937c124..7d6d1c0 100644
> --- a/include/hw/arm/virt.h
> +++ b/include/hw/arm/virt.h
> @@ -113,6 +113,7 @@ typedef struct {
>      bool highmem;
>      bool highmem_ecam;
>      bool its;
> +    bool pvpanic;

This hunk should be squashed into 4/8 and the respective hunks of 7/8
should be squashed into 4/8 and 5/8.

Thanks,
drew

>      bool virt;
>      int32_t gic_version;
>      VirtIOMMUType iommu;
> -- 
> 1.8.3.1
>
Andrew Jones Dec. 3, 2018, 11:22 a.m. UTC | #2
On Mon, Dec 03, 2018 at 12:18:36PM +0100, Andrew Jones wrote:
> On Tue, Dec 04, 2018 at 03:26:47AM +0800, Peng Hao wrote:
> > Add configure interface for pvpanic-mmio device in virt machine.
> > 
> > Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
> > ---
> >  hw/arm/virt.c         | 23 +++++++++++++++++++++++
> >  include/hw/arm/virt.h |  1 +
> >  2 files changed, 24 insertions(+)
> > 
> > diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> > index a4541fa..fdd3f20 100644
> > --- a/hw/arm/virt.c
> > +++ b/hw/arm/virt.c
> > @@ -1655,6 +1655,20 @@ static void virt_set_its(Object *obj, bool value, Error **errp)
> >      vms->its = value;
> >  }
> >  
> > +static bool virt_get_pvpanic(Object *obj, Error **errp)
> > +{
> > +    VirtMachineState *vms = VIRT_MACHINE(obj);
> > +
> > +    return vms->pvpanic;
> > +}
> > +
> > +static void virt_set_pvpanic(Object *obj, bool value, Error **errp)
> > +{
> > +    VirtMachineState *vms = VIRT_MACHINE(obj);
> > +
> > +    vms->pvpanic = value;
> > +}
> > +
> >  static char *virt_get_gic_version(Object *obj, Error **errp)
> >  {
> >      VirtMachineState *vms = VIRT_MACHINE(obj);
> > @@ -1884,6 +1898,15 @@ static void virt_3_1_instance_init(Object *obj)
> >                                      "Valid values are none and smmuv3",
> >                                      NULL);
> >  
> > +    /* Default disallows pvpanic-mmio instantiation */
> > +    vms->pvpanic = false;
> > +    object_property_add_bool(obj, "pvpanic", virt_get_pvpanic,
> > +                             virt_set_pvpanic, NULL);
> > +    object_property_set_description(obj, "pvpanic",
> > +                                    "Set on/off to enable/disable "
> > +                                    "PVPANIC MMIO device",
> > +                                    NULL);
> > +
> >      vms->memmap = a15memmap;
> >      vms->irqmap = a15irqmap;
> >  }
> > diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
> > index 937c124..7d6d1c0 100644
> > --- a/include/hw/arm/virt.h
> > +++ b/include/hw/arm/virt.h
> > @@ -113,6 +113,7 @@ typedef struct {
> >      bool highmem;
> >      bool highmem_ecam;
> >      bool its;
> > +    bool pvpanic;
> 
> This hunk should be squashed into 4/8 and the respective hunks of 7/8
> should be squashed into 4/8 and 5/8.
>

With the above changes

Reviewed-by: Andrew Jones <drjones@redhat.com>
diff mbox series

Patch

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a4541fa..fdd3f20 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1655,6 +1655,20 @@  static void virt_set_its(Object *obj, bool value, Error **errp)
     vms->its = value;
 }
 
+static bool virt_get_pvpanic(Object *obj, Error **errp)
+{
+    VirtMachineState *vms = VIRT_MACHINE(obj);
+
+    return vms->pvpanic;
+}
+
+static void virt_set_pvpanic(Object *obj, bool value, Error **errp)
+{
+    VirtMachineState *vms = VIRT_MACHINE(obj);
+
+    vms->pvpanic = value;
+}
+
 static char *virt_get_gic_version(Object *obj, Error **errp)
 {
     VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -1884,6 +1898,15 @@  static void virt_3_1_instance_init(Object *obj)
                                     "Valid values are none and smmuv3",
                                     NULL);
 
+    /* Default disallows pvpanic-mmio instantiation */
+    vms->pvpanic = false;
+    object_property_add_bool(obj, "pvpanic", virt_get_pvpanic,
+                             virt_set_pvpanic, NULL);
+    object_property_set_description(obj, "pvpanic",
+                                    "Set on/off to enable/disable "
+                                    "PVPANIC MMIO device",
+                                    NULL);
+
     vms->memmap = a15memmap;
     vms->irqmap = a15irqmap;
 }
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index 937c124..7d6d1c0 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -113,6 +113,7 @@  typedef struct {
     bool highmem;
     bool highmem_ecam;
     bool its;
+    bool pvpanic;
     bool virt;
     int32_t gic_version;
     VirtIOMMUType iommu;