Skip to contentSkip to conversation

pcspk: fix KVM

PATCH Superseded Paolo Bonzini 3 participants 3 messages Jun 30, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pcspk: fix KVM

The link property that was added to the pcspk device has the wrong type:
it is only correct for TCG and for KVM's userspace or split irqchip options. The default KVM option (fully in-kernel irqchip) breaks because it uses a PIT whose type is a sibling of TYPE_I8254.

Fixes 873b4d3f0571a1e415cf089a67a230ea8a12d059
---
 hw/audio/pcspk.c                  | 2 +-
 include/hw/timer/i8254.h          | 1 +
 include/hw/timer/i8254_internal.h | 1 -
 3 files changed, 2 insertions(+), 2 deletions(-)
hw/audio/pcspk.c +1 -1
index a7aa4e9..42a6f48 100644
@@ -171,7 +171,7 @@ static void pcspk_initfn(Object *obj)
 
     memory_region_init_io(&s->ioport, OBJECT(s), &pcspk_io_ops, s, "pcspk", 1);
 
-    object_property_add_link(obj, "pit", TYPE_I8254,
+    object_property_add_link(obj, "pit", TYPE_PIT_COMMON,
                              (Object **)&s->pit,
                              qdev_prop_allow_set_link_before_realize,
                              0, &error_abort);
include/hw/timer/i8254.h +1 -0
index 4349033..28a3fdc 100644
@@ -37,6 +37,7 @@ typedef struct PITChannelInfo {
     int out;
 } PITChannelInfo;
 
+#define TYPE_PIT_COMMON "pit-common"
 #define TYPE_I8254 "isa-pit"
 #define TYPE_KVM_I8254 "kvm-pit"
 
include/hw/timer/i8254_internal.h +0 -1
index 61a1bfb..5fefd84 100644
@@ -57,7 +57,6 @@ typedef struct PITCommonState {
     PITChannelState channels[3];
 } PITCommonState;
 
-#define TYPE_PIT_COMMON "pit-common"
 #define PIT_COMMON(obj) \
      OBJECT_CHECK(PITCommonState, (obj), TYPE_PIT_COMMON)
 #define PIT_COMMON_CLASS(klass) \
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 43 lines · Paolo Bonzini

The link property that was added to the pcspk device has the wrong type:
it is only correct for TCG and for KVM's userspace or split irqchip options. The default KVM option (fully in-kernel irqchip) breaks because it uses a PIT whose type is a sibling of TYPE_I8254.

Fixes 873b4d3f0571a1e415cf089a67a230ea8a12d059
---
 hw/audio/pcspk.c                  | 2 +-
 include/hw/timer/i8254.h          | 1 +
 include/hw/timer/i8254_internal.h | 1 -
 3 files changed, 2 insertions(+), 2 deletions(-)
hw/audio/pcspk.c +1 -1
index a7aa4e9..42a6f48 100644
@@ -171,7 +171,7 @@ static void pcspk_initfn(Object *obj)
 
     memory_region_init_io(&s->ioport, OBJECT(s), &pcspk_io_ops, s, "pcspk", 1);
 
-    object_property_add_link(obj, "pit", TYPE_I8254,
+    object_property_add_link(obj, "pit", TYPE_PIT_COMMON,
                              (Object **)&s->pit,
                              qdev_prop_allow_set_link_before_realize,
                              0, &error_abort);
include/hw/timer/i8254.h +1 -0
index 4349033..28a3fdc 100644
@@ -37,6 +37,7 @@ typedef struct PITChannelInfo {
     int out;
 } PITChannelInfo;
 
+#define TYPE_PIT_COMMON "pit-common"
 #define TYPE_I8254 "isa-pit"
 #define TYPE_KVM_I8254 "kvm-pit"
 
include/hw/timer/i8254_internal.h +0 -0
index 61a1bfb..5fefd84 100644

include/hw/timer/i8254_internal.h typedef struct PITCommonState { · line 62

Quoted 7 lines
include/hw/timer/i8254_internal.h +0 -1
@@ -57,7 +57,6 @@ typedef struct PITCommonState {
     PITChannelState channels[3];
 } PITCommonState;
 
-#define TYPE_PIT_COMMON "pit-common"
 #define PIT_COMMON(obj) \
      OBJECT_CHECK(PITCommonState, (obj), TYPE_PIT_COMMON)
 #define PIT_COMMON_CLASS(klass) \

Rather nonstandard not to keep all the QOM type #defines together.

thanks
-- PMM

Tested-by on v1 1/1
#2 lore raw
In reply to Paolo Bonzini

Am 30.06.2016 um 16:41 schrieb Paolo Bonzini:

Quoted 7 lines

The link property that was added to the pcspk device has the wrong type:
it is only correct for TCG and for KVM's userspace or split irqchip options. The default KVM option (fully in-kernel irqchip) breaks because it uses a PIT whose type is a sibling of TYPE_I8254.

Fixes 873b4d3f0571a1e415cf089a67a230ea8a12d059