diff mbox

[v5,08/10] hw/intc/arm_gic_kvm: advertise irqfd

Message ID 1407594349-9291-9-git-send-email-eric.auger@linaro.org
State New
Headers show

Commit Message

Auger Eric Aug. 9, 2014, 2:25 p.m. UTC
set kvm_irqfds_allowed

Signed-off-by: Eric Auger <eric.auger@linaro.org>
---
 hw/intc/arm_gic_kvm.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Alexander Graf Aug. 11, 2014, 9:37 a.m. UTC | #1
On 09.08.14 16:25, Eric Auger wrote:
> set kvm_irqfds_allowed
>
> Signed-off-by: Eric Auger <eric.auger@linaro.org>
> ---
>   hw/intc/arm_gic_kvm.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
> index 5038885..08b7bf9 100644
> --- a/hw/intc/arm_gic_kvm.c
> +++ b/hw/intc/arm_gic_kvm.c
> @@ -576,6 +576,8 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)
>                               KVM_DEV_ARM_VGIC_GRP_ADDR,
>                               KVM_VGIC_V2_ADDR_TYPE_CPU,
>                               s->dev_fd);
> +
> +    kvm_irqfds_allowed = true;

Is this always true? If it is, why not enable it separately while making 
vhost-net work for example?


Alex
Auger Eric Aug. 11, 2014, 12:04 p.m. UTC | #2
On 08/11/2014 11:37 AM, Alexander Graf wrote:
> 
> On 09.08.14 16:25, Eric Auger wrote:
>> set kvm_irqfds_allowed
>>
>> Signed-off-by: Eric Auger <eric.auger@linaro.org>
>> ---
>>   hw/intc/arm_gic_kvm.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
>> index 5038885..08b7bf9 100644
>> --- a/hw/intc/arm_gic_kvm.c
>> +++ b/hw/intc/arm_gic_kvm.c
>> @@ -576,6 +576,8 @@ static void kvm_arm_gic_realize(DeviceState *dev,
>> Error **errp)
>>                               KVM_DEV_ARM_VGIC_GRP_ADDR,
>>                               KVM_VGIC_V2_ADDR_TYPE_CPU,
>>                               s->dev_fd);
>> +
>> +    kvm_irqfds_allowed = true;
> 
> Is this always true? If it is, why not enable it separately while making
> vhost-net work for example?

Hi Alex,

yes I think so. As soon as KVM is enabled, KVM/arm would enable
injection though irqfd. Defintively makes sense to test it with
vhost-net too. Well a matter of priority ;-)

Best Regards

Eric

> 
> Alex
>
Alexander Graf Aug. 11, 2014, 12:05 p.m. UTC | #3
On 11.08.14 14:04, Eric Auger wrote:
> On 08/11/2014 11:37 AM, Alexander Graf wrote:
>> On 09.08.14 16:25, Eric Auger wrote:
>>> set kvm_irqfds_allowed
>>>
>>> Signed-off-by: Eric Auger <eric.auger@linaro.org>
>>> ---
>>>    hw/intc/arm_gic_kvm.c | 2 ++
>>>    1 file changed, 2 insertions(+)
>>>
>>> diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
>>> index 5038885..08b7bf9 100644
>>> --- a/hw/intc/arm_gic_kvm.c
>>> +++ b/hw/intc/arm_gic_kvm.c
>>> @@ -576,6 +576,8 @@ static void kvm_arm_gic_realize(DeviceState *dev,
>>> Error **errp)
>>>                                KVM_DEV_ARM_VGIC_GRP_ADDR,
>>>                                KVM_VGIC_V2_ADDR_TYPE_CPU,
>>>                                s->dev_fd);
>>> +
>>> +    kvm_irqfds_allowed = true;
>> Is this always true? If it is, why not enable it separately while making
>> vhost-net work for example?
> Hi Alex,
>
> yes I think so. As soon as KVM is enabled, KVM/arm would enable
> injection though irqfd. Defintively makes sense to test it with
> vhost-net too. Well a matter of priority ;-)

More a matter of accuracy. What if you use new QEMU on old KVM which 
does have in-kernel GIC support, but no irqfd support?


