lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 30 Aug 2017 10:46:05 +0100
From:   Marc Zyngier <marc.zyngier@....com>
To:     Christoffer Dall <cdall@...aro.org>
Cc:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        kvmarm@...ts.cs.columbia.edu, kvm@...r.kernel.org,
        Christoffer Dall <christoffer.dall@...aro.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Jason Cooper <jason@...edaemon.net>,
        Eric Auger <eric.auger@...hat.com>,
        Shanker Donthineni <shankerd@...eaurora.org>,
        Mark Rutland <mark.rutland@....com>,
        Shameerali Kolothum Thodi 
        <shameerali.kolothum.thodi@...wei.com>
Subject: Re: [PATCH v3 39/59] KVM: arm/arm64: GICv4: Add property field and
 per-VM predicate

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@....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...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