pcspk: fix KVM
PATCH v2 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
Tested-by Peter Lieven <[email protected]>
Signed-off-by Paolo Bonzini <[email protected]>
--- hw/audio/pcspk.c | 2 +- include/hw/timer/i8254.h | 8 ++++++++ include/hw/timer/i8254_internal.h | 8 -------- 3 files changed, 9 insertions(+), 9 deletions(-)
hw/audio/pcspk.c +1 -1
@@ -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 +8 -0
@@ -37,6 +37,14 @@ typedef struct PITChannelInfo {int out; } PITChannelInfo; +#define TYPE_PIT_COMMON "pit-common" +#define PIT_COMMON (obj) \ + OBJECT_CHECK(PITCommonState, (obj), TYPE_PIT_COMMON) +#define PIT_COMMON_CLASS (klass) \ + OBJECT_CLASS_CHECK(PITCommonClass, (klass), TYPE_PIT_COMMON) +#define PIT_COMMON_GET_CLASS (obj) \ + OBJECT_GET_CLASS(PITCommonClass, (obj), TYPE_PIT_COMMON) +#define TYPE_I8254 "isa-pit"#define TYPE_KVM_I8254 "kvm-pit"
include/hw/timer/i8254_internal.h +0 -8
@@ -57,14 +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) \ - OBJECT_CLASS_CHECK(PITCommonClass, (klass), TYPE_PIT_COMMON) -#define PIT_COMMON_GET_CLASS (obj) \ - OBJECT_GET_CLASS(PITCommonClass, (obj), TYPE_PIT_COMMON) - typedef struct PITCommonClass { ISADeviceClass parent_class;
Signature · 1 line
1.8.3.1
Quoted 5 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 ofTYPE_I8254.
Quoted 8 lines
Fixes 873b4d3f0571a1e415cf089a67a230ea8a12d059Tested-by Peter Lieven <[email protected]>Signed-off-by Paolo Bonzini <[email protected]>--- hw/audio/pcspk.c | 2 +- include/hw/timer/i8254.h | 8 ++++++++ include/hw/timer/i8254_internal.h | 8 -------- 3 files changed, 9 insertions(+), 9 deletions(-)
reviewed and applied to master, thanks.
-- PMM