Alex
Auger Eric Aug. 11, 2014, 12:27 p.m. UTC | #4
On 08/11/2014 02:05 PM, Alexander Graf wrote:
> 
> On 11.08.14 14:04, Eric Auger wrote:
>> On 08/11/2014 11:37 AM, Alexander Graf wrote:
>>> On 09.08.14 16:25, Eric Auger wrote:
>>>> set kvm_irqfds_allowed
>>>>
>>>> Signed-off-by: Eric Auger <eric.auger@linaro.org>
>>>> ---
>>>>    hw/intc/arm_gic_kvm.c | 2 ++
>>>>    1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
>>>> index 5038885..08b7bf9 100644
>>>> --- a/hw/intc/arm_gic_kvm.c
>>>> +++ b/hw/intc/arm_gic_kvm.c
>>>> @@ -576,6 +576,8 @@ static void kvm_arm_gic_realize(DeviceState *dev,
>>>> Error **errp)
>>>>                                KVM_DEV_ARM_VGIC_GRP_ADDR,
>>>>                                KVM_VGIC_V2_ADDR_TYPE_CPU,
>>>>                                s->dev_fd);
>>>> +
>>>> +    kvm_irqfds_allowed = true;
>>> Is this always true? If it is, why not enable it separately while making
>>> vhost-net work for example?
>> Hi Alex,
>>
>> yes I think so. As soon as KVM is enabled, KVM/arm would enable
>> injection though irqfd. Defintively makes sense to test it with
>> vhost-net too. Well a matter of priority ;-)
> 
> More a matter of accuracy. What if you use new QEMU on old KVM which
> does have in-kernel GIC support, but no irqfd support?

Hi Alex,

VFIO device code also calls kvm_check_extension(kvm_state,
KVM_CAP_IRQFD_RESAMPLE) which would return false if IRQFD is not enabled
in old kernels. But with respect to vhost-net irqfd usage I cannot
comment yet and you may be right ;-)

Best Regards

Eric
> 
> 
> Alex
>
Alexander Graf Aug. 11, 2014, 12:29 p.m. UTC | #5
On 11.08.14 14:27, Eric Auger wrote:
> On 08/11/2014 02:05 PM, Alexander Graf wrote:
>> On 11.08.14 14:04, Eric Auger wrote:
>>> On 08/11/2014 11:37 AM, Alexander Graf wrote:
>>>> On 09.08.14 16:25, Eric Auger wrote:
>>>>> set kvm_irqfds_allowed
>>>>>
>>>>> Signed-off-by: Eric Auger <eric.auger@linaro.org>
>>>>> ---
>>>>>     hw/intc/arm_gic_kvm.c | 2 ++
>>>>>     1 file changed, 2 insertions(+)
>>>>>
>>>>> diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
>>>>> index 5038885..08b7bf9 100644
>>>>> --- a/hw/intc/arm_gic_kvm.c
>>>>> +++ b/hw/intc/arm_gic_kvm.c
>>>>> @@ -576,6 +576,8 @@ static void kvm_arm_gic_realize(DeviceState *dev,
>>>>> Error **errp)
>>>>>                                 KVM_DEV_ARM_VGIC_GRP_ADDR,
>>>>>                                 KVM_VGIC_V2_ADDR_TYPE_CPU,
>>>>>                                 s->dev_fd);
>>>>> +
>>>>> +    kvm_irqfds_allowed = true;
>>>> Is this always true? If it is, why not enable it separately while making
>>>> vhost-net work for example?
>>> Hi Alex,
>>>
>>> yes I think so. As soon as KVM is enabled, KVM/arm would enable
>>> injection though irqfd. Defintively makes sense to test it with
>>> vhost-net too. Well a matter of priority ;-)
>> More a matter of accuracy. What if you use new QEMU on old KVM which
>> does have in-kernel GIC support, but no irqfd support?
> Hi Alex,
>
> VFIO device code also calls kvm_check_extension(kvm_state,
> KVM_CAP_IRQFD_RESAMPLE) which would return false if IRQFD is not enabled
> in old kernels. But with respect to vhost-net irqfd usage I cannot
> comment yet and you may be right ;-)

Yeah, please only set it when the kernel exposes that it supports irqfd ;).


Alex
diff mbox

Patch

diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
index 5038885..08b7bf9 100644
--- a/hw/intc/arm_gic_kvm.c
+++ b/hw/intc/arm_gic_kvm.c
@@ -576,6 +576,8 @@  static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)
                             KVM_DEV_ARM_VGIC_GRP_ADDR,
                             KVM_VGIC_V2_ADDR_TYPE_CPU,
                             s->dev_fd);
+
+    kvm_irqfds_allowed = true;
 }
 
 static void kvm_arm_gic_class_init(ObjectClass *klass, void *data)