From patchwork Tue Jan 13 17:33:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 43073 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A39FB26D19 for ; Tue, 13 Jan 2015 17:35:46 +0000 (UTC) Received: by mail-we0-f199.google.com with SMTP id k11sf2424335wes.2 for ; Tue, 13 Jan 2015 09:35:46 -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=zsFmyxD4wMqrMk3OD+ODF138CACoaWqZNKO/XsVIte8=; b=O8rq6jGUGS5ZTnKLDMxTALpLa7XZWQTHaIicBRCbQBc9BziOOY0xBuXRYWEk7QllAk Yik7nWgs7c1bOx4yhErGmKFUhXjm++AZfEcux7aqh3uXzPZM6trouN3UliMQkOyrSjke wD6exx6d1gmoMTRqiYTncnkgX/yjO1MdsU3UpU5tEL94u6h5PuQFqo0KFfDPGmfyidvL 8JrCXjmwM3L0J/aYKgg5CtKNH06lJOHJVoiC3fXbZfpDELUT1ZAWAFPwzkkmX8FisHzI 8/EDqj5etDQNXjTv72qi8kQp80FXOIDG1bR1c89wDU2y2tgNnDlCXZoRSjcqpK2zkZAg g+VA== X-Gm-Message-State: ALoCoQkGJhg7ShS+5fKSdd6PJmIDgEm5yPR7rlV7ljFBoK3CRnEqGkQ78q478zihJlYEMA5jfYOh X-Received: by 10.180.85.230 with SMTP id k6mr2590891wiz.1.1421170545965; Tue, 13 Jan 2015 09:35:45 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.49 with SMTP id bd17ls24919lab.14.gmail; Tue, 13 Jan 2015 09:35:45 -0800 (PST) X-Received: by 10.112.158.40 with SMTP id wr8mr43572867lbb.51.1421170545844; Tue, 13 Jan 2015 09:35:45 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id c6si3573998lag.25.2015.01.13.09.35.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 09:35:45 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id gd6so3935208lab.1 for ; Tue, 13 Jan 2015 09:35:45 -0800 (PST) X-Received: by 10.152.26.201 with SMTP id n9mr44069160lag.50.1421170545727; Tue, 13 Jan 2015 09:35:45 -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 c8csp1451434lbb; Tue, 13 Jan 2015 09:35:45 -0800 (PST) X-Received: by 10.180.221.72 with SMTP id qc8mr42855336wic.19.1421170545050; Tue, 13 Jan 2015 09:35:45 -0800 (PST) Received: from mail-we0-f175.google.com (mail-we0-f175.google.com. [74.125.82.175]) by mx.google.com with ESMTPS id eu10si21448937wib.42.2015.01.13.09.35.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 09:35:45 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.175 as permitted sender) client-ip=74.125.82.175; Received: by mail-we0-f175.google.com with SMTP id k11so4267660wes.6 for ; Tue, 13 Jan 2015 09:35:44 -0800 (PST) X-Received: by 10.180.24.138 with SMTP id u10mr779849wif.80.1421170544770; Tue, 13 Jan 2015 09:35:44 -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 fw6sm2660487wib.1.2015.01.13.09.35.42 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 09:35:43 -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, joel.schopp@amd.com, kim.phillips@freescale.com, paulus@samba.org, 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, a.rigo@virtualopensystems.com, john.liuli@huawei.com, ming.lei@canonical.com, feng.wu@intel.com, b.reynal@virtualopensystems.com Subject: [PATCH v6 2/4] KVM: introduce kvm_arch_intc_initialized Date: Tue, 13 Jan 2015 18:33:38 +0100 Message-Id: <1421170420-30617-3-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421170420-30617-1-git-send-email-eric.auger@linaro.org> References: <1421170420-30617-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.42 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: , Introduce __KVM_HAVE_ARCH_INTC_INITIALIZED define and associated kvm_arch_intc_initialized function. This latter allows to test whether the virtual interrupt controller is initialized and ready to accept virtual IRQ injection. On some architectures, the virtual interrupt controller is dynamically instantiated, justifying that kind of check. Signed-off-by: Eric Auger Acked-by: Christoffer Dall --- v5 -> v6: - rename function name and macro - add kvm_arch_intc_initialized declaration in case the archi defines the macro --- include/linux/kvm_host.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 26f1060..702036a 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -706,6 +706,20 @@ static inline wait_queue_head_t *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu) #endif } +#ifdef __KVM_HAVE_ARCH_INTC_INITIALIZED +/* + * returns trues if the virtual interrupt controller is initialized and + * ready to accept virtual IRQ. On some architectures the virtual interrupt + * controller is dynamically instantiated and this is not always true. + */ +bool kvm_arch_intc_initialized(struct kvm *kvm); +#else +static inline bool kvm_arch_intc_initialized(struct kvm *kvm) +{ + return true; +} +#endif + int kvm_arch_init_vm(struct kvm *kvm, unsigned long type); void kvm_arch_destroy_vm(struct kvm *kvm); void kvm_arch_sync_events(struct kvm *kvm);