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: Auger Eric X-Patchwork-Id: 45396 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BA20D21486 for ; Wed, 4 Mar 2015 10:17:27 +0000 (UTC) Received: by wiwh11 with SMTP id h11sf19355942wiw.1 for ; Wed, 04 Mar 2015 02:17:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=hlFqe3CevCDBjgyiXrsDvkjefrgK+lPQ3EnTvzpPTg8=; b=dNX2RPwx+jSJCC8Rk9ZryPHHwYcdn7jgmHO0K35tL5z+7TdKO1rAzPJttsj9thLJNz 5nvZ/II+peuh/tv3xX8SbnuqTxdHSTWyi5CtAe+7/JdPpWjzScPQl9CdjqFOUpJ0xhu+ GJ99RCHPax/S7LjWsgx4kLRl/5VvmzSdDrFYnnuvs3fhMXXYiWxbaxs91Uj7NaooUyO5 BHv79LKIYzoxlYA1DuhvQr2F9Ug0BECcCthxrAWJw4zEvI+OUufDX5BGZDYgE8nhd/3E NtD4W9jTlLNvG48Vq0QHz+us98ylT+h+K24n8ZNHVEV/m00Zci5lzqFBBDr8juDIuExj y/4Q== X-Gm-Message-State: ALoCoQmMRCjxR3AfiQUDsSzFIwzty1Sk6ALvlVlCV4bv1Ti8Ksxw1vIa7jtMJ7NWGx7bBJfHPmNM X-Received: by 10.152.6.41 with SMTP id x9mr530803lax.10.1425464247086; Wed, 04 Mar 2015 02:17:27 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.131 with SMTP id k3ls157636lak.21.gmail; Wed, 04 Mar 2015 02:17:26 -0800 (PST) X-Received: by 10.152.37.69 with SMTP id w5mr2694813laj.15.1425464246949; Wed, 04 Mar 2015 02:17:26 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id ap5si2155538lac.158.2015.03.04.02.17.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 02:17:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbiv13 with SMTP id v13so24360043lbi.11 for ; Wed, 04 Mar 2015 02:17:26 -0800 (PST) X-Received: by 10.152.178.197 with SMTP id da5mr2841552lac.56.1425464246832; Wed, 04 Mar 2015 02:17:26 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1123003lbj; Wed, 4 Mar 2015 02:17:26 -0800 (PST) X-Received: by 10.180.75.132 with SMTP id c4mr10921068wiw.78.1425464243088; Wed, 04 Mar 2015 02:17:23 -0800 (PST) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com. [209.85.212.170]) by mx.google.com with ESMTPS id n14si6169916wjq.60.2015.03.04.02.17.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 02:17:23 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.170 as permitted sender) client-ip=209.85.212.170; Received: by widex7 with SMTP id ex7so29244858wid.0 for ; Wed, 04 Mar 2015 02:17:22 -0800 (PST) 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 Cc: andre.przywara@arm.com, linux-kernel@vger.kernel.org, patches@linaro.org, gleb@kernel.org, pbonzini@redhat.com 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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