From patchwork Fri Oct 21 09:36:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Murzin X-Patchwork-Id: 9388561 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 0706B607F0 for ; Fri, 21 Oct 2016 09:39:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBF1529F8D for ; Fri, 21 Oct 2016 09:39:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E101729F8F; Fri, 21 Oct 2016 09:39:40 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7644729F8D for ; Fri, 21 Oct 2016 09:39:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bxWHP-00046F-OI; Fri, 21 Oct 2016 09:38:23 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bxWGX-0003Uj-5H for linux-arm-kernel@lists.infradead.org; Fri, 21 Oct 2016 09:37:31 +0000 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 1FA5628; Fri, 21 Oct 2016 02:37:07 -0700 (PDT) Received: from login2.euhpc.arm.com (login2.euhpc.arm.com [10.6.26.144]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 15F953F318; Fri, 21 Oct 2016 02:37:05 -0700 (PDT) From: Vladimir Murzin To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 0/8] Support GICv3 ITS and vITS in 32-bit mode Date: Fri, 21 Oct 2016 10:36:33 +0100 Message-Id: <1477042601-15227-1-git-send-email-vladimir.murzin@arm.com> X-Mailer: git-send-email 2.0.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161021_023729_286640_AC2B27A0 X-CRM114-Status: GOOD ( 10.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marc.zyngier@arm.com, andre.przywara@arm.com, kbuild-all@01.org, christoffer.dall@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, This series introduces GICv3 ITS and vITS to 32-bit world. The first six patches make it possible to use ITS in a 32-bit guest with vITS on 64-bit host. The last two patches extend vITS to 32-bit host. I used Andrea's its/v8 branch at [1] for testing with the following After passing --irqchip=gicv3-its --force-pci to kvmtool I can see that MSI is used: # cat /proc/interrupts CPU0 18: 1251 GICv3 27 Level arch_timer 28: 0 ITS-MSI 49152 Edge virtio3-config 29: 0 ITS-MSI 49153 Edge virtio3-input 30: 0 ITS-MSI 49154 Edge virtio3-output 31: 0 ITS-MSI 32768 Edge virtio2-config 32: 2 ITS-MSI 32769 Edge virtio2-input.0 33: 1 ITS-MSI 32770 Edge virtio2-output.0 34: 0 ITS-MSI 0 Edge virtio0-config 35: 303 ITS-MSI 1 Edge virtio0-requests 36: 0 ITS-MSI 16384 Edge virtio1-config 37: 218 ITS-MSI 16385 Edge virtio1-requests IPI0: 0 CPU wakeup interrupts IPI1: 0 Timer broadcast interrupts IPI2: 0 Rescheduling interrupts IPI3: 0 Function call interrupts IPI4: 0 CPU stop interrupts IPI5: 0 IRQ work interrupts IPI6: 0 completion interrupts Err: 0 Patches are aginst v4.9-rc1. [1] git://www.linux-arm.org/kvmtool.git Thanks! Vladimir Murzin (8): irqchip/gic-v3-its: Change unsigned types for AArch32 compatibility irqchip/gic-v3-its: narrow down Entry Size when used as a divider irqchip/gicv3-its: specialise flush_dcache operation irqchip/gicv3-its: specialise readq and writeq accesses ARM: gic-v3-its: Add 32bit support to GICv3 ITS ARM: virt: select ARM_GIC_V3_ITS KVM: arm64: vgic-its: fix compatability with 32-bit ARM: KVM: Support vGICv3 ITS Documentation/virtual/kvm/api.txt | 2 +- arch/arm/Kconfig | 1 + arch/arm/include/asm/arch_gicv3.h | 59 ++++++++++++++++++++++--- arch/arm/include/uapi/asm/kvm.h | 2 + arch/arm/kvm/Kconfig | 1 + arch/arm/kvm/Makefile | 1 + arch/arm/kvm/arm.c | 6 +++ arch/arm64/include/asm/arch_gicv3.h | 19 ++++++++ arch/arm64/kvm/Kconfig | 4 -- arch/arm64/kvm/reset.c | 6 --- drivers/irqchip/irq-gic-v3-its.c | 81 +++++++++++++++++------------------ include/linux/irqchip/arm-gic-v3.h | 12 +++--- virt/kvm/arm/vgic/vgic-its.c | 11 ++--- virt/kvm/arm/vgic/vgic-kvm-device.c | 2 - virt/kvm/arm/vgic/vgic-mmio-v3.c | 2 - virt/kvm/arm/vgic/vgic.h | 26 ----------- 16 files changed, 135 insertions(+), 100 deletions(-) diff on top 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..99231f6 100644 --- a/arm/aarch32/include/kvm/kvm-arch.h +++ b/arm/aarch32/include/kvm/kvm-arch.h @@ -1,8 +1,8 @@ #ifndef KVM__KVM_ARCH_H #define KVM__KVM_ARCH_H -#define ARM_GIC_DIST_SIZE 0x1000 -#define ARM_GIC_CPUI_SIZE 0x2000 +#define ARM_GIC_DIST_SIZE 0x100000 +#define ARM_GIC_CPUI_SIZE 0x200000 #define ARM_KERN_OFFSET(...) 0x8000