From patchwork Fri Oct 27 08:34:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10029415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 38813602D6 for ; Fri, 27 Oct 2017 08:40:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26D9328F5A for ; Fri, 27 Oct 2017 08:40:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BF3628F5E; Fri, 27 Oct 2017 08:40:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A4BF428F5A for ; Fri, 27 Oct 2017 08:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=kaTrZhCnJcQsRAAjf2fhUgyI0US28UdRIWz3d0i0Rcg=; b=acF6OZgQakez6gt8vZwQyV6nb6 5h30Olc6PI6R3LUbtIvPMivJpLsnlAkjkFsPx5fqLm4eN51PsfragpQA7IcvehORPqmyQUchpkEY2 Wm3ykC08iid/Xet7cBANVTbflovrP3MKyEp1wwX9bGL2gYdnzR6n/VRF/5VDunim+qlRcPcC9AAd0 1BuhCfgEoG1GDd7WoGllEANzF1A6+bLGxeZ5DOLvng2JWv6CaTPJTW5cjQ2KdKQudtqYggdjju/Rt C0I9u1xCYcZZXzKje0IZy2xIhYjifGHO1vJr5Cxpwy1USfgQ44sNanDKBsjDAM893Rwo9KZ/bZTo/ 5T2piTVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e80Bm-000487-Lw; Fri, 27 Oct 2017 08:40:26 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e807N-00007R-Ur for linux-arm-kernel@lists.infradead.org; Fri, 27 Oct 2017 08:35:56 +0000 Received: by mail-lf0-x243.google.com with SMTP id 90so6520770lfs.13 for ; Fri, 27 Oct 2017 01:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=k/I8fc/g6O2EhDSvz5K27y/8rI7OenrloWt35KnYHPo=; b=A3a6eBhFNSGqx9KP8SyvnzbdDXQhtpawHnUd23Hiwbzo8TmIylZ3lki5aGORBfyU8f YDJkHUmBkEH/VG7h7C9BEn0898J6lw0LHP8tGh/lNAY5jJxdL1r8K1xIvguOl5fmSWhP HYvTUrUfcsGDPFe/MI+vlElKQUSOnRD8I1GfA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=k/I8fc/g6O2EhDSvz5K27y/8rI7OenrloWt35KnYHPo=; b=IXvRtkoSqt8xQ4I1FoTEw6VKiADYqYK+eYLZ2yOllMgUQSZrsjcuFaO9nIh+xF9ZvW TIMQ03AKcVHMik5d2KQR169do8UHgSgXl8IwIYLgOvZtjW92US6zG2dcKKrvnORVX2dQ 4kSnm9gI06rybv4ZWgeMbJZo/cx11gRMd4PLWxIR7d8foig1bbuGrjHyoOOgktbj3egE GqoT3CwU8zGgpIE4UDqv9uriukT1QwIPLHxa41vfcOUAUpvv3vQntxgpE3+j4z22tcc9 HqzKD6H9WbC2qduHsUdETbZtBGkZ2QUqLNjlhwojMYExV5cpCMgUE5tPwQ0Q/lKED52m FLAQ== X-Gm-Message-State: AMCzsaXIj6Df/sQbftOS2yGs8CAq8rBjWoTJf4dOIM+KKJmSDJLfp3pH RdpvpYqBACE7Fbjl9Y+3RCz/hg== X-Google-Smtp-Source: ABhQp+SuXf23JIQtimfIrfDLPbTaTh0zAGpGsuWqQMMfCkd2JdkKGBiiYdGXGazrgjGVn0/EH1ESZw== X-Received: by 10.25.79.74 with SMTP id a10mr9027940lfk.162.1509093333424; Fri, 27 Oct 2017 01:35:33 -0700 (PDT) Received: from localhost.localdomain (212.27.17.163.bredband.3.dk. [212.27.17.163]) by smtp.gmail.com with ESMTPSA id d204sm1471957lfe.73.2017.10.27.01.35.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Oct 2017 01:35:32 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 06/20] KVM: arm/arm64: Check that system supports split eoi/deactivate Date: Fri, 27 Oct 2017 10:34:27 +0200 Message-Id: <1509093281-15225-7-git-send-email-cdall@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509093281-15225-1-git-send-email-cdall@linaro.org> References: <1509093281-15225-1-git-send-email-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171027_013554_205622_B40F9798 X-CRM114-Status: GOOD ( 12.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christoffer Dall , kvm@vger.kernel.org, Marc Zyngier , Catalin Marinas , Will Deacon , Eric Auger MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Some systems without proper firmware and/or hardware description data don't support the split EOI and deactivate operation. On such systems, we cannot leave the physical interrupt active after the timer handler on the host has run, so we cannot support KVM with an in-kernel GIC with the timer changes we are about to introduce. This patch makes sure that trying to initialize the KVM GIC code will fail on such systems. Acked-by: Marc Zyngier Signed-off-by: Christoffer Dall --- drivers/irqchip/irq-gic-v3.c | 8 ++++++-- drivers/irqchip/irq-gic.c | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index b5df99c..854334a 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -1228,7 +1228,9 @@ static int __init gic_of_init(struct device_node *node, struct device_node *pare goto out_unmap_rdist; gic_populate_ppi_partitions(node); - gic_of_setup_kvm_info(node); + + if (static_key_true(&supports_deactivate)) + gic_of_setup_kvm_info(node); return 0; out_unmap_rdist: @@ -1517,7 +1519,9 @@ gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end) goto out_fwhandle_free; acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle); - gic_acpi_setup_kvm_info(); + + if (static_key_true(&supports_deactivate)) + gic_acpi_setup_kvm_info(); return 0; diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index f641e8e..121af5c 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -1420,7 +1420,8 @@ static void __init gic_of_setup_kvm_info(struct device_node *node) if (ret) return; - gic_set_kvm_info(&gic_v2_kvm_info); + if (static_key_true(&supports_deactivate)) + gic_set_kvm_info(&gic_v2_kvm_info); } int __init @@ -1652,7 +1653,8 @@ static int __init gic_v2_acpi_init(struct acpi_subtable_header *header, if (IS_ENABLED(CONFIG_ARM_GIC_V2M)) gicv2m_init(NULL, gic_data[0].domain); - gic_acpi_setup_kvm_info(); + if (static_key_true(&supports_deactivate)) + gic_acpi_setup_kvm_info(); return 0; }