From patchwork Thu Feb 2 16:32:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 9552427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2E29360236 for ; Thu, 2 Feb 2017 16:31:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C07A28174 for ; Thu, 2 Feb 2017 16:31:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 110AC2847D; Thu, 2 Feb 2017 16:31:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B09C528174 for ; Thu, 2 Feb 2017 16:31:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752094AbdBBQbZ (ORCPT ); Thu, 2 Feb 2017 11:31:25 -0500 Received: from foss.arm.com ([217.140.101.70]:33486 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752063AbdBBQbY (ORCPT ); Thu, 2 Feb 2017 11:31:24 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DD967164F; Thu, 2 Feb 2017 08:31:23 -0800 (PST) Received: from e104803-lin.lan (unknown [10.1.207.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DC3E13F24D; Thu, 2 Feb 2017 08:31:22 -0800 (PST) From: Andre Przywara To: Will Deacon , Marc Zyngier Cc: Vladimir Murzin , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [kvmtool PATCH v9 08/15] arm: allow vGICv3 emulation Date: Thu, 2 Feb 2017 16:32:16 +0000 Message-Id: <20170202163223.15372-9-andre.przywara@arm.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170202163223.15372-1-andre.przywara@arm.com> References: <20170202163223.15372-1-andre.przywara@arm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vladimir Murzin KVM/arm recently got support for vGICv3 (and vITS), which is evident in the updated header file. So as now ARM has feature parity when it comes to the GIC emulation, we can remove the special defines we had in place to allow compilation for ARM(32). For simplicity we now use 64K sized GIC regions everywhere, as GICv3 mandates them. [Andre: some update, reword commit message] Signed-off-by: Vladimir Murzin Signed-off-by: Andre Przywara --- arm/aarch32/arm-cpu.c | 2 +- arm/aarch32/include/kvm/kvm-arch.h | 3 --- arm/aarch64/include/kvm/kvm-arch.h | 3 --- arm/gic.c | 9 --------- arm/include/arm-common/kvm-arch.h | 2 ++ 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/arm/aarch32/arm-cpu.c b/arm/aarch32/arm-cpu.c index 27a8e17..16bba55 100644 --- a/arm/aarch32/arm-cpu.c +++ b/arm/aarch32/arm-cpu.c @@ -12,7 +12,7 @@ static void generate_fdt_nodes(void *fdt, struct kvm *kvm) { int timer_interrupts[4] = {13, 14, 11, 10}; - gic__generate_fdt_nodes(fdt, IRQCHIP_GICV2); + gic__generate_fdt_nodes(fdt, kvm->cfg.arch.irqchip); timer__generate_fdt_nodes(fdt, kvm, timer_interrupts); } diff --git a/arm/aarch32/include/kvm/kvm-arch.h b/arm/aarch32/include/kvm/kvm-arch.h index 1632e3c..cd31e72 100644 --- a/arm/aarch32/include/kvm/kvm-arch.h +++ b/arm/aarch32/include/kvm/kvm-arch.h @@ -1,9 +1,6 @@ #ifndef KVM__KVM_ARCH_H #define KVM__KVM_ARCH_H -#define ARM_GIC_DIST_SIZE 0x1000 -#define ARM_GIC_CPUI_SIZE 0x2000 - #define ARM_KERN_OFFSET(...) 0x8000 #define ARM_MAX_MEMORY(...) ARM_LOMAP_MAX_MEMORY diff --git a/arm/aarch64/include/kvm/kvm-arch.h b/arm/aarch64/include/kvm/kvm-arch.h index 4925736..9de623a 100644 --- a/arm/aarch64/include/kvm/kvm-arch.h +++ b/arm/aarch64/include/kvm/kvm-arch.h @@ -1,9 +1,6 @@ #ifndef KVM__KVM_ARCH_H #define KVM__KVM_ARCH_H -#define ARM_GIC_DIST_SIZE 0x10000 -#define ARM_GIC_CPUI_SIZE 0x20000 - #define ARM_KERN_OFFSET(kvm) ((kvm)->cfg.arch.aarch32_guest ? \ 0x8000 : \ 0x80000) diff --git a/arm/gic.c b/arm/gic.c index ff032d2..8479b89 100644 --- a/arm/gic.c +++ b/arm/gic.c @@ -9,15 +9,6 @@ #include #include -/* Those names are not defined for ARM (yet) */ -#ifndef KVM_VGIC_V3_ADDR_TYPE_DIST -#define KVM_VGIC_V3_ADDR_TYPE_DIST 2 -#endif - -#ifndef KVM_VGIC_V3_ADDR_TYPE_REDIST -#define KVM_VGIC_V3_ADDR_TYPE_REDIST 3 -#endif - static int gic_fd = -1; static u64 gic_redists_base; static u64 gic_redists_size; diff --git a/arm/include/arm-common/kvm-arch.h b/arm/include/arm-common/kvm-arch.h index 0f5fb7f..c83c45f 100644 --- a/arm/include/arm-common/kvm-arch.h +++ b/arm/include/arm-common/kvm-arch.h @@ -18,6 +18,8 @@ #define ARM_GIC_DIST_BASE (ARM_AXI_AREA - ARM_GIC_DIST_SIZE) #define ARM_GIC_CPUI_BASE (ARM_GIC_DIST_BASE - ARM_GIC_CPUI_SIZE) #define ARM_GIC_SIZE (ARM_GIC_DIST_SIZE + ARM_GIC_CPUI_SIZE) +#define ARM_GIC_DIST_SIZE 0x10000 +#define ARM_GIC_CPUI_SIZE 0x20000 #define ARM_IOPORT_SIZE (ARM_MMIO_AREA - ARM_IOPORT_AREA) #define ARM_VIRTIO_MMIO_SIZE (ARM_AXI_AREA - (ARM_MMIO_AREA + ARM_GIC_SIZE))