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: Eric Auger X-Patchwork-Id: 5640671 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3B246C058D for ; Thu, 15 Jan 2015 14:50:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60CE620149 for ; Thu, 15 Jan 2015 14:50:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6F6E62017D for ; Thu, 15 Jan 2015 14:50:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754036AbbAOOuE (ORCPT ); Thu, 15 Jan 2015 09:50:04 -0500 Received: from mail-wi0-f173.google.com ([209.85.212.173]:36312 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753698AbbAOOt7 (ORCPT ); Thu, 15 Jan 2015 09:49:59 -0500 Received: by mail-wi0-f173.google.com with SMTP id hi2so12775827wib.0 for ; Thu, 15 Jan 2015 06:49:58 -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=FVTxdG2OuhOhj7z4hNmuVbbjkfkNfC2Fv2LIyLZ4Mv8=; b=Qrmp67zod3QG+QzGtboBC0rcIQD2sMoyirx/IGZRaQcIaeDGhy+un4O3R5J1zye63A /xFwgsstI6ch7JknKHom7v8wrx8BR5y2Y3PL4cvs8ZP+SFdC4u2tJaSGeyFHGukHNk3T TYSMDMYdvmvTohChgYKIZlGFrWHUWUvB6ZDvlaAsMS72wsy78VPEeEFvHqgZqk/DHYtQ iLNlW3drG5/2AWzfLJWcxlJfeTWgZ1vC/NZ3q03Xdm/gpaF+33DlEUSywfYbUVqtnrN+ heHNYPFnPPzKhvwAsVFBAJa18pJAdc3SIi9CALhahNyPAzvrg/Ox9o5rotCDeggFOV1w rRPw== X-Gm-Message-State: ALoCoQlPN3jtZ0oLAmM1NBC2BFhIM+BJJ5h1gdMAIT5nqBusFX6FP4s+I7APcaM5v/nJCVVLtg0O 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 --- 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