kvm/ioapic: some tiny tweaks
cover kvm/ioapic: some tiny tweaks
This series fixes the issue pointed out by PMM in thread:
https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg06323.html
Along with other two patches to make the version more accurate. Thanks,
Peter Xu (3):
kvm/ioapic: dump real object instead of a fake one
ioapic: fix error report value of def version kvm/ioapic: correct kvm ioapic version
hw/i386/kvm/ioapic.c | 13 +++++++++---- hw/intc/ioapic.c | 6 ++++-- 2 files changed, 13 insertions(+), 6 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/3 kvm/ioapic: dump real object instead of a fake one
When we do "info ioapic" for kvm ioapic, we were building up a temporary ioapic object. Let's fetch the real one and update correspond to the real object as well.
This fixes printing uninitialized version field in ioapic_print_redtbl().
--- hw/i386/kvm/ioapic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/i386/kvm/ioapic.c +4 -4
@@ -114,11 +114,11 @@ static void kvm_ioapic_put(IOAPICCommonState *s)void kvm_ioapic_dump_state (Monitor *mon,const QDict *qdict) { -IOAPICCommonState s; +IOAPICCommonState *s =IOAPIC_COMMON (object_resolve_path ("ioapic" ,NULL )); -kvm_ioapic_get (&s); - -ioapic_print_redtbl (mon, &s); +assert (s); +kvm_ioapic_get (s); +ioapic_print_redtbl (mon, s); }static void kvm_ioapic_reset (DeviceState *dev)
Signature · 1 line
2.7.4
PATCH 2/3 ioapic: fix error report value of def version
In reply to Peter XuIt should be 0x20, rather than 0x11.
--- hw/intc/ioapic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
hw/intc/ioapic.c +4 -2
@@ -408,13 +408,15 @@ static void ioapic_machine_done_notify(Notifier *notifier, void *data)#endif } +#define IOAPIC_VER_DEF 0x20 +static void ioapic_realize (DeviceState *dev,Error **errp) {IOAPICCommonState *s =IOAPIC_COMMON (dev);if (s->version !=0x11 && s->version !=0x20 ) {error_report ("IOAPIC only supports version 0x11 or 0x20 " -"(default: 0x11)." ); +"(default: 0x%x)." ,IOAPIC_VER_DEF );exit (1 ); }
@@ -429,7 +431,7 @@ static void ioapic_realize(DeviceState *dev, Error **errp) }static Property ioapic_properties[] = { -DEFINE_PROP_UINT8 ("version" , IOAPICCommonState, version,0x20 ), +DEFINE_PROP_UINT8 ("version" , IOAPICCommonState, version,IOAPIC_VER_DEF ),DEFINE_PROP_END_OF_LIST (), };
Signature · 1 line
2.7.4
PATCH 3/3 kvm/ioapic: correct kvm ioapic version
In reply to Peter Xu--- hw/i386/kvm/ioapic.c | 5 +++++ 1 file changed, 5 insertions(+)
hw/i386/kvm/ioapic.c +5 -0
@@ -143,6 +143,11 @@ static void kvm_ioapic_realize(DeviceState *dev, Error **errp)IOAPICCommonState *s =IOAPIC_COMMON (dev);memory_region_init_reservation (&s->io_memory,NULL ,"kvm-ioapic" ,0x1000 ); +/* +* KVM ioapic only supports 0x11 now. This will only be used when +* we want to dump ioapic version. +*/ + s->version =0x11 ;qdev_init_gpio_in (dev, kvm_ioapic_set_irq,IOAPIC_NUM_PINS ); }
Signature · 1 line
2.7.4
Paolo Bonzini
AppliedQuoted 6 lines · Peter Xu
This series fixes the issue pointed out by PMM in thread:
https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg06323.html
Along with other two patches to make the version more accurate. Thanks,
Quoted 9 lines
Peter Xu (3):
kvm/ioapic: dump real object instead of a fake one
ioapic: fix error report value of def version kvm/ioapic: correct kvm ioapic versionhw/i386/kvm/ioapic.c | 13 +++++++++---- hw/intc/ioapic.c | 6 ++++-- 2 files changed, 13 insertions(+), 6 deletions(-)
Queued, thanks.
Paolo