From patchwork Wed Dec 3 16:07:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 41859 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 17C5C25E88 for ; Wed, 3 Dec 2014 16:09:02 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id p9sf9765521lbv.1 for ; Wed, 03 Dec 2014 08:09: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=JpDEQX/QQRxo/RAXv73hx5p1v+y8pz6onxIQKJgA8OI=; b=JZfJRqhqEHJrYR85JprG3a+99Zf95B2JC2AFsUkzkbM3T/wwC9BTRwxFT7mhJr0srW YnzgpVzHBnmvD4/SQKFkHxZ/g1iVq0Xg+xEBh52aTi9C6iLSBHxw2R3GpgLg/qEROVIY Y2OaWYnn5oT2ceRJ0G/S4NZJ3tP8EY3Jgr9Yy4Xr0BtlZMXN6b0ZJOpJop/ZKOT9UAZ+ wRYwTDLhr77AeChC7x7VLaS+z3Fvo2PYZCepChYLjhMRgYno1V5WplUs0NkLtGMfKA4X svZ0bkFpVpg0vE3dYKQTj2eIOOdEX4LmUR5p/UgBJh73p/auMTJlmOZ7RJogI6Yyk5We PN8A== X-Gm-Message-State: ALoCoQnkHZUrTPWhg5NKWTT28g6n4fyjVCPaHmhywGtzj6E33jNjorA+vGMFh4NWjuy6tOeDKxNz X-Received: by 10.112.14.2 with SMTP id l2mr1240025lbc.5.1417622941097; Wed, 03 Dec 2014 08:09:01 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.134 with SMTP id t6ls158687lag.78.gmail; Wed, 03 Dec 2014 08:09:00 -0800 (PST) X-Received: by 10.152.5.132 with SMTP id s4mr4927951las.39.1417622940963; Wed, 03 Dec 2014 08:09:00 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id 6si23420625laj.58.2014.12.03.08.09.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 08:09:00 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id f15so13576191lbj.23 for ; Wed, 03 Dec 2014 08:09:00 -0800 (PST) X-Received: by 10.152.2.165 with SMTP id 5mr5046178lav.40.1417622940886; Wed, 03 Dec 2014 08:09:00 -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.184.201 with SMTP id ew9csp691546lbc; Wed, 3 Dec 2014 08:09:00 -0800 (PST) X-Received: by 10.194.95.196 with SMTP id dm4mr8598212wjb.41.1417622940152; Wed, 03 Dec 2014 08:09:00 -0800 (PST) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com. [209.85.212.171]) by mx.google.com with ESMTPS id lq1si12677028wjb.25.2014.12.03.08.09.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 08:09:00 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.171 as permitted sender) client-ip=209.85.212.171; Received: by mail-wi0-f171.google.com with SMTP id bs8so31894749wib.4 for ; Wed, 03 Dec 2014 08:08:59 -0800 (PST) X-Received: by 10.180.103.38 with SMTP id ft6mr14663374wib.19.1417622939821; Wed, 03 Dec 2014 08:08:59 -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 kn5sm36849121wjb.48.2014.12.03.08.08.57 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 08:08:59 -0800 (PST) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, christoffer.dall@linaro.org, marc.zyngier@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, gleb@kernel.org, pbonzini@redhat.com, borntraeger@de.ibm.com, cornelia.huck@de.ibm.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org, a.motakis@virtualopensystems.com Subject: [PATCH v5 2/5] KVM: introduce kvm_arch_is_virtual_intc_initialized Date: Wed, 3 Dec 2014 17:07:09 +0100 Message-Id: <1417622832-5460-3-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417622832-5460-1-git-send-email-eric.auger@linaro.org> References: <1417622832-5460-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.217.178 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_VIRTUAL_INTC_INITIALIZED define and associated kvm_arch_is_virtual_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 --- include/linux/kvm_host.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index ea53b04..45fea3c 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -696,6 +696,18 @@ static inline wait_queue_head_t *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu) #endif } +#ifndef __KVM_HAVE_ARCH_VIRTUAL_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. + */ +static inline bool kvm_arch_is_virtual_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);