From patchwork Thu Apr 2 10:05:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 46713 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 055C2216D1 for ; Thu, 2 Apr 2015 10:14:20 +0000 (UTC) Received: by wixm2 with SMTP id m2sf17730954wix.0 for ; Thu, 02 Apr 2015 03:14:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=+wscPNmzFigBcQ84G3CAD6H4I8bRBG2Edib3VR5kWVQ=; b=ep/SObFydL4nP8pM7y7IFyXI176AVPDo4DQ99qd7C417fP+ZGSiXB1WTWarhvCUgaE 5gC4OijrMEN1siXQiQmByIKGjQS6HzX9DoL/zQUjMzkgF0Xve2mZQIRXXlYpVG/nGX0i OlDWq1MIcNUHiHXFgBD3PNH/IWsDTiDAwfUJnRL3/jm8qxeQCKBkYGhFmBVVFJGmBzpa fq3b8Fms6A84TEmlhuJE/R/0Aziajiaxq/FdNj4tUjjRGrCWGs2ofw+wzQsnqVphePzu ai2Pw9FTpd32aLgUG3lWzfJpZ4CTboMwuGfFlKzVRLu5064PqQ+8wv5DfKdv6GBiCGte cH+Q== X-Gm-Message-State: ALoCoQkFCxSWTsGaXiAIV7Ts/eWel8apOcW//W3UdsHXlpDnEfE9abOp7kfgiHi3YDwN9ITFP4W+ X-Received: by 10.152.206.36 with SMTP id ll4mr1676843lac.6.1427969659206; Thu, 02 Apr 2015 03:14:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.7.172 with SMTP id dd12ls201613lad.53.gmail; Thu, 02 Apr 2015 03:14:18 -0700 (PDT) X-Received: by 10.152.23.70 with SMTP id k6mr11117356laf.76.1427969658810; Thu, 02 Apr 2015 03:14:18 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id qn3si3875410lbc.42.2015.04.02.03.14.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Apr 2015 03:14:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lboc7 with SMTP id c7so55824508lbo.1 for ; Thu, 02 Apr 2015 03:14:18 -0700 (PDT) X-Received: by 10.152.19.199 with SMTP id h7mr41121243lae.32.1427969658650; Thu, 02 Apr 2015 03:14:18 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp1232520lbq; Thu, 2 Apr 2015 03:14:17 -0700 (PDT) X-Received: by 10.67.4.132 with SMTP id ce4mr49399464pad.37.1427969656862; Thu, 02 Apr 2015 03:14:16 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id uv1si6843541pac.192.2015.04.02.03.14.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Apr 2015 03:14:16 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ydc53-0004tc-JZ; Thu, 02 Apr 2015 10:10:33 +0000 Received: from inca-roads.misterjones.org ([213.251.177.50]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ydc0G-000127-AQ for linux-arm-kernel@lists.infradead.org; Thu, 02 Apr 2015 10:05:37 +0000 Received: from dab-yat1-h-1-5.dab.02.net ([82.132.213.233] helo=why.wild-wind.fr.eu.org) by cheepnis.misterjones.org with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.80) (envelope-from ) id 1Ydbzr-0006QV-7S; Thu, 02 Apr 2015 12:05:11 +0200 From: Marc Zyngier To: Paolo Bonzini , Marcelo Tosatti Subject: [PATCH 06/27] KVM: arm/arm64: implement kvm_arch_intc_initialized Date: Thu, 2 Apr 2015 11:05:10 +0100 Message-Id: <1427969131-8445-7-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1427969131-8445-1-git-send-email-marc.zyngier@arm.com> References: <1427969131-8445-1-git-send-email-marc.zyngier@arm.com> X-SA-Exim-Connect-IP: 82.132.213.233 X-SA-Exim-Rcpt-To: pbonzini@redhat.com, mtosatti@redhat.com, eric.auger@linaro.org, christoffer.dall@linaro.org, andre.przywara@arm.com, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, alex.bennee@linaro.org, n.nikolaev@virtualopensystems.com X-SA-Exim-Mail-From: marc.zyngier@arm.com X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150402_030536_548805_38C4C5B0 X-CRM114-Status: UNSURE ( 8.86 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.6 (+) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (1.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.6 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [82.132.213.233 listed in dnsbl.sorbs.net] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) Cc: Mark Rutland , kvm@vger.kernel.org, Eric Auger , Andre Przywara , Nikolay Nikolaev , Christoffer Dall , =?UTF-8?q?Alex=20Benn=C3=A9e?= , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: marc.zyngier@arm.com 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.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Eric Auger 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 Acked-by: Marc Zyngier Signed-off-by: Christoffer Dall --- 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 37b46c5..5e893eb 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -448,6 +448,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