From mboxrd@z Thu Jan 1 00:00:00 1970 From: christoffer.dall@linaro.org (Christoffer Dall) Date: Thu, 15 May 2014 13:18:04 +0100 Subject: [PATCH v3 18/19] KVM: ARM: vgic: add the GICv3 backend In-Reply-To: <878uq3h33l.fsf@approximate.cambridge.arm.com> References: <1397655591-2761-1-git-send-email-marc.zyngier@arm.com> <1397655591-2761-19-git-send-email-marc.zyngier@arm.com> <20140509140731.GS3362@lvm> <878uq3h33l.fsf@approximate.cambridge.arm.com> Message-ID: <20140515121804.GA4549@lvm> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, May 15, 2014 at 09:13:02AM +0100, Marc Zyngier wrote: > On Fri, May 09 2014 at 3:07:31 pm BST, Christoffer Dall wrote: > > On Wed, Apr 16, 2014 at 02:39:50PM +0100, Marc Zyngier wrote: > >> Introduce the support code for emulating a GICv2 on top of GICv3 > >> hardware. > >> > >> Acked-by: Catalin Marinas > >> Signed-off-by: Marc Zyngier > >> --- > >> include/kvm/arm_vgic.h | 26 ++++++ > >> virt/kvm/arm/vgic-v3.c | 220 +++++++++++++++++++++++++++++++++++++++++++++++++ > >> virt/kvm/arm/vgic.c | 2 + > >> 3 files changed, 248 insertions(+) > >> create mode 100644 virt/kvm/arm/vgic-v3.c > >> > > [...] > > >> diff --git a/virt/kvm/arm/vgic-v3.c b/virt/kvm/arm/vgic-v3.c > >> new file mode 100644 > >> index 0000000..a804a73 > >> --- /dev/null > >> +++ b/virt/kvm/arm/vgic-v3.c > >> @@ -0,0 +1,220 @@ > >> +/* > >> + * Copyright (C) 2013 ARM Limited, All Rights Reserved. > >> + * Author: Marc Zyngier > >> + * > >> + * This program is free software; you can redistribute it and/or modify > >> + * it under the terms of the GNU General Public License version 2 as > >> + * published by the Free Software Foundation. > >> + * > >> + * This program is distributed in the hope that it will be useful, > >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of > >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > >> + * GNU General Public License for more details. > >> + * > >> + * You should have received a copy of the GNU General Public License > >> + * along with this program. If not, see . > >> + */ > >> + > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> +#include > >> + > >> +#include > >> + > >> +#include > >> +#include > >> +#include > >> + > >> +/* These are for GICv2 emulation only */ > > > > Is this really true, seems like you're using them to form the lr values > > for the hardware below. > > > >> +#define GICH_LR_VIRTUALID (0x3ffUL << 0) > >> +#define GICH_LR_PHYSID_CPUID_SHIFT (10) > >> +#define GICH_LR_PHYSID_CPUID (7UL << GICH_LR_PHYSID_CPUID_SHIFT) > > > > can't we include them from the existing header file then? > > I've given this some more thought, and I think they actually belong > here. The arm-gic-v3.h file is really relevant to GICv3 used in v3 > mode. Here, we're using the GICv3 HW to inject GICv2-style interrupts > (ID limited to 1023, CPUID present in the LR...). > > So I'd rather keep them here than expose it to the outside world, as I > fear this would be rather confusing. > Fair enough. -Christoffer