From patchwork Fri Oct 20 11:49:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10019955 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 47FE2602CB for ; Fri, 20 Oct 2017 11:51:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C3AF2868D for ; Fri, 20 Oct 2017 11:51:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2108B28ED0; Fri, 20 Oct 2017 11:51:38 +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=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM 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 A81A42868D for ; Fri, 20 Oct 2017 11:51:37 +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=iQI9dcsUkqZtIPVeNtz1+q7nVAv/6DOleNad9BrxWxM=; b=IICBXHsBLki+fDVb08EdHhOWno np3MysZhqvQPOxgMyQgB57NiAhfsxkSKIdEemD39sm7OLoztO/6vvS6kvcjXpAQ3mkxP8Iin9XuHC +wvjnMoMqqs5IJkmlRp1JtHj/C0GZq7WOwPIUuBBxeUGHNGwC6Irz4egA8JbgXrAhQEBcwtWcUuZo ARTfmmKRFMWSfaN+vOCb8FIHGlAOty/pvirj4ApiOijQveerj380k1PGGjH6IvcDguRao1tgolYzJ AAsWQ4H5UYXfycGLvcRmqfP6lwIwQJe29YeKNr9CV2QpnwKiZA9j95Wb6QYDlnGR887RvL6WgvTdO 0Fcu0U4g==; 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 1e5Vpq-000245-Ek; Fri, 20 Oct 2017 11:51:30 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e5VoW-00083E-Qo for linux-arm-kernel@lists.infradead.org; Fri, 20 Oct 2017 11:50:12 +0000 Received: by mail-wm0-x242.google.com with SMTP id p75so2267397wmg.3 for ; Fri, 20 Oct 2017 04:49:52 -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=Dz2HL/KBuWxy/cmkMlMV/2bQiecg9qc64AX5IMman9A=; b=CoC4YF/D2rfxd9P+iiAsAgZvvbXD8SXwkqil4twBhDPtlDsa+gRXcB5JNL84FmCNXn f16JbuVMNLJQzAZlGi1kFnKUZkeGmt3PQ8G08YQkN0XDjm+iFXf91VYvQwYXrx9cJ/51 +SQNmO96VvY1tcvuY0M8OYtQo8aYqNy6TLalY= 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=Dz2HL/KBuWxy/cmkMlMV/2bQiecg9qc64AX5IMman9A=; b=aYpxi2Wy+gNYRFq7CbKaRtabrxBpl1+YFVgplVM2XkHswpsHYvgCI6pb6YKETCIhFL w40JGn5EevnakuJ1tPpcknJMOvgWQr+k6NbiMGbkOle/dG4OYKZra8nox4wYzooIJ9dX KgV2udFuw3ALmnvCvTahYOpEsEyNVjUBD/BjJ3/0WKUwb0icU744sUkjUxPqLmD01TOb rtojAbtxqoAUSrJQww8ulpFnYcyh2PJSx/zA7HicWmZ9zNDuZo2iA5TrcjJgM0BXdICW /GyF5+8AhEjr+Mwwdv6o7db7SUooYT9BMwNUSNxG5o48j5LPGdSAlFjrsZnE0TkI4DOl D0gQ== X-Gm-Message-State: AMCzsaU0Saxvued6P7u7Z+qK+mMOj3uTNw/HsPKMNkUCmwUD4X4u+dhz fy0zKg1V6wBadasU23FB++jdkQ== X-Google-Smtp-Source: ABhQp+R/yLCo08iJb096ugTrCxm1wDrM9QVAmfA3JGOzhgl0SPMdDRgiN2dqAdca+soSPkK5BXF9Hw== X-Received: by 10.80.153.134 with SMTP id m6mr5992716edb.265.1508500190849; Fri, 20 Oct 2017 04:49:50 -0700 (PDT) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id f53sm872234ede.63.2017.10.20.04.49.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Oct 2017 04:49:49 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 06/20] KVM: arm/arm64: Check that system supports split eoi/deactivate Date: Fri, 20 Oct 2017 13:49:25 +0200 Message-Id: <20171020114939.12554-7-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171020114939.12554-1-christoffer.dall@linaro.org> References: <20171020114939.12554-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171020_045009_289938_1AEF0A51 X-CRM114-Status: GOOD ( 12.90 ) 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: Marc Zyngier , Christoffer Dall , Shih-Wei Li , kvm@vger.kernel.org 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 From: Christoffer Dall 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. Cc: Marc Zyngier Signed-off-by: Christoffer Dall Acked-by: Marc Zyngier --- Notes: Changes since v3: - Also check that ACPI and GICv3 systems support split eoi/deactivate 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 b5df99c6f680..854334a6f225 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 f641e8e2c78d..121af5cf688f 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; }