From patchwork Wed Dec 3 16:07:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 41860 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 31C7025E88 for ; Wed, 3 Dec 2014 16:09:09 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id bs8sf9938879wib.10 for ; Wed, 03 Dec 2014 08:09:08 -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=w1NSBRqwjuCn8Emr9sZZ7CLZVyEIkL9L5egVW/2PWFQ=; b=agBVNyMcI7PLBmO7rYOBKvjhIuaQBB+UML7kk8gjebJEECw7yRTBrhjrJcEOAo9vyq iY9XmQBRXQZLHVZK8S/kJmVUgWj5QaWnWXtiSLW3L0fgTvXLJvwmwknLzQfozH+Im20R 6Bc5utnUymGbylZD7XHwHgFG4P/vXPOtyyM6D6hsiBDvJ5JQy7ly5WOSEdhfwTwMdm04 vsmBuAn1jbaHt7bn0uxdHiz3xaB/VVkPLt878D7XJBAAd9QzGQ9nj8MH9U7Cx5vjUoxk ZYp4P71TPQYGv6VEe65PyCUqL938NEKBfptllkGeLefGtVG3oZgO5meTxe7yieS0oR9Y 3niQ== X-Gm-Message-State: ALoCoQm7E5AayW2CEjJNlXRm9cmeqoTAIPFHFy9596hox0BDnxUqG2dzBVwrHBblULnML3VE9hQm X-Received: by 10.112.72.106 with SMTP id c10mr503927lbv.15.1417622948491; Wed, 03 Dec 2014 08:09:08 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.225 with SMTP id y1ls175516lae.25.gmail; Wed, 03 Dec 2014 08:09:08 -0800 (PST) X-Received: by 10.152.3.67 with SMTP id a3mr5000762laa.56.1417622948355; Wed, 03 Dec 2014 08:09:08 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id cy4si23466375lac.4.2014.12.03.08.09.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 08:09:08 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id hv19so8201725lab.28 for ; Wed, 03 Dec 2014 08:09:08 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr4940798lbo.32.1417622948240; Wed, 03 Dec 2014 08:09:08 -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.184.201 with SMTP id ew9csp691569lbc; Wed, 3 Dec 2014 08:09:07 -0800 (PST) X-Received: by 10.180.96.10 with SMTP id do10mr103284648wib.16.1417622947372; Wed, 03 Dec 2014 08:09:07 -0800 (PST) Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com. [74.125.82.44]) by mx.google.com with ESMTPS id mn7si33764365wjc.31.2014.12.03.08.09.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 08:09:07 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.44 as permitted sender) client-ip=74.125.82.44; Received: by mail-wg0-f44.google.com with SMTP id b13so20449973wgh.31 for ; Wed, 03 Dec 2014 08:09:07 -0800 (PST) X-Received: by 10.194.83.42 with SMTP id n10mr8045297wjy.133.1417622946971; Wed, 03 Dec 2014 08:09:06 -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 kn5sm36849121wjb.48.2014.12.03.08.09.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 08:09:01 -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, alex.williamson@redhat.com, agraf@suse.de, joel.schopp@amd.com, gleb@kernel.org, pbonzini@redhat.com, borntraeger@de.ibm.com, cornelia.huck@de.ibm.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org, a.motakis@virtualopensystems.com Subject: [PATCH v5 3/5] KVM: arm/arm64: implement kvm_arch_is_virtual_intc_initialized Date: Wed, 3 Dec 2014 17:07:10 +0100 Message-Id: <1417622832-5460-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417622832-5460-1-git-send-email-eric.auger@linaro.org> References: <1417622832-5460-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.215.41 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_VIRTUAL_INTC_INITIALIZED and implements kvm_arch_is_virtual_intc_initialized Signed-off-by: Eric Auger --- arch/arm/include/asm/kvm_host.h | 6 ++++++ arch/arm/kvm/arm.c | 5 +++++ arch/arm64/include/asm/kvm_host.h | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index 53036e2..fe2c89b 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_VIRTUAL_INTC_INITIALIZED + #if defined(CONFIG_KVM_ARM_MAX_VCPUS) #define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS #else @@ -242,4 +244,8 @@ static inline void kvm_arch_sync_events(struct kvm *kvm) {} static inline void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) {} static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {} +/* returns true if the vgic dynamic initialization is done*/ +bool kvm_arch_is_virtual_intc_initialized(struct kvm *kvm); + + #endif /* __ARM_KVM_HOST_H__ */ diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 9e193c8..5309e4b 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -439,6 +439,11 @@ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu) return 0; } +bool kvm_arch_is_virtual_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 2012c4b..5badd30 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_VIRTUAL_INTC_INITIALIZED + #if defined(CONFIG_KVM_ARM_MAX_VCPUS) #define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS #else @@ -254,4 +256,7 @@ static inline void kvm_arch_sync_events(struct kvm *kvm) {} static inline void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) {} static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {} +/* returns true if the vgic dynamic initialization is done*/ +bool kvm_arch_is_virtual_intc_initialized(struct kvm *kvm); + #endif /* __ARM64_KVM_HOST_H__ */