From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755370AbdKGUay (ORCPT ); Tue, 7 Nov 2017 15:30:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47098 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752567AbdKGUaw (ORCPT ); Tue, 7 Nov 2017 15:30:52 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 47022883C3 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=eric.auger@redhat.com Subject: Re: [PATCH v5 08/26] KVM: arm/arm64: GICv4: Add property field and per-VM predicate To: Marc Zyngier , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20171027142855.21584-1-marc.zyngier@arm.com> <20171027142855.21584-9-marc.zyngier@arm.com> Cc: Christoffer Dall , Shanker Donthineni , Mark Rutland , Shameerali Kolothum Thodi , Andre Przywara From: Auger Eric Message-ID: <390426aa-7c73-641c-3ba7-937882e085df@redhat.com> Date: Tue, 7 Nov 2017 21:30:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20171027142855.21584-9-marc.zyngier@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 07 Nov 2017 20:30:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 27/10/2017 16:28, 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). > > Reviewed-by: Christoffer Dall > Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger Thanks Eric > --- > 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 53f631bdec75..ba9fb450aa1b 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; > > + /* Hardware has 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 408ef06638fc..f87fd17b2eb9 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_supports_direct_msis(struct kvm *kvm) > +{ > + return kvm_vgic_global_state.has_gicv4 && vgic_has_its(kvm); > +} > + > 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 31b70326b966..e67ccb6a6250 100644 > --- a/virt/kvm/arm/vgic/vgic.h > +++ b/virt/kvm/arm/vgic/vgic.h > @@ -240,4 +240,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_supports_direct_msis(struct kvm *kvm); > + > #endif >