From patchwork Mon Jan 19 16:43:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 43330 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0E5C82034D for ; Mon, 19 Jan 2015 16:46:03 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hs14sf17571884lab.1 for ; Mon, 19 Jan 2015 08:46:01 -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=Rmm0/mWrgSBUbiNYfXZo9GPJD/HwwErZOB0J/iFNYwk=; b=JfpD5qqv4dswknGGp66/HQZzP83eqiyYwZcdyJ5hF0x9Th8/c9SXUV0UI5WJbZOiUI 3kp97ZcEI9494awAGem/XweF+5CNbKk2UYjI1wJKeoToyTRyGuz0cmexa7wTGAMUfQIJ nyVxkSb+Rx+fwarkqHyWBD7xMToVMqvt8b/dfniOPOK53L3HXG5OAu9rA21GbI1hpeus 4/yFVMbtSXE49SU0UFDprqxpHYDoVDAeRzPRxShEgFmBYYkzahyCAvmMNE/maHdNQ49h 82OD2IpqGk1gZtzdpWk5oB7XtWZcJ9fYVE282/OOOsVUbDRp1MT7xGCYWoI7tnj20648 T3fA== X-Gm-Message-State: ALoCoQnx/C/otgmLj8rc8zhUBCWvZlAGdGIWj2a+/7PdLFkoKMZ1m92pu2n5bASsEwaaAenAE95/ X-Received: by 10.112.114.162 with SMTP id jh2mr466980lbb.9.1421685961766; Mon, 19 Jan 2015 08:46:01 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.232 with SMTP id h8ls671049lam.3.gmail; Mon, 19 Jan 2015 08:46:01 -0800 (PST) X-Received: by 10.112.54.167 with SMTP id k7mr7446507lbp.72.1421685961618; Mon, 19 Jan 2015 08:46:01 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id tz3si12486171lbb.66.2015.01.19.08.46.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Jan 2015 08:46:01 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so29924842lab.8 for ; Mon, 19 Jan 2015 08:46:01 -0800 (PST) X-Received: by 10.112.84.225 with SMTP id c1mr32439951lbz.22.1421685961529; Mon, 19 Jan 2015 08:46:01 -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 c8csp1148468lbb; Mon, 19 Jan 2015 08:46:01 -0800 (PST) X-Received: by 10.194.239.134 with SMTP id vs6mr58668807wjc.19.1421685960776; Mon, 19 Jan 2015 08:46:00 -0800 (PST) Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com. [74.125.82.47]) by mx.google.com with ESMTPS id k7si27046945wjx.63.2015.01.19.08.46.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Jan 2015 08:46:00 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.47 as permitted sender) client-ip=74.125.82.47; Received: by mail-wg0-f47.google.com with SMTP id n12so2679765wgh.6 for ; Mon, 19 Jan 2015 08:45:31 -0800 (PST) X-Received: by 10.194.184.204 with SMTP id ew12mr2802682wjc.85.1421685930251; Mon, 19 Jan 2015 08:45:30 -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 dp8sm14812495wib.20.2015.01.19.08.45.28 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 19 Jan 2015 08:45:29 -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, gleb@kernel.org, pbonzini@redhat.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org Subject: [PATCH v8 3/5] KVM: arm/arm64: implement kvm_arch_intc_initialized Date: Mon, 19 Jan 2015 17:43:11 +0100 Message-Id: <1421685793-3547-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421685793-3547-1-git-send-email-eric.auger@linaro.org> References: <1421685793-3547-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.49 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 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