All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] pcspk: fix KVM
@ 2016-06-30 14:41 Paolo Bonzini
  2016-06-30 14:48 ` Peter Maydell
  2016-06-30 14:51 ` Peter Lieven
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2016-06-30 14:41 UTC (permalink / raw)
  To: qemu-devel; +Cc: real, pl

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
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 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(-)

diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index a7aa4e9..42a6f48 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -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);
diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h
index 4349033..28a3fdc 100644
--- a/include/hw/timer/i8254.h
+++ b/include/hw/timer/i8254.h
@@ -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"
 
diff --git a/include/hw/timer/i8254_internal.h b/include/hw/timer/i8254_internal.h
index 61a1bfb..5fefd84 100644
--- a/include/hw/timer/i8254_internal.h
+++ b/include/hw/timer/i8254_internal.h
@@ -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) \
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH] pcspk: fix KVM
  2016-06-30 14:41 [Qemu-devel] [PATCH] pcspk: fix KVM Paolo Bonzini
@ 2016-06-30 14:48 ` Peter Maydell
  2016-06-30 14:51 ` Peter Lieven
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2016-06-30 14:48 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers, Peter Lieven, Vasily Efimov

On 30 June 2016 at 15:41, Paolo Bonzini <pbonzini@redhat.com> wrote:
> 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
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  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(-)
>
> diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
> index a7aa4e9..42a6f48 100644
> --- a/hw/audio/pcspk.c
> +++ b/hw/audio/pcspk.c
> @@ -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);
> diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h
> index 4349033..28a3fdc 100644
> --- a/include/hw/timer/i8254.h
> +++ b/include/hw/timer/i8254.h
> @@ -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"
>
> diff --git a/include/hw/timer/i8254_internal.h b/include/hw/timer/i8254_internal.h
> index 61a1bfb..5fefd84 100644
> --- a/include/hw/timer/i8254_internal.h
> +++ b/include/hw/timer/i8254_internal.h
> @@ -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

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

* Re: [Qemu-devel] [PATCH] pcspk: fix KVM
  2016-06-30 14:41 [Qemu-devel] [PATCH] pcspk: fix KVM Paolo Bonzini
  2016-06-30 14:48 ` Peter Maydell
@ 2016-06-30 14:51 ` Peter Lieven
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Lieven @ 2016-06-30 14:51 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: real

Am 30.06.2016 um 16:41 schrieb 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
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Tested-by: Peter Lieven <pl@kamp.de>

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

end of thread, other threads:[~2016-06-30 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-30 14:41 [Qemu-devel] [PATCH] pcspk: fix KVM Paolo Bonzini
2016-06-30 14:48 ` Peter Maydell
2016-06-30 14:51 ` Peter Lieven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.