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: 35221 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7B97120AEC for ; Mon, 11 Aug 2014 22:50:25 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id kx10sf65624866pab.4 for ; Mon, 11 Aug 2014 15:50:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:subject:from:to:date:message-id :user-agent:mime-version:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=QZER9FDdBmgqNLhTcUH/j+VwR0cSek38GWnCKkeEtgw=; b=bfg9e4BSj+aB/WlSxO7Haa5FtAhknpcepY0ze40gwsIkDR8id+LJET0e3+mhY1peU9 tuvUyHJJzofLLgQZU7GLerfQBYQIAARao0FvCsFZWiMHI0L63QXKLY/5TbPjXYLxlpFB KD7PivOr5xedxWC8d54JPP7mRE6oOo7SkQT5sSVzIZcSFpqVrx5UcvE7gGYZCezfB4k9 F7Vxh9jD6uV0mw0T+y49qGDHXF/Z+K6MBdq+ytVtxDSnO7xOeIyoqUG39DkL4B5Z/y8x iU8lMtpmZTSGwmmLKR7AQ1uKAlUDLUAd/f21L+Ok+qzV2Zz0c36a+T67snWZbda7Bk3u pgLQ== X-Gm-Message-State: ALoCoQmW3xW8ZamhlBudTPrpikh3YwHavgn41OlKpOswSV7LVeuZT2pRjAzi6BiGzMoqDs6veD3h X-Received: by 10.66.124.199 with SMTP id mk7mr485327pab.15.1407797424822; Mon, 11 Aug 2014 15:50:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.98 with SMTP id 89ls1002282qgi.1.gmail; Mon, 11 Aug 2014 15:50:24 -0700 (PDT) X-Received: by 10.220.122.132 with SMTP id l4mr524397vcr.41.1407797424719; Mon, 11 Aug 2014 15:50:24 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id 7si7246081vcu.41.2014.08.11.15.50.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Aug 2014 15:50:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id ik5so12443833vcb.34 for ; Mon, 11 Aug 2014 15:50:24 -0700 (PDT) X-Received: by 10.52.234.228 with SMTP id uh4mr11565383vdc.34.1407797424607; Mon, 11 Aug 2014 15:50:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp200965vcb; Mon, 11 Aug 2014 15:50:24 -0700 (PDT) X-Received: by 10.70.47.168 with SMTP id e8mr699468pdn.112.1407797423651; Mon, 11 Aug 2014 15:50:23 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id be16si10946388pdb.233.2014.08.11.15.50.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Aug 2014 15:50:23 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XGyOm-0000FD-TB; Mon, 11 Aug 2014 22:49:04 +0000 Received: from mail-bn1lp0141.outbound.protection.outlook.com ([207.46.163.141] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XGyOj-0008QG-EU for linux-arm-kernel@lists.infradead.org; Mon, 11 Aug 2014 22:49:02 +0000 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: , , 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) X-OriginatorOrg: amd4.onmicrosoft.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140811_154901_661548_4EFD71B3 X-CRM114-Status: GOOD ( 13.84 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [207.46.163.141 listed in list.dnswl.org] -0.7 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [207.46.163.141 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record Cc: Eirc Auger X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: joel.schopp@amd.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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(-) 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