From patchwork Mon Jul 20 13:02:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 6827461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 138F6C05AC for ; Mon, 20 Jul 2015 13:05:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F7D92068F for ; Mon, 20 Jul 2015 13:05:53 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 5BD3A20685 for ; Mon, 20 Jul 2015 13:05:52 +0000 (UTC) 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 1ZHAje-0005uf-LZ; Mon, 20 Jul 2015 13:03:58 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZHAic-0005FP-M6 for linux-arm-kernel@lists.infradead.org; Mon, 20 Jul 2015 13:02:56 +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 F19375BC; Mon, 20 Jul 2015 06:02:37 -0700 (PDT) Received: from e104803-lin.lan (unknown [10.1.203.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C20573F21A; Mon, 20 Jul 2015 06:02:20 -0700 (PDT) From: Andre Przywara To: will.deacon@arm.com, marc.zyngier@arm.com Subject: [PATCH 06/14] TEMPORARY: arm: update public headers for GICv3 ITS emulation Date: Mon, 20 Jul 2015 14:02:08 +0100 Message-Id: <1437397336-21385-7-git-send-email-andre.przywara@arm.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1437397336-21385-1-git-send-email-andre.przywara@arm.com> References: <1437397336-21385-1-git-send-email-andre.przywara@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150720_060254_773403_6E6DF63B X-CRM114-Status: GOOD ( 10.63 ) X-Spam-Score: -8.1 (--------) 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: linux-arm-kernel@lists.infradead.org, Pavel Fedin , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, eric.auger@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-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 This patch is preliminary and updates the headers from a kernel with ITS emulation support. It should be replaced by a proper header update once ITS support is upstream. Contains a "hack" to support compiling on ARM, too. Signed-off-by: Andre Przywara --- arm/aarch64/include/asm/kvm.h | 3 +++ arm/gic.c | 4 ++++ include/linux/kvm.h | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/arm/aarch64/include/asm/kvm.h b/arm/aarch64/include/asm/kvm.h index d268320..e42435c 100644 --- a/arm/aarch64/include/asm/kvm.h +++ b/arm/aarch64/include/asm/kvm.h @@ -82,8 +82,11 @@ struct kvm_regs { #define KVM_VGIC_V3_ADDR_TYPE_DIST 2 #define KVM_VGIC_V3_ADDR_TYPE_REDIST 3 +#define KVM_VGIC_V3_ADDR_TYPE_ITS 4 + #define KVM_VGIC_V3_DIST_SIZE SZ_64K #define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K) +#define KVM_VGIC_V3_ITS_SIZE SZ_64K #define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */ #define KVM_ARM_VCPU_EL1_32BIT 1 /* CPU running a 32bit VM */ diff --git a/arm/gic.c b/arm/gic.c index 2c1a547..93a8a1d 100644 --- a/arm/gic.c +++ b/arm/gic.c @@ -18,6 +18,10 @@ #define KVM_VGIC_V3_ADDR_TYPE_REDIST 3 #endif +#ifndef KVM_VGIC_V3_ADDR_TYPE_ITS +#define KVM_VGIC_V3_ADDR_TYPE_ITS 4 +#endif + static int gic_fd = -1; static u64 gic_redists_base; static u64 gic_redists_size; diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 4b60056..39428d1 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h @@ -815,6 +815,8 @@ struct kvm_ppc_smmu_info { #define KVM_CAP_S390_IRQ_STATE 114 #define KVM_CAP_PPC_HWRNG 115 +#define KVM_CAP_MSI_DEVID 119 + #ifdef KVM_CAP_IRQ_ROUTING struct kvm_irq_routing_irqchip { @@ -965,12 +967,14 @@ struct kvm_one_reg { __u64 addr; }; +#define KVM_MSI_VALID_DEVID (1U << 0) struct kvm_msi { __u32 address_lo; __u32 address_hi; __u32 data; __u32 flags; - __u8 pad[16]; + __u32 devid; + __u8 pad[12]; }; struct kvm_arm_device_addr {