[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [PATCH v1 for-2-12 04/15] s390x/flic: simplify flic ini
From: |
Christian Borntraeger |
Subject: |
Re: [qemu-s390x] [PATCH v1 for-2-12 04/15] s390x/flic: simplify flic initialization |
Date: |
Mon, 11 Dec 2017 15:00:35 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 12/11/2017 02:47 PM, David Hildenbrand wrote:
> This makes it clearer, which device is used for which accelerator.
>
> Signed-off-by: David Hildenbrand <address@hidden>
nice.
Reviewed-by: Christian Borntraeger <address@hidden>
> ---
> hw/intc/s390_flic.c | 9 +++++++--
> hw/intc/s390_flic_kvm.c | 12 ------------
> include/hw/s390x/s390_flic.h | 9 ---------
> 3 files changed, 7 insertions(+), 23 deletions(-)
>
> diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c
> index 6eaf178d79..a78bdf1d90 100644
> --- a/hw/intc/s390_flic.c
> +++ b/hw/intc/s390_flic.c
> @@ -40,11 +40,16 @@ void s390_flic_init(void)
> {
> DeviceState *dev;
>
> - dev = s390_flic_kvm_create();
> - if (!dev) {
> + if (kvm_enabled()) {
> + dev = qdev_create(NULL, TYPE_KVM_S390_FLIC);
> + object_property_add_child(qdev_get_machine(), TYPE_KVM_S390_FLIC,
> + OBJECT(dev), NULL);
> + } else if (tcg_enabled()) {
> dev = qdev_create(NULL, TYPE_QEMU_S390_FLIC);
> object_property_add_child(qdev_get_machine(), TYPE_QEMU_S390_FLIC,
> OBJECT(dev), NULL);
> + } else {
> + g_assert_not_reached();
> }
> qdev_init_nofail(dev);
> }
> diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c
> index d208cb81c4..0cb5feab0c 100644
> --- a/hw/intc/s390_flic_kvm.c
> +++ b/hw/intc/s390_flic_kvm.c
> @@ -35,18 +35,6 @@ typedef struct KVMS390FLICState {
> bool clear_io_supported;
> } KVMS390FLICState;
>
> -DeviceState *s390_flic_kvm_create(void)
> -{
> - DeviceState *dev = NULL;
> -
> - if (kvm_enabled()) {
> - dev = qdev_create(NULL, TYPE_KVM_S390_FLIC);
> - object_property_add_child(qdev_get_machine(), TYPE_KVM_S390_FLIC,
> - OBJECT(dev), NULL);
> - }
> - return dev;
> -}
> -
> /**
> * flic_get_all_irqs - store all pending irqs in buffer
> * @buf: pointer to buffer which is passed to kernel
> diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h
> index 7aab6ef7f0..5b00e936fa 100644
> --- a/include/hw/s390x/s390_flic.h
> +++ b/include/hw/s390x/s390_flic.h
> @@ -91,13 +91,4 @@ void s390_flic_init(void);
> S390FLICState *s390_get_flic(void);
> bool ais_needed(void *opaque);
>
> -#ifdef CONFIG_KVM
> -DeviceState *s390_flic_kvm_create(void);
> -#else
> -static inline DeviceState *s390_flic_kvm_create(void)
> -{
> - return NULL;
> -}
> -#endif
> -
> #endif /* HW_S390_FLIC_H */
>
- Re: [qemu-s390x] [PATCH v1 for-2-12 06/15] s390x/flic: factor out injection of floating interrupts, (continued)
- Re: [qemu-s390x] [PATCH v1 for-2-12 06/15] s390x/flic: factor out injection of floating interrupts, Christian Borntraeger, 2017/12/12
- Re: [qemu-s390x] [PATCH v1 for-2-12 06/15] s390x/flic: factor out injection of floating interrupts, Cornelia Huck, 2017/12/12
- Re: [qemu-s390x] [PATCH v1 for-2-12 06/15] s390x/flic: factor out injection of floating interrupts, David Hildenbrand, 2017/12/12
- Re: [qemu-s390x] [PATCH v1 for-2-12 06/15] s390x/flic: factor out injection of floating interrupts, Cornelia Huck, 2017/12/12
- Re: [qemu-s390x] [PATCH v1 for-2-12 06/15] s390x/flic: factor out injection of floating interrupts, Christian Borntraeger, 2017/12/13
- Re: [qemu-s390x] [PATCH v1 for-2-12 06/15] s390x/flic: factor out injection of floating interrupts, David Hildenbrand, 2017/12/13
- Re: [qemu-s390x] [PATCH v1 for-2-12 06/15] s390x/flic: factor out injection of floating interrupts, Christian Borntraeger, 2017/12/13
- Re: [qemu-s390x] [PATCH v1 for-2-12 06/15] s390x/flic: factor out injection of floating interrupts, Cornelia Huck, 2017/12/13
- Re: [qemu-s390x] [PATCH v1 for-2-12 06/15] s390x/flic: factor out injection of floating interrupts, David Hildenbrand, 2017/12/12
[qemu-s390x] [PATCH v1 for-2-12 04/15] s390x/flic: simplify flic initialization, David Hildenbrand, 2017/12/11
Re: [qemu-s390x] [PATCH v1 for-2-12 04/15] s390x/flic: simplify flic initialization, David Hildenbrand, 2017/12/12
[qemu-s390x] [PATCH v1 for-2-12 09/15] s390x/tcg: implement TEST PENDING INTERRUPTION, David Hildenbrand, 2017/12/11