rework the ICS classes inheritance tree
v2 cover rework the ICS classes inheritance tree
Hello,
It makes the class hierarchy much cleaner and removes duplicated code. As we are touching the location of the objects states, migration compatibility was checked and the following tests were performed under KVM :
qemu-3.0 (pseries-3.0) -> qemu-3.0 (pseries-3.0) OK qemu-3.0 (pseries-2.12) -> qemu-2.12 (pseries-2.12) OK qemu-3.0 (pseries-2.11) -> qemu-2.11 (pseries-2.11) OK qemu-3.0 (pseries-2.10) -> qemu-2.10 (pseries-2.10) OK qemu-3.0 (pseries-2.9) -> qemu-2.9 (pseries-2.9) OK qemu-3.0 (pseries-2.8) -> qemu-2.8 (pseries-2.8) OK qemu-3.0 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL
and back :
qemu-3.0 (pseries-3.0) <- qemu-3.0 (pseries-3.0) OK qemu-3.0 (pseries-2.12) <- qemu-2.12 (pseries-2.12) OK qemu-3.0 (pseries-2.11) <- qemu-2.11 (pseries-2.11) OK qemu-3.0 (pseries-2.10) <- qemu-2.10 (pseries-2.10) OK qemu-3.0 (pseries-2.9) <- qemu-2.9 (pseries-2.9) OK qemu-3.0 (pseries-2.8) <- qemu-2.8 (pseries-2.8) OK qemu-3.0 (pseries-2.7) <- qemu-2.7 (pseries-2.7) OK
under TCG, same scenarios were run but up to 2.10 only, in which case the migration fails for other reasons.
I wouldn't mind some extra cross checking from someone else.
Thanks,
C.
Changes since v2:
- split the patch in smaller units. The migration tests were not rerun because the code is very much the same. make check was run on each patch.
Cédric Le Goater (5):
ppc/xics: introduce a parent_realize in ICSStateClass ppc/xics: move the instance_init handler under the ics-base class ppx/xics: introduce a parent_reset in ICSStateClass ppc/xics: move the vmstate structures under the ics-base class ppc/xics: rework the ICS classes inheritance tree
include/hw/ppc/xics.h | 4 +- hw/intc/xics.c | 164 ++++++++++++++++++++++++++++---------------------- hw/intc/xics_kvm.c | 46 +++++++------- hw/ppc/spapr.c | 2 +- 4 files changed, 121 insertions(+), 95 deletions(-)
Signature · 1 line
2.13.6
PATCH v2 1/5 ppc/xics: introduce a parent_realize in ICSStateClass
This makes possible to move the common ICSState code of the realize handlers in the ics-base class.
--- include/hw/ppc/xics.h | 3 ++- hw/intc/xics.c | 37 ++++++++++++++++++++++--------------- hw/intc/xics_kvm.c | 20 +++++++++++++++----- 3 files changed, 39 insertions(+), 21 deletions(-)
include/hw/ppc/xics.h +2 -1
@@ -115,7 +115,8 @@ struct PnvICPState {struct ICSStateClass {DeviceClass parent_class; -void (*realize)(ICSState *s,Error **errp); +DeviceRealize parent_realize; +void (*pre_save)(ICSState *s);int (*post_load)(ICSState *s,int version_id);void (*reject)(ICSState *s,uint32_t irq);
hw/intc/xics.c +22 -15
@@ -618,30 +618,31 @@ static void ics_simple_initfn(Object *obj) ics->offset =XICS_IRQ_BASE ; } -static void ics_simple_realize (ICSState *ics,Error **errp) +static void ics_simple_realize (DeviceState *dev,Error **errp) { -if (!ics->nr_irqs) { -error_setg (errp,"Number of interrupts needs to be greater 0" ); +ICSState *ics =ICS_SIMPLE (dev); +ICSStateClass *icsc =ICS_BASE_GET_CLASS (ics); +Error *local_err =NULL ; + + icsc->parent_realize (dev, &local_err); +if (local_err) { +error_propagate (errp, local_err);return ; } - ics->irqs =g_malloc0 (ics->nr_irqs *sizeof (ICSIRQState)); + ics->qirqs =qemu_allocate_irqs (ics_simple_set_irq, ics, ics->nr_irqs);qemu_register_reset (ics_simple_reset, ics); } -static Property ics_simple_properties[] = { -DEFINE_PROP_UINT32 ("nr-irqs" , ICSState, nr_irqs,0 ), -DEFINE_PROP_END_OF_LIST (), -}; -static void ics_simple_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass);ICSStateClass *isc =ICS_BASE_CLASS (klass); - isc->realize = ics_simple_realize; - dc->props = ics_simple_properties; +device_class_set_parent_realize (dc, ics_simple_realize, + &isc->parent_realize); + dc->vmsd = &vmstate_ics_simple; isc->reject = ics_simple_reject; isc->resend = ics_simple_resend;
@@ -659,7 +660,6 @@ static const TypeInfo ics_simple_info = {static void ics_base_realize (DeviceState *dev,Error **errp) { -ICSStateClass *icsc =ICS_BASE_GET_CLASS (dev);ICSState *ics =ICS_BASE (dev);Object *obj;Error *err =NULL ;
@@ -672,17 +672,24 @@ static void ics_base_realize(DeviceState *dev, Error **errp) } ics->xics =XICS_FABRIC (obj); - -if (icsc->realize) { - icsc->realize (ics, errp); +if (!ics->nr_irqs) { +error_setg (errp,"Number of interrupts needs to be greater 0" ); +return ; } + ics->irqs =g_malloc0 (ics->nr_irqs *sizeof (ICSIRQState)); } +static Property ics_base_properties[] = { +DEFINE_PROP_UINT32 ("nr-irqs" , ICSState, nr_irqs,0 ), +DEFINE_PROP_END_OF_LIST (), +}; +static void ics_base_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = ics_base_realize; + dc->props = ics_base_properties; }static const TypeInfo ics_base_info = {
hw/intc/xics_kvm.c +15 -5
@@ -345,13 +345,17 @@ static void ics_kvm_reset(void *dev)ics_set_kvm_state (ics,1 ); } -static void ics_kvm_realize (ICSState *ics,Error **errp) +static void ics_kvm_realize (DeviceState *dev,Error **errp) { -if (!ics->nr_irqs) { -error_setg (errp,"Number of interrupts needs to be greater 0" ); +ICSState *ics =ICS_KVM (dev); +ICSStateClass *icsc =ICS_BASE_GET_CLASS (ics); +Error *local_err =NULL ; + + icsc->parent_realize (dev, &local_err); +if (local_err) { +error_propagate (errp, local_err);return ; } - ics->irqs =g_malloc0 (ics->nr_irqs *sizeof (ICSIRQState)); ics->qirqs =qemu_allocate_irqs (ics_kvm_set_irq, ics, ics->nr_irqs);qemu_register_reset (ics_kvm_reset, ics);
@@ -360,8 +364,14 @@ static void ics_kvm_realize(ICSState *ics, Error **errp)static void ics_kvm_class_init (ObjectClass *klass,void *data) {ICSStateClass *icsc =ICS_BASE_CLASS (klass); +DeviceClass *dc =DEVICE_CLASS (klass); + +/* +* Use device_class_set_parent_realize() when ics-kvm inherits +* directly from ics-base and not from ics-simple anymore. +*/ + dc->realize = ics_kvm_realize; - icsc->realize = ics_kvm_realize; icsc->pre_save = ics_get_kvm_state; icsc->post_load = ics_set_kvm_state; icsc->synchronize_state = ics_synchronize_state;
Signature · 1 line
2.13.6
David Gibson
AppliedRe: [Qemu-devel] [PATCH v2 1/5] ppc/xics: introduce a parent_realize in ICSStateClass
Quoted 4 lines · Cédric Le Goater
This makes possible to move the common ICSState code of the realize handlers in the ics-base class.
Signed-off-by Cédric Le Goater <[email protected]>
Applied to ppc-for-3.0, thanks.
Quoted 145 lines
--- include/hw/ppc/xics.h | 3 ++- hw/intc/xics.c | 37 ++++++++++++++++++++++--------------- hw/intc/xics_kvm.c | 20 +++++++++++++++----- 3 files changed, 39 insertions(+), 21 deletions(-)include/hw/ppc/xics.h +2
-1@@ -115,7 +115,8 @@ struct PnvICPState {struct ICSStateClass {DeviceClass parent_class; -void (*realize)(ICSState *s,Error **errp); +DeviceRealize parent_realize; +void (*pre_save)(ICSState *s);int (*post_load)(ICSState *s,int version_id);void (*reject)(ICSState *s,uint32_t irq);hw/intc/xics.c +22
-15@@ -618,30 +618,31 @@ static void ics_simple_initfn(Object *obj) ics->offset =XICS_IRQ_BASE ; } -static void ics_simple_realize (ICSState *ics,Error **errp) +static void ics_simple_realize (DeviceState *dev,Error **errp) { -if (!ics->nr_irqs) { -error_setg (errp,"Number of interrupts needs to be greater 0" ); +ICSState *ics =ICS_SIMPLE (dev); +ICSStateClass *icsc =ICS_BASE_GET_CLASS (ics); +Error *local_err =NULL ; + + icsc->parent_realize (dev, &local_err); +if (local_err) { +error_propagate (errp, local_err);return ; } - ics->irqs =g_malloc0 (ics->nr_irqs *sizeof (ICSIRQState)); + ics->qirqs =qemu_allocate_irqs (ics_simple_set_irq, ics, ics->nr_irqs);qemu_register_reset (ics_simple_reset, ics); } -static Property ics_simple_properties[] = { -DEFINE_PROP_UINT32 ("nr-irqs" , ICSState, nr_irqs,0 ), -DEFINE_PROP_END_OF_LIST (), -}; -static void ics_simple_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass);ICSStateClass *isc =ICS_BASE_CLASS (klass); - isc->realize = ics_simple_realize; - dc->props = ics_simple_properties; +device_class_set_parent_realize (dc, ics_simple_realize, + &isc->parent_realize); + dc->vmsd = &vmstate_ics_simple; isc->reject = ics_simple_reject; isc->resend = ics_simple_resend;@@ -659,7 +660,6 @@ static const TypeInfo ics_simple_info = {static void ics_base_realize (DeviceState *dev,Error **errp) { -ICSStateClass *icsc =ICS_BASE_GET_CLASS (dev);ICSState *ics =ICS_BASE (dev);Object *obj;Error *err =NULL ;@@ -672,17 +672,24 @@ static void ics_base_realize(DeviceState *dev, Error **errp) } ics->xics =XICS_FABRIC (obj); - -if (icsc->realize) { - icsc->realize (ics, errp); +if (!ics->nr_irqs) { +error_setg (errp,"Number of interrupts needs to be greater 0" ); +return ; } + ics->irqs =g_malloc0 (ics->nr_irqs *sizeof (ICSIRQState)); } +static Property ics_base_properties[] = { +DEFINE_PROP_UINT32 ("nr-irqs" , ICSState, nr_irqs,0 ), +DEFINE_PROP_END_OF_LIST (), +}; +static void ics_base_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = ics_base_realize; + dc->props = ics_base_properties; }static const TypeInfo ics_base_info = {hw/intc/xics_kvm.c +15
-5@@ -345,13 +345,17 @@ static void ics_kvm_reset(void *dev)ics_set_kvm_state (ics,1 ); } -static void ics_kvm_realize (ICSState *ics,Error **errp) +static void ics_kvm_realize (DeviceState *dev,Error **errp) { -if (!ics->nr_irqs) { -error_setg (errp,"Number of interrupts needs to be greater 0" ); +ICSState *ics =ICS_KVM (dev); +ICSStateClass *icsc =ICS_BASE_GET_CLASS (ics); +Error *local_err =NULL ; + + icsc->parent_realize (dev, &local_err); +if (local_err) { +error_propagate (errp, local_err);return ; } - ics->irqs =g_malloc0 (ics->nr_irqs *sizeof (ICSIRQState)); ics->qirqs =qemu_allocate_irqs (ics_kvm_set_irq, ics, ics->nr_irqs);qemu_register_reset (ics_kvm_reset, ics);@@ -360,8 +364,14 @@ static void ics_kvm_realize(ICSState *ics, Error **errp)static void ics_kvm_class_init (ObjectClass *klass,void *data) {ICSStateClass *icsc =ICS_BASE_CLASS (klass); +DeviceClass *dc =DEVICE_CLASS (klass); + +/* +* Use device_class_set_parent_realize() when ics-kvm inherits +* directly from ics-base and not from ics-simple anymore. +*/ + dc->realize = ics_kvm_realize; - icsc->realize = ics_kvm_realize; icsc->pre_save = ics_get_kvm_state; icsc->post_load = ics_set_kvm_state; icsc->synchronize_state = ics_synchronize_state;
Signature · 4 lines
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
PATCH v2 2/5 ppc/xics: move the instance_init handler under the ics-base class
In reply to Cédric Le Goater--- hw/intc/xics.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
hw/intc/xics.c +8 -8
@@ -611,13 +611,6 @@ static const VMStateDescription vmstate_ics_simple = { }, }; -static void ics_simple_initfn (Object *obj) -{ -ICSState *ics =ICS_SIMPLE (obj); - - ics->offset =XICS_IRQ_BASE ; -} -static void ics_simple_realize (DeviceState *dev,Error **errp) {ICSState *ics =ICS_SIMPLE (dev);
@@ -655,7 +648,6 @@ static const TypeInfo ics_simple_info = { .instance_size = sizeof(ICSState), .class_init = ics_simple_class_init, .class_size = sizeof(ICSStateClass), - .instance_init = ics_simple_initfn, };static void ics_base_realize (DeviceState *dev,Error **errp)
@@ -679,6 +671,13 @@ static void ics_base_realize(DeviceState *dev, Error **errp) ics->irqs =g_malloc0 (ics->nr_irqs *sizeof (ICSIRQState)); } +static void ics_base_instance_init (Object *obj) +{ +ICSState *ics =ICS_BASE (obj); + + ics->offset =XICS_IRQ_BASE ; +} +static Property ics_base_properties[] = {DEFINE_PROP_UINT32 ("nr-irqs" , ICSState, nr_irqs,0 ),DEFINE_PROP_END_OF_LIST (),
@@ -697,6 +696,7 @@ static const TypeInfo ics_base_info = { .parent = TYPE_DEVICE, .abstract = true, .instance_size = sizeof(ICSState), + .instance_init = ics_base_instance_init, .class_init = ics_base_class_init, .class_size = sizeof(ICSStateClass), };
Signature · 1 line
2.13.6
David Gibson
AppliedRe: [Qemu-devel] [PATCH v2 2/5] ppc/xics: move the instance_init handler under the ics-base class
Quoted 4 lines · Cédric Le Goater
Signed-off-by Cédric Le Goater <[email protected]>--- hw/intc/xics.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
Applied, thanks.
Quoted 48 lines
hw/intc/xics.c +8
-8@@ -611,13 +611,6 @@ static const VMStateDescription vmstate_ics_simple = { }, }; -static void ics_simple_initfn (Object *obj) -{ -ICSState *ics =ICS_SIMPLE (obj); - - ics->offset =XICS_IRQ_BASE ; -} -static void ics_simple_realize (DeviceState *dev,Error **errp) {ICSState *ics =ICS_SIMPLE (dev);@@ -655,7 +648,6 @@ static const TypeInfo ics_simple_info = { .instance_size = sizeof(ICSState), .class_init = ics_simple_class_init, .class_size = sizeof(ICSStateClass), - .instance_init = ics_simple_initfn, };static void ics_base_realize (DeviceState *dev,Error **errp)@@ -679,6 +671,13 @@ static void ics_base_realize(DeviceState *dev, Error **errp) ics->irqs =g_malloc0 (ics->nr_irqs *sizeof (ICSIRQState)); } +static void ics_base_instance_init (Object *obj) +{ +ICSState *ics =ICS_BASE (obj); + + ics->offset =XICS_IRQ_BASE ; +} +static Property ics_base_properties[] = {DEFINE_PROP_UINT32 ("nr-irqs" , ICSState, nr_irqs,0 ),DEFINE_PROP_END_OF_LIST (),@@ -697,6 +696,7 @@ static const TypeInfo ics_base_info = { .parent = TYPE_DEVICE, .abstract = true, .instance_size = sizeof(ICSState), + .instance_init = ics_base_instance_init, .class_init = ics_base_class_init, .class_size = sizeof(ICSStateClass), };
Signature · 4 lines
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
PATCH v2 3/5 ppx/xics: introduce a parent_reset in ICSStateClass
In reply to Cédric Le GoaterJust like for the realize handlers, this makes possible to move the common ICSState code of the reset handlers in the ics-base class.
--- include/hw/ppc/xics.h | 1 + hw/intc/xics.c | 45 ++++++++++++++++++++++++++++++--------------- hw/intc/xics_kvm.c | 26 ++++++++++---------------- 3 files changed, 41 insertions(+), 31 deletions(-)
include/hw/ppc/xics.h +1 -0
@@ -116,6 +116,7 @@ struct ICSStateClass {DeviceClass parent_class;DeviceRealize parent_realize; +DeviceReset parent_reset;void (*pre_save)(ICSState *s);int (*post_load)(ICSState *s,int version_id);
hw/intc/xics.c +30 -15
78 lines not on this page · raw message
hw/intc/xics_kvm.c +10 -16
@@ -324,25 +324,18 @@ static void ics_kvm_set_irq(void *opaque, int srcno, int val) } } -static void ics_kvm_reset (void *dev) +static void ics_kvm_reset (DeviceState *dev) { -ICSState *ics =ICS_SIMPLE (dev); -int i; -uint8_t flags[ics->nr_irqs]; - -for (i =0 ; i < ics->nr_irqs; i++) { - flags[i] = ics->irqs[i].flags; - } +ICSStateClass *icsc =ICS_BASE_GET_CLASS (dev); -memset (ics->irqs,0 ,sizeof (ICSIRQState) * ics->nr_irqs); + icsc->parent_reset (dev); -for (i =0 ; i < ics->nr_irqs; i++) { - ics->irqs[i].priority =0xff ; - ics->irqs[i].saved_priority =0xff ; - ics->irqs[i].flags = flags[i]; - } +ics_set_kvm_state (ICS_KVM (dev),1 ); +} -ics_set_kvm_state (ics,1 ); +static void ics_kvm_reset_handler (void *dev) +{ +ics_kvm_reset (dev); }static void ics_kvm_realize (DeviceState *dev,Error **errp)
@@ -358,7 +351,7 @@ static void ics_kvm_realize(DeviceState *dev, Error **errp) } ics->qirqs =qemu_allocate_irqs (ics_kvm_set_irq, ics, ics->nr_irqs); -qemu_register_reset (ics_kvm_reset, ics); +qemu_register_reset (ics_kvm_reset_handler, ics); }static void ics_kvm_class_init (ObjectClass *klass,void *data)
@@ -371,6 +364,7 @@ static void ics_kvm_class_init(ObjectClass *klass, void *data)* directly from ics-base and not from ics-simple anymore. */ dc->realize = ics_kvm_realize; + dc->reset = ics_kvm_reset; icsc->pre_save = ics_get_kvm_state; icsc->post_load = ics_set_kvm_state;
Signature · 1 line
2.13.6
David Gibson
AppliedRe: [Qemu-devel] [PATCH v2 3/5] ppx/xics: introduce a parent_reset in ICSStateClass
Quoted 4 lines · Cédric Le Goater
Just like for the realize handlers, this makes possible to move the common ICSState code of the reset handlers in the ics-base class.
Signed-off-by Cédric Le Goater <[email protected]>
Applied, thanks.
Quoted 160 lines
--- include/hw/ppc/xics.h | 1 + hw/intc/xics.c | 45 ++++++++++++++++++++++++++++++--------------- hw/intc/xics_kvm.c | 26 ++++++++++---------------- 3 files changed, 41 insertions(+), 31 deletions(-)include/hw/ppc/xics.h +1
-0@@ -116,6 +116,7 @@ struct ICSStateClass {DeviceClass parent_class;DeviceRealize parent_realize; +DeviceReset parent_reset;void (*pre_save)(ICSState *s);int (*post_load)(ICSState *s,int version_id);hw/intc/xics.c +30
-15@@ -537,23 +537,16 @@ static void ics_simple_eoi(ICSState *ics, uint32_t nr) } } -static void ics_simple_reset (void *dev) +static void ics_simple_reset (DeviceState *dev) { -ICSState *ics =ICS_SIMPLE (dev); -int i; -uint8_t flags[ics->nr_irqs]; +ICSStateClass *icsc =ICS_BASE_GET_CLASS (dev); -for (i =0 ; i < ics->nr_irqs; i++) { - flags[i] = ics->irqs[i].flags; - } - -memset (ics->irqs,0 ,sizeof (ICSIRQState) * ics->nr_irqs); + icsc->parent_reset (dev); +} -for (i =0 ; i < ics->nr_irqs; i++) { - ics->irqs[i].priority =0xff ; - ics->irqs[i].saved_priority =0xff ; - ics->irqs[i].flags = flags[i]; - } +static void ics_simple_reset_handler (void *dev) +{ +ics_simple_reset (dev); }static int ics_simple_dispatch_pre_save (void *opaque)@@ -625,7 +618,7 @@ static void ics_simple_realize(DeviceState *dev, Error **errp) ics->qirqs =qemu_allocate_irqs (ics_simple_set_irq, ics, ics->nr_irqs); -qemu_register_reset (ics_simple_reset, ics); +qemu_register_reset (ics_simple_reset_handler, ics); }static void ics_simple_class_init (ObjectClass *klass,void *data)@@ -635,6 +628,8 @@ static void ics_simple_class_init(ObjectClass *klass, void *data)device_class_set_parent_realize (dc, ics_simple_realize, &isc->parent_realize); +device_class_set_parent_reset (dc, ics_simple_reset, + &isc->parent_reset); dc->vmsd = &vmstate_ics_simple; isc->reject = ics_simple_reject;@@ -650,6 +645,25 @@ static const TypeInfo ics_simple_info = { .class_size = sizeof(ICSStateClass), }; +static void ics_base_reset (DeviceState *dev) +{ +ICSState *ics =ICS_BASE (dev); +int i; +uint8_t flags[ics->nr_irqs]; + +for (i =0 ; i < ics->nr_irqs; i++) { + flags[i] = ics->irqs[i].flags; + } + +memset (ics->irqs,0 ,sizeof (ICSIRQState) * ics->nr_irqs); + +for (i =0 ; i < ics->nr_irqs; i++) { + ics->irqs[i].priority =0xff ; + ics->irqs[i].saved_priority =0xff ; + ics->irqs[i].flags = flags[i]; + } +} +static void ics_base_realize (DeviceState *dev,Error **errp) {ICSState *ics =ICS_BASE (dev);@@ -689,6 +703,7 @@ static void ics_base_class_init(ObjectClass *klass, void *data) dc->realize = ics_base_realize; dc->props = ics_base_properties; + dc->reset = ics_base_reset; }static const TypeInfo ics_base_info = {hw/intc/xics_kvm.c +10
-16@@ -324,25 +324,18 @@ static void ics_kvm_set_irq(void *opaque, int srcno, int val) } } -static void ics_kvm_reset (void *dev) +static void ics_kvm_reset (DeviceState *dev) { -ICSState *ics =ICS_SIMPLE (dev); -int i; -uint8_t flags[ics->nr_irqs]; - -for (i =0 ; i < ics->nr_irqs; i++) { - flags[i] = ics->irqs[i].flags; - } +ICSStateClass *icsc =ICS_BASE_GET_CLASS (dev); -memset (ics->irqs,0 ,sizeof (ICSIRQState) * ics->nr_irqs); + icsc->parent_reset (dev); -for (i =0 ; i < ics->nr_irqs; i++) { - ics->irqs[i].priority =0xff ; - ics->irqs[i].saved_priority =0xff ; - ics->irqs[i].flags = flags[i]; - } +ics_set_kvm_state (ICS_KVM (dev),1 ); +} -ics_set_kvm_state (ics,1 ); +static void ics_kvm_reset_handler (void *dev) +{ +ics_kvm_reset (dev); }static void ics_kvm_realize (DeviceState *dev,Error **errp)@@ -358,7 +351,7 @@ static void ics_kvm_realize(DeviceState *dev, Error **errp) } ics->qirqs =qemu_allocate_irqs (ics_kvm_set_irq, ics, ics->nr_irqs); -qemu_register_reset (ics_kvm_reset, ics); +qemu_register_reset (ics_kvm_reset_handler, ics); }static void ics_kvm_class_init (ObjectClass *klass,void *data)@@ -371,6 +364,7 @@ static void ics_kvm_class_init(ObjectClass *klass, void *data)* directly from ics-base and not from ics-simple anymore. */ dc->realize = ics_kvm_realize; + dc->reset = ics_kvm_reset; icsc->pre_save = ics_get_kvm_state; icsc->post_load = ics_set_kvm_state;
Signature · 4 lines
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
PATCH v2 4/5 ppc/xics: move the vmstate structures under the ics-base class
In reply to Cédric Le Goater--- hw/intc/xics.c | 112 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 56 insertions(+), 56 deletions(-)
hw/intc/xics.c +56 -56
@@ -549,61 +549,6 @@ static void ics_simple_reset_handler(void *dev)ics_simple_reset (dev); } -static int ics_simple_dispatch_pre_save (void *opaque) -{ -ICSState *ics = opaque; -ICSStateClass *info =ICS_BASE_GET_CLASS (ics); - -if (info->pre_save) { - info->pre_save (ics); - } - -return 0 ; -} - -static int ics_simple_dispatch_post_load (void *opaque,int version_id) -{ -ICSState *ics = opaque; -ICSStateClass *info =ICS_BASE_GET_CLASS (ics); - -if (info->post_load) { -return info->post_load (ics, version_id); - } - -return 0 ; -} - -static const VMStateDescription vmstate_ics_simple_irq = { - .name ="ics/irq" , - .version_id =2 , - .minimum_version_id =1 , - .fields = (VMStateField []) { -VMSTATE_UINT32 (server, ICSIRQState), -VMSTATE_UINT8 (priority, ICSIRQState), -VMSTATE_UINT8 (saved_priority, ICSIRQState), -VMSTATE_UINT8 (status, ICSIRQState), -VMSTATE_UINT8 (flags, ICSIRQState), -VMSTATE_END_OF_LIST () - }, -}; - -static const VMStateDescription vmstate_ics_simple = { - .name ="ics" , - .version_id =1 , - .minimum_version_id =1 , - .pre_save = ics_simple_dispatch_pre_save, - .post_load = ics_simple_dispatch_post_load, - .fields = (VMStateField []) { -/* Sanity check */ -VMSTATE_UINT32_EQUAL (nr_irqs, ICSState,NULL ), - -VMSTATE_STRUCT_VARRAY_POINTER_UINT32 (irqs, ICSState, nr_irqs, - vmstate_ics_simple_irq, - ICSIRQState), -VMSTATE_END_OF_LIST () - }, -}; -static void ics_simple_realize (DeviceState *dev,Error **errp) {ICSState *ics =ICS_SIMPLE (dev);
@@ -631,7 +576,6 @@ static void ics_simple_class_init(ObjectClass *klass, void *data)device_class_set_parent_reset (dc, ics_simple_reset, &isc->parent_reset); - dc->vmsd = &vmstate_ics_simple; isc->reject = ics_simple_reject; isc->resend = ics_simple_resend; isc->eoi = ics_simple_eoi;
@@ -692,6 +636,61 @@ static void ics_base_instance_init(Object *obj) ics->offset =XICS_IRQ_BASE ; } +static int ics_base_dispatch_pre_save (void *opaque) +{ +ICSState *ics = opaque; +ICSStateClass *info =ICS_BASE_GET_CLASS (ics); + +if (info->pre_save) { + info->pre_save (ics); + } + +return 0 ; +} + +static int ics_base_dispatch_post_load (void *opaque,int version_id) +{ +ICSState *ics = opaque; +ICSStateClass *info =ICS_BASE_GET_CLASS (ics); + +if (info->post_load) { +return info->post_load (ics, version_id); + } + +return 0 ; +} + +static const VMStateDescription vmstate_ics_base_irq = { + .name ="ics/irq" , + .version_id =2 , + .minimum_version_id =1 , + .fields = (VMStateField []) { +VMSTATE_UINT32 (server, ICSIRQState), +VMSTATE_UINT8 (priority, ICSIRQState), +VMSTATE_UINT8 (saved_priority, ICSIRQState), +VMSTATE_UINT8 (status, ICSIRQState), +VMSTATE_UINT8 (flags, ICSIRQState), +VMSTATE_END_OF_LIST () + }, +}; + +static const VMStateDescription vmstate_ics_base = { + .name ="ics" , + .version_id =1 , + .minimum_version_id =1 , + .pre_save = ics_base_dispatch_pre_save, + .post_load = ics_base_dispatch_post_load, + .fields = (VMStateField []) { +/* Sanity check */ +VMSTATE_UINT32_EQUAL (nr_irqs, ICSState,NULL ), + +VMSTATE_STRUCT_VARRAY_POINTER_UINT32 (irqs, ICSState, nr_irqs, + vmstate_ics_base_irq, + ICSIRQState), +VMSTATE_END_OF_LIST () + }, +}; +static Property ics_base_properties[] = {DEFINE_PROP_UINT32 ("nr-irqs" , ICSState, nr_irqs,0 ),DEFINE_PROP_END_OF_LIST (),
@@ -704,6 +703,7 @@ static void ics_base_class_init(ObjectClass *klass, void *data) dc->realize = ics_base_realize; dc->props = ics_base_properties; dc->reset = ics_base_reset; + dc->vmsd = &vmstate_ics_base; }static const TypeInfo ics_base_info = {
Signature · 1 line
2.13.6
David Gibson
AppliedRe: [Qemu-devel] [PATCH v2 4/5] ppc/xics: move the vmstate structures under the ics-base class
Quoted 1 line · Cédric Le Goater
Signed-off-by Cédric Le Goater <[email protected]>
Applied, thanks.
Quoted 148 lines
--- hw/intc/xics.c | 112 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 56 insertions(+), 56 deletions(-)hw/intc/xics.c +56
-56@@ -549,61 +549,6 @@ static void ics_simple_reset_handler(void *dev)ics_simple_reset (dev); } -static int ics_simple_dispatch_pre_save (void *opaque) -{ -ICSState *ics = opaque; -ICSStateClass *info =ICS_BASE_GET_CLASS (ics); - -if (info->pre_save) { - info->pre_save (ics); - } - -return 0 ; -} - -static int ics_simple_dispatch_post_load (void *opaque,int version_id) -{ -ICSState *ics = opaque; -ICSStateClass *info =ICS_BASE_GET_CLASS (ics); - -if (info->post_load) { -return info->post_load (ics, version_id); - } - -return 0 ; -} - -static const VMStateDescription vmstate_ics_simple_irq = { - .name ="ics/irq" , - .version_id =2 , - .minimum_version_id =1 , - .fields = (VMStateField []) { -VMSTATE_UINT32 (server, ICSIRQState), -VMSTATE_UINT8 (priority, ICSIRQState), -VMSTATE_UINT8 (saved_priority, ICSIRQState), -VMSTATE_UINT8 (status, ICSIRQState), -VMSTATE_UINT8 (flags, ICSIRQState), -VMSTATE_END_OF_LIST () - }, -}; - -static const VMStateDescription vmstate_ics_simple = { - .name ="ics" , - .version_id =1 , - .minimum_version_id =1 , - .pre_save = ics_simple_dispatch_pre_save, - .post_load = ics_simple_dispatch_post_load, - .fields = (VMStateField []) { -/* Sanity check */ -VMSTATE_UINT32_EQUAL (nr_irqs, ICSState,NULL ), - -VMSTATE_STRUCT_VARRAY_POINTER_UINT32 (irqs, ICSState, nr_irqs, - vmstate_ics_simple_irq, - ICSIRQState), -VMSTATE_END_OF_LIST () - }, -}; -static void ics_simple_realize (DeviceState *dev,Error **errp) {ICSState *ics =ICS_SIMPLE (dev);@@ -631,7 +576,6 @@ static void ics_simple_class_init(ObjectClass *klass, void *data)device_class_set_parent_reset (dc, ics_simple_reset, &isc->parent_reset); - dc->vmsd = &vmstate_ics_simple; isc->reject = ics_simple_reject; isc->resend = ics_simple_resend; isc->eoi = ics_simple_eoi;@@ -692,6 +636,61 @@ static void ics_base_instance_init(Object *obj) ics->offset =XICS_IRQ_BASE ; } +static int ics_base_dispatch_pre_save (void *opaque) +{ +ICSState *ics = opaque; +ICSStateClass *info =ICS_BASE_GET_CLASS (ics); + +if (info->pre_save) { + info->pre_save (ics); + } + +return 0 ; +} + +static int ics_base_dispatch_post_load (void *opaque,int version_id) +{ +ICSState *ics = opaque; +ICSStateClass *info =ICS_BASE_GET_CLASS (ics); + +if (info->post_load) { +return info->post_load (ics, version_id); + } + +return 0 ; +} + +static const VMStateDescription vmstate_ics_base_irq = { + .name ="ics/irq" , + .version_id =2 , + .minimum_version_id =1 , + .fields = (VMStateField []) { +VMSTATE_UINT32 (server, ICSIRQState), +VMSTATE_UINT8 (priority, ICSIRQState), +VMSTATE_UINT8 (saved_priority, ICSIRQState), +VMSTATE_UINT8 (status, ICSIRQState), +VMSTATE_UINT8 (flags, ICSIRQState), +VMSTATE_END_OF_LIST () + }, +}; + +static const VMStateDescription vmstate_ics_base = { + .name ="ics" , + .version_id =1 , + .minimum_version_id =1 , + .pre_save = ics_base_dispatch_pre_save, + .post_load = ics_base_dispatch_post_load, + .fields = (VMStateField []) { +/* Sanity check */ +VMSTATE_UINT32_EQUAL (nr_irqs, ICSState,NULL ), + +VMSTATE_STRUCT_VARRAY_POINTER_UINT32 (irqs, ICSState, nr_irqs, + vmstate_ics_base_irq, + ICSIRQState), +VMSTATE_END_OF_LIST () + }, +}; +static Property ics_base_properties[] = {DEFINE_PROP_UINT32 ("nr-irqs" , ICSState, nr_irqs,0 ),DEFINE_PROP_END_OF_LIST (),@@ -704,6 +703,7 @@ static void ics_base_class_init(ObjectClass *klass, void *data) dc->realize = ics_base_realize; dc->props = ics_base_properties; dc->reset = ics_base_reset; + dc->vmsd = &vmstate_ics_base; }static const TypeInfo ics_base_info = {
Signature · 4 lines
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
PATCH v2 5/5 ppc/xics: rework the ICS classes inheritance tree
In reply to Cédric Le GoaterWith the previous changes, we can now let the ICS_KVM class inherit directly from ICS_BASE class and not from the intermediate ICS_SIMPLE. It makes the class hierarchy much cleaner.
What is left in the top classes is the low level interface to access the KVM XICS device in ICS_KVM and the XICS emulating handlers in ICS_SIMPLE.
This should not break migration compatibility.
--- hw/intc/xics_kvm.c | 12 +++++------- hw/ppc/spapr.c | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-)
hw/intc/xics_kvm.c +5 -7
@@ -359,12 +359,10 @@ static void ics_kvm_class_init(ObjectClass *klass, void *data)ICSStateClass *icsc =ICS_BASE_CLASS (klass);DeviceClass *dc =DEVICE_CLASS (klass); -/* -* Use device_class_set_parent_realize() when ics-kvm inherits -* directly from ics-base and not from ics-simple anymore. -*/ - dc->realize = ics_kvm_realize; - dc->reset = ics_kvm_reset; +device_class_set_parent_realize (dc, ics_kvm_realize, + &icsc->parent_realize); +device_class_set_parent_reset (dc, ics_kvm_reset, + &icsc->parent_reset); icsc->pre_save = ics_get_kvm_state; icsc->post_load = ics_set_kvm_state;
@@ -373,7 +371,7 @@ static void ics_kvm_class_init(ObjectClass *klass, void *data)static const TypeInfo ics_kvm_info = { .name =TYPE_ICS_KVM , - .parent =TYPE_ICS_SIMPLE , + .parent =TYPE_ICS_BASE , .instance_size =sizeof (ICSState), .class_init = ics_kvm_class_init, };
hw/ppc/spapr.c +1 -1
@@ -137,7 +137,7 @@ static ICSState *spapr_ics_create(sPAPRMachineState *spapr, goto error; } -return ICS_SIMPLE (obj); +return ICS_BASE (obj); error:error_propagate (errp, local_err);
Signature · 1 line
2.13.6
David Gibson
AppliedRe: [Qemu-devel] [PATCH v2 5/5] ppc/xics: rework the ICS classes inheritance tree
Quoted 11 lines · Cédric Le Goater
With the previous changes, we can now let the
ICS_KVMclass inherit directly fromICS_BASEclass and not from the intermediateICS_SIMPLE. It makes the class hierarchy much cleaner.What is left in the top classes is the low level interface to access the KVM XICS device in
ICS_KVMand the XICS emulating handlers inICS_SIMPLE.This should not break migration compatibility.
Signed-off-by Cédric Le Goater <[email protected]>
Applied, thanks.
Quoted 48 lines
--- hw/intc/xics_kvm.c | 12 +++++------- hw/ppc/spapr.c | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-)hw/intc/xics_kvm.c +5
-7@@ -359,12 +359,10 @@ static void ics_kvm_class_init(ObjectClass *klass, void *data)ICSStateClass *icsc =ICS_BASE_CLASS (klass);DeviceClass *dc =DEVICE_CLASS (klass); -/* -* Use device_class_set_parent_realize() when ics-kvm inherits -* directly from ics-base and not from ics-simple anymore. -*/ - dc->realize = ics_kvm_realize; - dc->reset = ics_kvm_reset; +device_class_set_parent_realize (dc, ics_kvm_realize, + &icsc->parent_realize); +device_class_set_parent_reset (dc, ics_kvm_reset, + &icsc->parent_reset); icsc->pre_save = ics_get_kvm_state; icsc->post_load = ics_set_kvm_state;@@ -373,7 +371,7 @@ static void ics_kvm_class_init(ObjectClass *klass, void *data)static const TypeInfo ics_kvm_info = { .name =TYPE_ICS_KVM , - .parent =TYPE_ICS_SIMPLE , + .parent =TYPE_ICS_BASE , .instance_size =sizeof (ICSState), .class_init = ics_kvm_class_init, };hw/ppc/spapr.c +1
-1@@ -137,7 +137,7 @@ static ICSState *spapr_ics_create(sPAPRMachineState *spapr, goto error; } -return ICS_SIMPLE (obj); +return ICS_BASE (obj); error:error_propagate (errp, local_err);
Signature · 4 lines
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
Quoted 2 lines · On Mon, 25 Jun 2018 11:17:13 +0200 Cédric Le Goater <[email protected]> wrote:
Hello,
Hello,
Sorry I didn't manage to look at this before it got merged :)
Quoted 5 lines
It makes the class hierarchy much cleaner and removes duplicated code. As we are touching the location of the objects states, migration compatibility was checked and the following tests were performed under KVM :
Quoted 7 lines
qemu-3.0 (pseries-3.0) -> qemu-3.0 (pseries-3.0) OK qemu-3.0 (pseries-2.12) -> qemu-2.12 (pseries-2.12) OK qemu-3.0 (pseries-2.11) -> qemu-2.11 (pseries-2.11) OK qemu-3.0 (pseries-2.10) -> qemu-2.10 (pseries-2.10) OK qemu-3.0 (pseries-2.9) -> qemu-2.9 (pseries-2.9) OK qemu-3.0 (pseries-2.8) -> qemu-2.8 (pseries-2.8) OK qemu-3.0 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL
What's the failure ?
Quoted 40 lines
and back :
qemu-3.0 (pseries-3.0) <- qemu-3.0 (pseries-3.0) OK qemu-3.0 (pseries-2.12) <- qemu-2.12 (pseries-2.12) OK qemu-3.0 (pseries-2.11) <- qemu-2.11 (pseries-2.11) OK qemu-3.0 (pseries-2.10) <- qemu-2.10 (pseries-2.10) OK qemu-3.0 (pseries-2.9) <- qemu-2.9 (pseries-2.9) OK qemu-3.0 (pseries-2.8) <- qemu-2.8 (pseries-2.8) OK qemu-3.0 (pseries-2.7) <- qemu-2.7 (pseries-2.7) OKunder TCG, same scenarios were run but up to 2.10 only, in which case the migration fails for other reasons.
I wouldn't mind some extra cross checking from someone else.
Thanks,
C.
Changes since v2:
- split the patch in smaller units. The migration tests were not rerun because the code is very much the same. make check was run on each patch.
Cédric Le Goater (5):
ppc/xics: introduce aparent_realizein ICSStateClass ppc/xics: move theinstance_inithandler under the ics-base class ppx/xics: introduce aparent_resetin ICSStateClass ppc/xics: move the vmstate structures under the ics-base class ppc/xics: rework the ICS classes inheritance treeinclude/hw/ppc/xics.h | 4 +- hw/intc/xics.c | 164 ++++++++++++++++++++++++++++---------------------- hw/intc/xics_kvm.c | 46 +++++++------- hw/ppc/spapr.c | 2 +- 4 files changed, 121 insertions(+), 95 deletions(-)
Quoted 23 lines · Greg Kurz
Quoted 2 lines · On Mon, 25 Jun 2018 11:17:13 +0200 Cédric Le Goater <[email protected]> wrote:
Hello,
Hello,
Sorry I didn't manage to look at this before it got merged :)
Quoted 5 lines
It makes the class hierarchy much cleaner and removes duplicated code. As we are touching the location of the objects states, migration compatibility was checked and the following tests were performed under KVM :
Quoted 7 lines
qemu-3.0 (pseries-3.0) -> qemu-3.0 (pseries-3.0) OK qemu-3.0 (pseries-2.12) -> qemu-2.12 (pseries-2.12) OK qemu-3.0 (pseries-2.11) -> qemu-2.11 (pseries-2.11) OK qemu-3.0 (pseries-2.10) -> qemu-2.10 (pseries-2.10) OK qemu-3.0 (pseries-2.9) -> qemu-2.9 (pseries-2.9) OK qemu-3.0 (pseries-2.8) -> qemu-2.8 (pseries-2.8) OK qemu-3.0 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL
Quoted 1 line
What's the failure ?
qemu-system-ppc64: error while loading state for instance 0x0 of device 'cpu'
qemu-system-ppc64: load of migration failed: Invalid argument
and to be more precise :
qemu-3.0 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.12 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.11 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.10 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.9 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.8 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.7 (pseries-2.7) -> qemu-2.7 (pseries-2.7) OK
So it has been a while.
C.
Quoted 42 lines
Quoted 41 lines
and back :
qemu-3.0 (pseries-3.0) <- qemu-3.0 (pseries-3.0) OK qemu-3.0 (pseries-2.12) <- qemu-2.12 (pseries-2.12) OK qemu-3.0 (pseries-2.11) <- qemu-2.11 (pseries-2.11) OK qemu-3.0 (pseries-2.10) <- qemu-2.10 (pseries-2.10) OK qemu-3.0 (pseries-2.9) <- qemu-2.9 (pseries-2.9) OK qemu-3.0 (pseries-2.8) <- qemu-2.8 (pseries-2.8) OK qemu-3.0 (pseries-2.7) <- qemu-2.7 (pseries-2.7) OKunder TCG, same scenarios were run but up to 2.10 only, in which case the migration fails for other reasons.
I wouldn't mind some extra cross checking from someone else.
Thanks,
C.
Changes since v2:
- split the patch in smaller units. The migration tests were not rerun because the code is very much the same. make check was run on each patch.
Cédric Le Goater (5):
ppc/xics: introduce aparent_realizein ICSStateClass ppc/xics: move theinstance_inithandler under the ics-base class ppx/xics: introduce aparent_resetin ICSStateClass ppc/xics: move the vmstate structures under the ics-base class ppc/xics: rework the ICS classes inheritance treeinclude/hw/ppc/xics.h | 4 +- hw/intc/xics.c | 164 ++++++++++++++++++++++++++++---------------------- hw/intc/xics_kvm.c | 46 +++++++------- hw/ppc/spapr.c | 2 +- 4 files changed, 121 insertions(+), 95 deletions(-)
Quoted 39 lines · Greg Kurz
Quoted 23 lines
Quoted 2 lines · On Mon, 25 Jun 2018 11:17:13 +0200 Cédric Le Goater <[email protected]> wrote:
Hello,
Hello,
Sorry I didn't manage to look at this before it got merged :)
Quoted 5 lines
It makes the class hierarchy much cleaner and removes duplicated code. As we are touching the location of the objects states, migration compatibility was checked and the following tests were performed under KVM :
Quoted 7 lines
qemu-3.0 (pseries-3.0) -> qemu-3.0 (pseries-3.0) OK qemu-3.0 (pseries-2.12) -> qemu-2.12 (pseries-2.12) OK qemu-3.0 (pseries-2.11) -> qemu-2.11 (pseries-2.11) OK qemu-3.0 (pseries-2.10) -> qemu-2.10 (pseries-2.10) OK qemu-3.0 (pseries-2.9) -> qemu-2.9 (pseries-2.9) OK qemu-3.0 (pseries-2.8) -> qemu-2.8 (pseries-2.8) OK qemu-3.0 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAILQuoted 1 line
What's the failure ?
qemu-system-ppc64: error while loading state for instance
0x0of device 'cpu'
qemu-system-ppc64: load of migration failed: Invalid argumentand to be more precise :
qemu-3.0 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.12 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.11 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.10 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.9 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.8 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.7 (pseries-2.7) -> qemu-2.7 (pseries-2.7) OK
Quoted 1 line
So it has been a while.
Yeah, IIRC that's a known problem. If you try 2.7.1, I think it will work.
Quoted 47 lines
C.
Quoted 42 lines
Quoted 41 lines
and back :
qemu-3.0 (pseries-3.0) <- qemu-3.0 (pseries-3.0) OK qemu-3.0 (pseries-2.12) <- qemu-2.12 (pseries-2.12) OK qemu-3.0 (pseries-2.11) <- qemu-2.11 (pseries-2.11) OK qemu-3.0 (pseries-2.10) <- qemu-2.10 (pseries-2.10) OK qemu-3.0 (pseries-2.9) <- qemu-2.9 (pseries-2.9) OK qemu-3.0 (pseries-2.8) <- qemu-2.8 (pseries-2.8) OK qemu-3.0 (pseries-2.7) <- qemu-2.7 (pseries-2.7) OKunder TCG, same scenarios were run but up to 2.10 only, in which case the migration fails for other reasons.
I wouldn't mind some extra cross checking from someone else.
Thanks,
C.
Changes since v2:
- split the patch in smaller units. The migration tests were not rerun because the code is very much the same. make check was run on each patch.
Cédric Le Goater (5):
ppc/xics: introduce aparent_realizein ICSStateClass ppc/xics: move theinstance_inithandler under the ics-base class ppx/xics: introduce aparent_resetin ICSStateClass ppc/xics: move the vmstate structures under the ics-base class ppc/xics: rework the ICS classes inheritance treeinclude/hw/ppc/xics.h | 4 +- hw/intc/xics.c | 164 ++++++++++++++++++++++++++++---------------------- hw/intc/xics_kvm.c | 46 +++++++------- hw/ppc/spapr.c | 2 +- 4 files changed, 121 insertions(+), 95 deletions(-)
Signature · 4 lines
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
Quoted 41 lines · David Gibson
Quoted 39 lines · Greg Kurz
Quoted 23 lines
Quoted 2 lines · On Mon, 25 Jun 2018 11:17:13 +0200 Cédric Le Goater <[email protected]> wrote:
Hello,
Hello,
Sorry I didn't manage to look at this before it got merged :)
Quoted 5 lines
It makes the class hierarchy much cleaner and removes duplicated code. As we are touching the location of the objects states, migration compatibility was checked and the following tests were performed under KVM :
Quoted 7 lines
qemu-3.0 (pseries-3.0) -> qemu-3.0 (pseries-3.0) OK qemu-3.0 (pseries-2.12) -> qemu-2.12 (pseries-2.12) OK qemu-3.0 (pseries-2.11) -> qemu-2.11 (pseries-2.11) OK qemu-3.0 (pseries-2.10) -> qemu-2.10 (pseries-2.10) OK qemu-3.0 (pseries-2.9) -> qemu-2.9 (pseries-2.9) OK qemu-3.0 (pseries-2.8) -> qemu-2.8 (pseries-2.8) OK qemu-3.0 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAILQuoted 1 line
What's the failure ?
qemu-system-ppc64: error while loading state for instance
0x0of device 'cpu'
qemu-system-ppc64: load of migration failed: Invalid argumentand to be more precise :
qemu-3.0 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.12 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.11 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.10 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.9 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.8 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.7 (pseries-2.7) -> qemu-2.7 (pseries-2.7) OK
Quoted 3 lines
Quoted 1 line
So it has been a while.
Yeah, IIRC that's a known problem. If you try 2.7.1, I think it will work.
I was using a 2.7.1.
C.
Quoted 49 lines
Quoted 48 lines
C.
Quoted 42 lines
Quoted 41 lines
and back :
qemu-3.0 (pseries-3.0) <- qemu-3.0 (pseries-3.0) OK qemu-3.0 (pseries-2.12) <- qemu-2.12 (pseries-2.12) OK qemu-3.0 (pseries-2.11) <- qemu-2.11 (pseries-2.11) OK qemu-3.0 (pseries-2.10) <- qemu-2.10 (pseries-2.10) OK qemu-3.0 (pseries-2.9) <- qemu-2.9 (pseries-2.9) OK qemu-3.0 (pseries-2.8) <- qemu-2.8 (pseries-2.8) OK qemu-3.0 (pseries-2.7) <- qemu-2.7 (pseries-2.7) OKunder TCG, same scenarios were run but up to 2.10 only, in which case the migration fails for other reasons.
I wouldn't mind some extra cross checking from someone else.
Thanks,
C.
Changes since v2:
- split the patch in smaller units. The migration tests were not rerun because the code is very much the same. make check was run on each patch.
Cédric Le Goater (5):
ppc/xics: introduce aparent_realizein ICSStateClass ppc/xics: move theinstance_inithandler under the ics-base class ppx/xics: introduce aparent_resetin ICSStateClass ppc/xics: move the vmstate structures under the ics-base class ppc/xics: rework the ICS classes inheritance treeinclude/hw/ppc/xics.h | 4 +- hw/intc/xics.c | 164 ++++++++++++++++++++++++++++---------------------- hw/intc/xics_kvm.c | 46 +++++++------- hw/ppc/spapr.c | 2 +- 4 files changed, 121 insertions(+), 95 deletions(-)
Quoted 42 lines · Cédric Le Goater
Quoted 41 lines · David Gibson
Quoted 39 lines · Greg Kurz
Quoted 23 lines
Quoted 2 lines · On Mon, 25 Jun 2018 11:17:13 +0200 Cédric Le Goater <[email protected]> wrote:
Hello,
Hello,
Sorry I didn't manage to look at this before it got merged :)
Quoted 5 lines
It makes the class hierarchy much cleaner and removes duplicated code. As we are touching the location of the objects states, migration compatibility was checked and the following tests were performed under KVM :
Quoted 7 lines
qemu-3.0 (pseries-3.0) -> qemu-3.0 (pseries-3.0) OK qemu-3.0 (pseries-2.12) -> qemu-2.12 (pseries-2.12) OK qemu-3.0 (pseries-2.11) -> qemu-2.11 (pseries-2.11) OK qemu-3.0 (pseries-2.10) -> qemu-2.10 (pseries-2.10) OK qemu-3.0 (pseries-2.9) -> qemu-2.9 (pseries-2.9) OK qemu-3.0 (pseries-2.8) -> qemu-2.8 (pseries-2.8) OK qemu-3.0 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAILQuoted 1 line
What's the failure ?
qemu-system-ppc64: error while loading state for instance
0x0of device 'cpu'
qemu-system-ppc64: load of migration failed: Invalid argumentand to be more precise :
qemu-3.0 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.12 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.11 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.10 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.9 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.8 (pseries-2.7) -> qemu-2.7 (pseries-2.7) FAIL qemu-2.7 (pseries-2.7) -> qemu-2.7 (pseries-2.7) OK
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
So it has been a while.
Yeah, IIRC that's a known problem. If you try 2.7.1, I think it will work.
I was using a 2.7.1.
Huh. Ok, I don't know what's going on then. But your patches haven't changed the behaviour, so, whatever.
Signature · 4 lines
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