Re: [kvmarm] [RFC v5 7/8] hw/kvm/arm_gic: Implement support for KVM in-kernel ARM GIC

2013-01-31 Thread Andreas Färber
Am 31.01.2013 11:52, schrieb KONRAD Frédéric:
 On 24/01/2013 16:43, Peter Maydell wrote:
 Implement support for using the KVM in-kernel GIC for ARM.

 Signed-off-by: Peter Maydell peter.mayd...@linaro.org
 ---
   hw/a15mpcore.c   |8 ++-
   hw/arm/Makefile.objs |1 +
   hw/kvm/arm_gic.c |  169
 ++
   3 files changed, 177 insertions(+), 1 deletion(-)
   create mode 100644 hw/kvm/arm_gic.c

 diff --git a/hw/a15mpcore.c b/hw/a15mpcore.c
 index fe6c34c..1ca6f28 100644
 --- a/hw/a15mpcore.c
 +++ b/hw/a15mpcore.c
 @@ -19,6 +19,7 @@
*/
 #include sysbus.h
 +#include sysemu/kvm.h
 /* A15MP private memory region.  */
   @@ -40,8 +41,13 @@ static int a15mp_priv_init(SysBusDevice *dev)
   {
   A15MPPrivState *s = FROM_SYSBUS(A15MPPrivState, dev);
   SysBusDevice *busdev;
 +const char *gictype = arm-gic;
 s/arm-gic/arm_gic/ ^^ ?
 
 Christoffer and I had trouble with that:
 
 qemu-system-arm: Unknown device 'arm-gic' for default sysbus

Since you already ran into issues here, even better would be to use a
TYPE_ARM_GIC constant or so.

Andreas

 
 Fred
   -s-gic = qdev_create(NULL, arm_gic);
 +if (kvm_irqchip_in_kernel()) {
 +gictype = kvm-arm-gic;
 +}
 +
 +s-gic = qdev_create(NULL, gictype);
   qdev_prop_set_uint32(s-gic, num-cpu, s-num_cpu);
   qdev_prop_set_uint32(s-gic, num-irq, s-num_irq);
 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [kvmarm] [RFC v5 7/8] hw/kvm/arm_gic: Implement support for KVM in-kernel ARM GIC

2013-01-31 Thread KONRAD Frédéric

On 24/01/2013 16:43, Peter Maydell wrote:

Implement support for using the KVM in-kernel GIC for ARM.

Signed-off-by: Peter Maydell peter.mayd...@linaro.org
---
  hw/a15mpcore.c   |8 ++-
  hw/arm/Makefile.objs |1 +
  hw/kvm/arm_gic.c |  169 ++
  3 files changed, 177 insertions(+), 1 deletion(-)
  create mode 100644 hw/kvm/arm_gic.c

diff --git a/hw/a15mpcore.c b/hw/a15mpcore.c
index fe6c34c..1ca6f28 100644
--- a/hw/a15mpcore.c
+++ b/hw/a15mpcore.c
@@ -19,6 +19,7 @@
   */
  
  #include sysbus.h

+#include sysemu/kvm.h
  
  /* A15MP private memory region.  */
  
@@ -40,8 +41,13 @@ static int a15mp_priv_init(SysBusDevice *dev)

  {
  A15MPPrivState *s = FROM_SYSBUS(A15MPPrivState, dev);
  SysBusDevice *busdev;
+const char *gictype = arm-gic;

s/arm-gic/arm_gic/ ^^ ?

Christoffer and I had trouble with that:

qemu-system-arm: Unknown device 'arm-gic' for default sysbus

Fred
  
-s-gic = qdev_create(NULL, arm_gic);

+if (kvm_irqchip_in_kernel()) {
+gictype = kvm-arm-gic;
+}
+
+s-gic = qdev_create(NULL, gictype);
  qdev_prop_set_uint32(s-gic, num-cpu, s-num_cpu);
  qdev_prop_set_uint32(s-gic, num-irq, s-num_irq);


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [kvmarm] [RFC v5 7/8] hw/kvm/arm_gic: Implement support for KVM in-kernel ARM GIC

2013-01-31 Thread Peter Maydell
On 31 January 2013 10:54, Andreas Färber afaer...@suse.de wrote:
 Am 31.01.2013 11:52, schrieb KONRAD Frédéric:
 +const char *gictype = arm-gic;
 s/arm-gic/arm_gic/ ^^ ?

 Christoffer and I had trouble with that:

 qemu-system-arm: Unknown device 'arm-gic' for default sysbus

Oops, nice catch.

 Since you already ran into issues here, even better would be to use a
 TYPE_ARM_GIC constant or so.

Hmm, I kind of agree, but QOM idiom doesn't seem to encourage
having that define be publicly visible. Should we have a
hw/my_device.h [with the public bits like the TYPE_ and
FOO_CLASS/FOO_GET_CLASS macros] for every type? (and a
hw/my_device_priv.h if needed]

-- PMM
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html