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: 10029359 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 2480B602D6 for ; Fri, 27 Oct 2017 08:35:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1352E28F5A for ; Fri, 27 Oct 2017 08:35:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 083A228F5D; Fri, 27 Oct 2017 08:35:47 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1D1A28F5A for ; Fri, 27 Oct 2017 08:35:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752370AbdJ0Ifo (ORCPT ); Fri, 27 Oct 2017 04:35:44 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:46417 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752349AbdJ0Ife (ORCPT ); Fri, 27 Oct 2017 04:35:34 -0400 Received: by mail-lf0-f68.google.com with SMTP id g70so6545808lfl.3 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=Qe8pJUDqFPtaC1TTrwIBrIdRIGMTB6rBvEoJpW2hBz70OAstLoqHfFOHJa3TM/1KQW 0wOng7lgRfvdLmJWiXHvaHVfvb+XCu/Jdjuaf2iti9kXqNwcuF8QzkQgLvmn4KctpMtE AM5DjGwJx9rgqFlmi8QCFAt3171VxqvXbHjckGoQQRH88LitMGc2rTpWhUrPsTVr0dTM 5+JRh/ust1cXPThAsWuN/nMypmlszVlqHx+vXDzgNATK4ccvlfh3V9WctQXXaLxOnkO/ MwdIYNFa8cfjisvH5NsijBPvPYy24dXr23rnzXoMvD6KFYxiIo1CqVWjexFWDIZohLPZ +Tgw== X-Gm-Message-State: AMCzsaWVqiKALD2/3CTooNDhfucs+a8hErk5sdn17HtRSrNoBRg4OY4F mVK6JBmmtha9fp4vMBv4Gxw11A== 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 Cc: Marc Zyngier , Eric Auger , kvm@vger.kernel.org, Catalin Marinas , Will Deacon , Christoffer Dall 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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; }