From patchwork Mon Aug 11 22:48:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Schopp X-Patchwork-Id: 4709851 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 58F2EC0338 for ; Mon, 11 Aug 2014 22:48:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 476A520115 for ; Mon, 11 Aug 2014 22:48:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C8FC2010B for ; Mon, 11 Aug 2014 22:48:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751747AbaHKWsq (ORCPT ); Mon, 11 Aug 2014 18:48:46 -0400 Received: from mail-bn1lp0145.outbound.protection.outlook.com ([207.46.163.145]:14192 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750905AbaHKWsp (ORCPT ); Mon, 11 Aug 2014 18:48:45 -0400 Received: from BY2PR02CA003.namprd02.prod.outlook.com (10.255.247.23) by BLUPR02MB035.namprd02.prod.outlook.com (10.242.191.21) with Microsoft SMTP Server (TLS) id 15.0.1005.10; Mon, 11 Aug 2014 22:48:37 +0000 Received: from BN1BFFO11FD003.protection.gbl (2a01:111:f400:7c10::1:176) by BY2PR02CA003.outlook.office365.com (2a01:111:e400:2c16::23) with Microsoft SMTP Server (TLS) id 15.0.1005.10 via Frontend Transport; Mon, 11 Aug 2014 22:48:36 +0000 Received: from atltwp02.amd.com (165.204.84.222) by BN1BFFO11FD003.mail.protection.outlook.com (10.58.144.66) with Microsoft SMTP Server id 15.0.1010.11 via Frontend Transport; Mon, 11 Aug 2014 22:48:36 +0000 X-WSS-ID: 0NA5ZCX-08-8AS-02 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 237BDD16006; Mon, 11 Aug 2014 17:48:32 -0500 (CDT) Received: from SATLEXDAG06.amd.com (10.181.40.13) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 11 Aug 2014 17:48:37 -0500 Received: from joelaarch64.amd.com (10.180.168.240) by satlexdag06.amd.com (10.181.40.13) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 11 Aug 2014 18:48:34 -0400 Subject: [RFC PATCH] arm64: KVM: add irqfd support From: Joel Schopp To: , , CC: Eirc Auger Date: Mon, 11 Aug 2014 17:48:34 -0500 Message-ID: <20140811224834.21813.82517.stgit@joelaarch64.amd.com> User-Agent: StGit/0.17.1-4-g4a0c1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019004)(6009001)(428002)(189002)(199002)(77096002)(21056001)(107046002)(103116003)(102836001)(99396002)(86362001)(101416001)(85306004)(33646002)(106466001)(105586002)(4396001)(53416004)(80022001)(229853001)(95666004)(97736001)(87936001)(85852003)(2171001)(64706001)(79102001)(2201001)(47776003)(83072002)(92566001)(76482001)(50466002)(77982001)(23676002)(92726001)(83322001)(20776003)(84676001)(54356999)(46102001)(97746001)(83506001)(74662001)(81342001)(81542001)(19580405001)(74502001)(68736004)(50986999)(19580395003)(31966008)(44976005)(71626003); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR02MB035; H:atltwp02.amd.com; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:; X-Forefront-PRVS: 03008837BD Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=Joel.Schopp@amd.com; X-OriginatorOrg: amd4.onmicrosoft.com Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Depends on Eric Auger's "ARM: KVM: add irqfd support" patch. Enable vfio of platform devices for ARM64. This patch fixes the ARM64 compile. However this patch has only been compile tested. It seemed worth sharing as it will allow us to carry both the ARM and ARM64 patches together as we do more testing. Cc: Eirc Auger Signed-off-by: Joel Schopp --- Documentation/virtual/kvm/api.txt | 2 +- arch/arm64/include/uapi/asm/kvm.h | 4 ++++ arch/arm64/kvm/Kconfig | 4 +++- arch/arm64/kvm/Makefile | 2 +- drivers/vfio/platform/Kconfig | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 04310d9..bc64ce9 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -2132,7 +2132,7 @@ into the hash PTE second double word). 4.75 KVM_IRQFD Capability: KVM_CAP_IRQFD -Architectures: x86 s390 arm +Architectures: x86 s390 arm arm64 Type: vm ioctl Parameters: struct kvm_irqfd (in) Returns: 0 on success, -1 on error diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index e633ff8..3df8baa 100644 --- a/arch/arm64/include/uapi/asm/kvm.h +++ b/arch/arm64/include/uapi/asm/kvm.h @@ -180,6 +180,10 @@ struct kvm_arch_memory_slot { /* Highest supported SPI, from VGIC_NR_IRQS */ #define KVM_ARM_IRQ_GIC_MAX 127 +/* One single KVM irqchip, ie. the VGIC */ +#define KVM_NR_IRQCHIPS 1 + + /* PSCI interface */ #define KVM_PSCI_FN_BASE 0x95c1ba5e #define KVM_PSCI_FN(n) (KVM_PSCI_FN_BASE + (n)) diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig index 8ba85e9..cbd3525 100644 --- a/arch/arm64/kvm/Kconfig +++ b/arch/arm64/kvm/Kconfig @@ -26,6 +26,7 @@ config KVM select KVM_ARM_HOST select KVM_ARM_VGIC select KVM_ARM_TIMER + select HAVE_KVM_EVENTFD ---help--- Support hosting virtualized guest machines. @@ -50,13 +51,14 @@ config KVM_ARM_MAX_VCPUS config KVM_ARM_VGIC bool depends on KVM_ARM_HOST && OF - select HAVE_KVM_IRQCHIP + select HAVE_KVM_IRQFD ---help--- Adds support for a hardware assisted, in-kernel GIC emulation. config KVM_ARM_TIMER bool depends on KVM_ARM_VGIC + select HAVE_KVM_IRQCHIP ---help--- Adds support for the Architected Timers in virtual machines. diff --git a/arch/arm64/kvm/Makefile b/arch/arm64/kvm/Makefile index 72a9fd5..40b9970 100644 --- a/arch/arm64/kvm/Makefile +++ b/arch/arm64/kvm/Makefile @@ -11,7 +11,7 @@ ARM=../../../arch/arm/kvm obj-$(CONFIG_KVM_ARM_HOST) += kvm.o -kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o +kvm-$(CONFIG_KVM_ARM_HOST) += $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o $(KVM)/eventfd.o kvm-$(CONFIG_KVM_ARM_HOST) += $(ARM)/arm.o $(ARM)/mmu.o $(ARM)/mmio.o kvm-$(CONFIG_KVM_ARM_HOST) += $(ARM)/psci.o $(ARM)/perf.o diff --git a/drivers/vfio/platform/Kconfig b/drivers/vfio/platform/Kconfig index c51af17..43ee890 100644 --- a/drivers/vfio/platform/Kconfig +++ b/drivers/vfio/platform/Kconfig @@ -1,6 +1,6 @@ config VFIO_PLATFORM tristate "VFIO support for platform devices" - depends on VFIO && EVENTFD && ARM + depends on VFIO && EVENTFD && (ARM || ARM64) help Support for platform devices with VFIO. This is required to make use of platform devices present on the system using the VFIO