Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1720694 > unrolled thread

Re: [PATCH v3 39/59] KVM: arm/arm64: GICv4: Add property field and per-VM predicate

Started byChristoffer Dall <cdall@linaro.org>
First post2017-08-26 21:50 +0200
Last post2017-08-30 11:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v3 39/59] KVM: arm/arm64: GICv4: Add property field and  per-VM predicate Christoffer Dall <cdall@linaro.org> - 2017-08-26 21:50 +0200
    Re: [PATCH v3 39/59] KVM: arm/arm64: GICv4: Add property field and  per-VM predicate Marc Zyngier <marc.zyngier@arm.com> - 2017-08-30 11:50 +0200

#1720694 — Re: [PATCH v3 39/59] KVM: arm/arm64: GICv4: Add property field and per-VM predicate

FromChristoffer Dall <cdall@linaro.org>
Date2017-08-26 21:50 +0200
SubjectRe: [PATCH v3 39/59] KVM: arm/arm64: GICv4: Add property field and per-VM predicate
Message-ID<uiPfH-5p3-1@gated-at.bofh.it>
On Mon, Jul 31, 2017 at 06:26:17PM +0100, Marc Zyngier wrote:
> Add a new has_gicv4 field in the global VGIC state that indicates
> whether the HW is GICv4 capable, as a per-VM predicate indicating
> if there is a possibility for a VM to support direct injection
> (the above being true and the VM having an ITS).
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  include/kvm/arm_vgic.h           | 3 +++
>  virt/kvm/arm/vgic/vgic-mmio-v3.c | 5 +++++
>  virt/kvm/arm/vgic/vgic.h         | 2 ++
>  3 files changed, 10 insertions(+)
> 
> diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
> index ee8587c8c715..84694b42373a 100644
> --- a/include/kvm/arm_vgic.h
> +++ b/include/kvm/arm_vgic.h
> @@ -73,6 +73,9 @@ struct vgic_global {
>  	/* Only needed for the legacy KVM_CREATE_IRQCHIP */
>  	bool			can_emulate_gicv2;
>  
> +	/* Does have GICv4? */

nit: questionable comment, how about

  /* Hardware has GICv4? */
or
  /* Do we have GICv4? */

> +	bool			has_gicv4;
> +
>  	/* GIC system register CPU interface */
>  	struct static_key_false gicv3_cpuif;
>  
> diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c
> index 714fa3933546..74109ca75cc0 100644
> --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c
> +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c
> @@ -54,6 +54,11 @@ bool vgic_has_its(struct kvm *kvm)
>  	return dist->has_its;
>  }
>  
> +bool vgic_is_v4_capable(struct kvm *kvm)
> +{
> +	return kvm_vgic_global_state.has_gicv4 && vgic_has_its(kvm);
> +}
> +

uber nit: the naming here is a bit funny, because we won't be presenting
a GICv4 GIC to the guest, so I'd prefer something like
vgic_supports_direct_msis() or something like that, but this is
obviously not a deal breaker.

>  static unsigned long vgic_mmio_read_v3_misc(struct kvm_vcpu *vcpu,
>  					    gpa_t addr, unsigned int len)
>  {
> diff --git a/virt/kvm/arm/vgic/vgic.h b/virt/kvm/arm/vgic/vgic.h
> index 3002b72d938b..90f6436a11aa 100644
> --- a/virt/kvm/arm/vgic/vgic.h
> +++ b/virt/kvm/arm/vgic/vgic.h
> @@ -229,4 +229,6 @@ int vgic_its_resolve_lpi(struct kvm *kvm, struct vgic_its *its,
>  			 u32 devid, u32 eventid, struct vgic_irq **irq);
>  struct vgic_its *vgic_msi_to_its(struct kvm *kvm, struct kvm_msi *msi);
>  
> +bool vgic_is_v4_capable(struct kvm *kvm);
> +
>  #endif
> -- 
> 2.11.0
> 

Thanks,
-Christoffer

[toc] | [next] | [standalone]


#1723166

FromMarc Zyngier <marc.zyngier@arm.com>
Date2017-08-30 11:50 +0200
Message-ID<uk7Ng-6DT-15@gated-at.bofh.it>
In reply to#1720694
On 26/08/17 20:49, Christoffer Dall wrote:
> On Mon, Jul 31, 2017 at 06:26:17PM +0100, Marc Zyngier wrote:
>> Add a new has_gicv4 field in the global VGIC state that indicates
>> whether the HW is GICv4 capable, as a per-VM predicate indicating
>> if there is a possibility for a VM to support direct injection
>> (the above being true and the VM having an ITS).
>>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>>  include/kvm/arm_vgic.h           | 3 +++
>>  virt/kvm/arm/vgic/vgic-mmio-v3.c | 5 +++++
>>  virt/kvm/arm/vgic/vgic.h         | 2 ++
>>  3 files changed, 10 insertions(+)
>>
>> diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
>> index ee8587c8c715..84694b42373a 100644
>> --- a/include/kvm/arm_vgic.h
>> +++ b/include/kvm/arm_vgic.h
>> @@ -73,6 +73,9 @@ struct vgic_global {
>>  	/* Only needed for the legacy KVM_CREATE_IRQCHIP */
>>  	bool			can_emulate_gicv2;
>>  
>> +	/* Does have GICv4? */
> 
> nit: questionable comment, how about
> 
>   /* Hardware has GICv4? */
> or
>   /* Do we have GICv4? */

Yup, reads much better.

>> +	bool			has_gicv4;
>> +
>>  	/* GIC system register CPU interface */
>>  	struct static_key_false gicv3_cpuif;
>>  
>> diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c
>> index 714fa3933546..74109ca75cc0 100644
>> --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c
>> +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c
>> @@ -54,6 +54,11 @@ bool vgic_has_its(struct kvm *kvm)
>>  	return dist->has_its;
>>  }
>>  
>> +bool vgic_is_v4_capable(struct kvm *kvm)
>> +{
>> +	return kvm_vgic_global_state.has_gicv4 && vgic_has_its(kvm);
>> +}
>> +
> 
> uber nit: the naming here is a bit funny, because we won't be presenting
> a GICv4 GIC to the guest, so I'd prefer something like
> vgic_supports_direct_msis() or something like that, but this is
> obviously not a deal breaker.

I like it. It has the advantage of not tying the predicate to a
particular direct injection method, should we one day have a GICv6 (no,
please...).

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web