[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: |
David Hildenbrand |
Subject: |
Re: [qemu-s390x] [PATCH v1 for-2-12 04/15] s390x/flic: simplify flic initialization |
Date: |
Tue, 12 Dec 2017 11:45:22 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 12.12.2017 10:15, Cornelia Huck wrote:
> On Mon, 11 Dec 2017 21:34:20 +0100
> David Hildenbrand <address@hidden> wrote:
>
>> On 11.12.2017 18:17, Cornelia Huck wrote:
>>> On Mon, 11 Dec 2017 14:47:29 +0100
>>> David Hildenbrand <address@hidden> wrote:
>>>
>>>> This makes it clearer, which device is used for which accelerator.
>>>>
>>>> Signed-off-by: David Hildenbrand <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);
>>>
>>> Can you use TYPE_S390_FLIC_COMMON for attaching the flic to the machine?
>>
>> I suggest doing that in a separate patch. (I remember that changing the
>> name should not harm migration).
>
> I don't think it harms migration, as we hook up the same device as
> before (just via the common flic device).
>
> Probably does not make sense as a separate patch, though, as you touch
> this code anyway.
>
This is what it looks like now:
commit dec1ff5cfc72fa0998e28a25dd23f0695ddfe21b
Author: David Hildenbrand <address@hidden>
Date: Mon Nov 13 23:09:56 2017 +0100
s390x/flic: simplify flic initialization
This makes it clearer, which device is used for which accelerator.
We can directly attach both to /machine/s390-flic/ instead of two
different locations (/machine/s390x-flic[qemu|kvm]). Should not
harm migration.
Reviewed-by: Christian Borntraeger <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c
index 6eaf178d79..dd5b157392 100644
--- a/hw/intc/s390_flic.c
+++ b/hw/intc/s390_flic.c
@@ -40,12 +40,13 @@ 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);
+ } else {
dev = qdev_create(NULL, TYPE_QEMU_S390_FLIC);
- object_property_add_child(qdev_get_machine(), TYPE_QEMU_S390_FLIC,
- OBJECT(dev), NULL);
}
+ object_property_add_child(qdev_get_machine(), TYPE_S390_FLIC_COMMON,
+ OBJECT(dev), NULL);
qdev_init_nofail(dev);
}
...
--
Thanks,
David / dhildenb
[qemu-s390x] [PATCH v1 for-2-12 09/15] s390x/tcg: implement TEST PENDING INTERRUPTION, David Hildenbrand, 2017/12/11
[qemu-s390x] [PATCH v1 for-2-12 10/15] s390x/flic: implement qemu_s390_clear_io_flic(), David Hildenbrand, 2017/12/11
[qemu-s390x] [PATCH v1 for-2-12 08/15] s390x/flic: make floating interrupts on TCG actually floating, David Hildenbrand, 2017/12/11
[qemu-s390x] [PATCH v1 for-2-12 11/15] s390x/flic: optimize CPU wakeup for TCG, David Hildenbrand, 2017/12/11