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: 5431921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 26A379F1C5 for ; Wed, 3 Dec 2014 16:11:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5EC1E20172 for ; Wed, 3 Dec 2014 16:11:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2525320379 for ; Wed, 3 Dec 2014 16:11:56 +0000 (UTC) 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 1XwCUw-0007eU-Oi; Wed, 03 Dec 2014 16:09:50 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XwCUU-0006sM-9w for linux-arm-kernel@lists.infradead.org; Wed, 03 Dec 2014 16:09:23 +0000 Received: by mail-wi0-f172.google.com with SMTP id n3so31834277wiv.11 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=HhB1EQzMIMqf2hBYv1n49nK2pbIBpFKkKFCC3Lapl99O90oOFH3U26aQ1LT1nCqDuH PyzFc4NewSXEb/BuhmqIyRVUA5swkOGtm0se6HzB3JAkY79TKH0ByGF3OZYIknXDbNHk M8FySW88Kf1mfuw4TaKz5Wu4JWSrPXOezdrvssMvxQXAXzzczvNbNTuDOXWA/XMgQrCb vhhVVvLS4619k/7p/qR8+PBzNlCZyROmuy01qTqmRCLOqiOKQK2NAQXBTk4LFbHxPniN 8TKV2DEos/vRDXOmSTar66oWvzasWRejyUww90c6BDnMoDS/CnhtvVS8EkZx+oau3IQF rXFA== X-Gm-Message-State: ALoCoQlgtL0LevUKq4E00qY2Kdw03cfMv4tfDjoPVmndKVQasUg9jlIPb1KQPlOg6MLrn6Dfa+Eh 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141203_080922_582189_97F6BA47 X-CRM114-Status: UNSURE ( 9.63 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: a.motakis@virtualopensystems.com, linux-kernel@vger.kernel.org, patches@linaro.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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 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);