qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] kvm/ioapic: some tiny tweaks
@ 2017-02-03  7:18 Peter Xu
  2017-02-03  7:18 ` [Qemu-devel] [PATCH 1/3] kvm/ioapic: dump real object instead of a fake one Peter Xu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Peter Xu @ 2017-02-03  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, peterx, Peter Maydell

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(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 1/3] kvm/ioapic: dump real object instead of a fake one
  2017-02-03  7:18 [Qemu-devel] [PATCH 0/3] kvm/ioapic: some tiny tweaks Peter Xu
@ 2017-02-03  7:18 ` Peter Xu
  2017-02-03  7:18 ` [Qemu-devel] [PATCH 2/3] ioapic: fix error report value of def version Peter Xu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Xu @ 2017-02-03  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, peterx, Peter Maydell

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().

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 hw/i386/kvm/ioapic.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
index 8eb2c7a..716d59a 100644
--- a/hw/i386/kvm/ioapic.c
+++ b/hw/i386/kvm/ioapic.c
@@ -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)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 2/3] ioapic: fix error report value of def version
  2017-02-03  7:18 [Qemu-devel] [PATCH 0/3] kvm/ioapic: some tiny tweaks Peter Xu
  2017-02-03  7:18 ` [Qemu-devel] [PATCH 1/3] kvm/ioapic: dump real object instead of a fake one Peter Xu
@ 2017-02-03  7:18 ` Peter Xu
  2017-02-03  7:18 ` [Qemu-devel] [PATCH 3/3] kvm/ioapic: correct kvm ioapic version Peter Xu
  2017-02-03 18:51 ` [Qemu-devel] [PATCH 0/3] kvm/ioapic: some tiny tweaks Paolo Bonzini
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Xu @ 2017-02-03  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, peterx, Peter Maydell

It should be 0x20, rather than 0x11.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 hw/intc/ioapic.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
index 9047b89..37c4386 100644
--- a/hw/intc/ioapic.c
+++ b/hw/intc/ioapic.c
@@ -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(),
 };
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 3/3] kvm/ioapic: correct kvm ioapic version
  2017-02-03  7:18 [Qemu-devel] [PATCH 0/3] kvm/ioapic: some tiny tweaks Peter Xu
  2017-02-03  7:18 ` [Qemu-devel] [PATCH 1/3] kvm/ioapic: dump real object instead of a fake one Peter Xu
  2017-02-03  7:18 ` [Qemu-devel] [PATCH 2/3] ioapic: fix error report value of def version Peter Xu
@ 2017-02-03  7:18 ` Peter Xu
  2017-02-03 18:51 ` [Qemu-devel] [PATCH 0/3] kvm/ioapic: some tiny tweaks Paolo Bonzini
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Xu @ 2017-02-03  7:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, peterx, Peter Maydell

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 hw/i386/kvm/ioapic.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c
index 716d59a..98ca480 100644
--- a/hw/i386/kvm/ioapic.c
+++ b/hw/i386/kvm/ioapic.c
@@ -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);
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] kvm/ioapic: some tiny tweaks
  2017-02-03  7:18 [Qemu-devel] [PATCH 0/3] kvm/ioapic: some tiny tweaks Peter Xu
                   ` (2 preceding siblings ...)
  2017-02-03  7:18 ` [Qemu-devel] [PATCH 3/3] kvm/ioapic: correct kvm ioapic version Peter Xu
@ 2017-02-03 18:51 ` Paolo Bonzini
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2017-02-03 18:51 UTC (permalink / raw)
  To: Peter Xu, qemu-devel; +Cc: Peter Maydell



On 02/02/2017 23:18, Peter Xu wrote:
> 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(-)
> 

Queued, thanks.

Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-03 18:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-03  7:18 [Qemu-devel] [PATCH 0/3] kvm/ioapic: some tiny tweaks Peter Xu
2017-02-03  7:18 ` [Qemu-devel] [PATCH 1/3] kvm/ioapic: dump real object instead of a fake one Peter Xu
2017-02-03  7:18 ` [Qemu-devel] [PATCH 2/3] ioapic: fix error report value of def version Peter Xu
2017-02-03  7:18 ` [Qemu-devel] [PATCH 3/3] kvm/ioapic: correct kvm ioapic version Peter Xu
2017-02-03 18:51 ` [Qemu-devel] [PATCH 0/3] kvm/ioapic: some tiny tweaks Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).