From patchwork Thu Jan 15 14:47:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 43185 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9C6D2240BA for ; Thu, 15 Jan 2015 14:50:00 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id u14sf8193800lbd.3 for ; Thu, 15 Jan 2015 06:49:59 -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=FVTxdG2OuhOhj7z4hNmuVbbjkfkNfC2Fv2LIyLZ4Mv8=; b=lxZALk7NxHe99tnvrJkO5/waDGWHSlZpbrSoPZReadHho9KPXEAiS6LP8mMOQuuAdb A+SyWljOfBJ4rq3Q16gJduqfqEZFtoY7Nngv/5KjeRv7K6Fo5qhnkYoIRdDTlCLbrG1k oOksNAPSa9iJYq3/6GPLA5FTcCcSigbR1Lde8Nrg6lLkPl5cUn9MH5A/ahGjg6mmXyAY oT+SkaOMCB1Zxo+LFWmu4/5jB2RiVylzyBhjnapqTTG0lSe6VKf6JeIsgl7mYV7YrUDa 3DBHyJWtZb5OVwO69HYzXnKsVAv6paqbBVZLOBKoE+RhK+SbI+Eg3ppJiZChdIwIaw7H 6xCQ== X-Gm-Message-State: ALoCoQkHxxUAVfTKXQWo9r8Z3dqnZ3WDcd4XbFAb3ImQAET9G9qmjC2tf25L/CV87C9VVKJTa5Rj X-Received: by 10.194.71.48 with SMTP id r16mr3123wju.7.1421333399527; Thu, 15 Jan 2015 06:49:59 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.35 with SMTP id p3ls23761lap.49.gmail; Thu, 15 Jan 2015 06:49:59 -0800 (PST) X-Received: by 10.152.36.37 with SMTP id n5mr9990741laj.27.1421333399368; Thu, 15 Jan 2015 06:49:59 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id w4si1624921law.77.2015.01.15.06.49.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 06:49:59 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id pn19so13927152lab.9 for ; Thu, 15 Jan 2015 06:49:59 -0800 (PST) X-Received: by 10.112.173.202 with SMTP id bm10mr1693192lbc.24.1421333399271; Thu, 15 Jan 2015 06:49:59 -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.9.200 with SMTP id c8csp6389lbb; Thu, 15 Jan 2015 06:49:58 -0800 (PST) X-Received: by 10.194.243.1 with SMTP id wu1mr18539865wjc.69.1421333398622; Thu, 15 Jan 2015 06:49:58 -0800 (PST) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com. [209.85.212.174]) by mx.google.com with ESMTPS id wb6si3194938wjc.62.2015.01.15.06.49.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 06:49:58 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.174 as permitted sender) client-ip=209.85.212.174; Received: by mail-wi0-f174.google.com with SMTP id h11so35651146wiw.1 for ; Thu, 15 Jan 2015 06:49:58 -0800 (PST) X-Received: by 10.180.73.170 with SMTP id m10mr20059358wiv.72.1421333398322; Thu, 15 Jan 2015 06:49:58 -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 i3sm2389150wjw.2.2015.01.15.06.49.56 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 06:49:57 -0800 (PST) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, andre.przywara@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, alex.williamson@redhat.com, agraf@suse.de, gleb@kernel.org, pbonzini@redhat.com, borntraeger@de.ibm.com, cornelia.huck@de.ibm.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org, will.deacon@arm.com, a.motakis@virtualopensystems.com Subject: [PATCH v7 3/4] KVM: arm/arm64: implement kvm_arch_intc_initialized Date: Thu, 15 Jan 2015 15:47:46 +0100 Message-Id: <1421333267-15287-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421333267-15287-1-git-send-email-eric.auger@linaro.org> References: <1421333267-15287-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.50 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 --- 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 254e065..8f87259 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 2d6d910..9c905b4 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -454,6 +454,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 0b7dfdb..dfb6135 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