From patchwork Wed Mar 4 10:14:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 5935071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 615429F318 for ; Wed, 4 Mar 2015 10:22:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 90B5020222 for ; Wed, 4 Mar 2015 10:22:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A1B22201F5 for ; Wed, 4 Mar 2015 10:22:16 +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 1YT6Ot-0005tI-3V; Wed, 04 Mar 2015 10:19:35 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YT6N7-0004Ep-9r for linux-arm-kernel@lists.infradead.org; Wed, 04 Mar 2015 10:17:46 +0000 Received: by wiwh11 with SMTP id h11so29450159wiw.3 for ; Wed, 04 Mar 2015 02:17:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hlFqe3CevCDBjgyiXrsDvkjefrgK+lPQ3EnTvzpPTg8=; b=YP/QhkKC3jhnTCHtPNOqhOVFqs3k+2pFLx7j9imMJSsqg8zrqjf1C2ZgY9MHKtdUOp P4eYCDTeXMMY7tQHDFVt8x9idcCVXkvcIlAORv2N8E4jFI279vZplHKy7d07N8M6xwFl sLVrJCWhxw6oAvBJM+OId5IxXcpKtoZ7XthT+c6Z3fozfAWyJ+XxHu1vQnjYp0iw81LY qXpOHsgSeK0cyoNRKR5LmxzrRSgKkk8vCsbu+upGgzdNmKVU4KryZxSlhuaFr1noNCF1 g+n06V0WcMCVGQK+st+qtkmjWCqffR8Uk8nHKn9JMXkI1pGQhvaPHsmKMAVxUFRgJuYD D8Hg== X-Gm-Message-State: ALoCoQkHGmZE70i2Bd1szmNXlh17cghibJPtLrg3naOsoJC/0O+fawxmue5E8OLVnpAkPQwcYq4u X-Received: by 10.194.61.51 with SMTP id m19mr6376499wjr.39.1425464242500; Wed, 04 Mar 2015 02:17:22 -0800 (PST) Received: from gnx2579.gnb.st.com (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by mx.google.com with ESMTPSA id j7sm6415582wix.4.2015.03.04.02.17.20 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Mar 2015 02:17:21 -0800 (PST) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Subject: [PATCH v9 3/5] KVM: arm/arm64: implement kvm_arch_intc_initialized Date: Wed, 4 Mar 2015 11:14:34 +0100 Message-Id: <1425464076-20558-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1425464076-20558-1-git-send-email-eric.auger@linaro.org> References: <1425464076-20558-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150304_021745_496594_7E302EE6 X-CRM114-Status: GOOD ( 10.89 ) X-Spam-Score: -0.7 (/) Cc: gleb@kernel.org, andre.przywara@arm.com, pbonzini@redhat.com, linux-kernel@vger.kernel.org, patches@linaro.org 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: , 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 On arm/arm64 the VGIC is dynamically instantiated and it is useful to expose its state, especially for irqfd setup. This patch defines __KVM_HAVE_ARCH_INTC_INITIALIZED and implements kvm_arch_intc_initialized. Signed-off-by: Eric Auger Acked-by: Christoffer Dall Reviewed-by: Andre Przywara --- v7 -> v8: - add Andre's Reviewed-by v6 -> v7: - usage of the new function in irqfd is introduced in previous patch file. - Changed the title and the commit message accordingly v5 -> v6: - remove kvm_arch_intc_initialized declaration from architecture specific kvm_host.h since it is now in generic kvm_host.h - squash v5 patch files 3 & 4 --- arch/arm/include/asm/kvm_host.h | 2 ++ arch/arm/kvm/arm.c | 5 +++++ arch/arm64/include/asm/kvm_host.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index 41008cd..902a7d1 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h @@ -27,6 +27,8 @@ #include #include +#define __KVM_HAVE_ARCH_INTC_INITIALIZED + #if defined(CONFIG_KVM_ARM_MAX_VCPUS) #define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS #else diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 07e7eb1..5300d5a 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -452,6 +452,11 @@ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu) return 0; } +bool kvm_arch_intc_initialized(struct kvm *kvm) +{ + return vgic_initialized(kvm); +} + static void vcpu_pause(struct kvm_vcpu *vcpu) { wait_queue_head_t *wq = kvm_arch_vcpu_wq(vcpu); diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 8ac3c70..967fb1c 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -28,6 +28,8 @@ #include #include +#define __KVM_HAVE_ARCH_INTC_INITIALIZED + #if defined(CONFIG_KVM_ARM_MAX_VCPUS) #define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS #else