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: Eric Auger X-Patchwork-Id: 5431961 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8FCEEBEEA8 for ; Wed, 3 Dec 2014 16:12:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C8D2920172 for ; Wed, 3 Dec 2014 16:12:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EAED720253 for ; Wed, 3 Dec 2014 16:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752082AbaLCQLx (ORCPT ); Wed, 3 Dec 2014 11:11:53 -0500 Received: from mail-wg0-f45.google.com ([74.125.82.45]:39562 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753216AbaLCQJB (ORCPT ); Wed, 3 Dec 2014 11:09:01 -0500 Received: by mail-wg0-f45.google.com with SMTP id b13so20326450wgh.4 for ; Wed, 03 Dec 2014 08:08:59 -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=JpDEQX/QQRxo/RAXv73hx5p1v+y8pz6onxIQKJgA8OI=; b=P5dIQ2q+B3bpTimPYuoXJmVAuxeQ6WWuZx9sDcQtOvebrkZNFkDUqScUKhguZVgDdc zph5Jzp0JMfqOiLV9cAVgl08xCQzHjmD9SAbAG61pV86BGZK0s2dvg+7sgFoFQ8xeKEo DT3nQnB5dtUPX5nJ0UKukjF+jlkD067m9p/GHHvNPzpKSpuMqan9UkrY/41RtOEyDDtz ZZzJUtbObWqk5AHQM1R5xzVdEtaTX5EX/lFNjk8bQQ4SKIRrRxSdhUKdPXOvK4RQJ3Ne 0Gvjcb5bPfDHrI/ikpqRcn1pXeKl58Aunip2pBWsUCBoLq6Syyqr9T/Tb1CSdi34Ok3O 9hng== X-Gm-Message-State: ALoCoQlauWOPhPkOQGXi1aBPReSVguxe37/WW39FfpJ0NxqdVAuiu9bm7bgGMpm0RuSR1gQ7w782 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> 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=ham 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 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);