From patchwork Tue Nov 7 10:47:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10046413 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 E0C88603FF for ; Tue, 7 Nov 2017 10:53:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9106287C3 for ; Tue, 7 Nov 2017 10:53:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADAC928EA1; Tue, 7 Nov 2017 10:53:22 +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 3E9D828A22 for ; Tue, 7 Nov 2017 10:53:21 +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=KJz1M6kEh3TH9hU2BJy0+KwfYTiYGGVpnaDuHLQHqyQ=; b=oQbd5qTB9kLDjTAZGguyZvSTEL lWYFCVw2joy+kAEszuQUWJhUr8ZWgfMCRzuVKCJmsicXGjluZ6CyiQ9M2lbMJ0fpLRiM3w877VK0p 71ABNTuPz5TJx/iS60Dpp1JPWRdm/uc6RCmpX35E4Vmr1DW3OAAmggXr+QmOHC+y8g74PNl29DpvV 7g5VFdKOusGBxPXvmEQr4F7O3mmvqJjGDoDf48qXAvC2WNiB3OwAHjlis33DFdu9+c1fJGnyRQeHy 1+ImL5Yx3HgXAWZuC/9lYs72NykA+sKKZFbiqbcVroFm45mp8zi9qSsBAMqS3rpLySs1GuRUATtPw oQVO2UqQ==; 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 1eC1VI-0006NL-O3; Tue, 07 Nov 2017 10:53:12 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eC1Qu-0000xn-Cf for linux-arm-kernel@lists.infradead.org; Tue, 07 Nov 2017 10:48:49 +0000 Received: by mail-wm0-x244.google.com with SMTP id r196so2752768wmf.2 for ; Tue, 07 Nov 2017 02:48:18 -0800 (PST) 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=jmRtVVrIRBOr7t4AI7alVPgw8/trlfyPJvp30yM6JE8=; b=bkNZtsQv++MJChNkikSiuSGPqM92YKWEXWM/jtdeYJ0houVsIO3//6BRVGUQOjh7zd YqQprVbvqNLyoEh6naSw064xi+7bnxi86vhB1SE3nC1n5hm03F1ospRryHgKldYLI6tK pVWNpRv4Ax1IX8zRVlAoajfP2GByIt2wxK1wY= 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=jmRtVVrIRBOr7t4AI7alVPgw8/trlfyPJvp30yM6JE8=; b=kxogd9kFkXe+7cKeomwzvZvA7qH2YMFF/E7jQqdjKgHCTqGUSM/8l4+WbyAV0FY/Fv 1GrBvEAnIvwcGEt3GldhJ+wMLxQF67zXIh+NVa6EpVKHEKgXKQ5qTsXPA69TxRH38Rxv 2AQbMN73ePCDdNarvmebC72DkrKhK92AFystWJ9jaK2NPKZg4x4JBL9Mlfn+F4oVkahS wLbqhWW6hljNEApT0NtzatIMYyM6h6VnZXNm72DOvurxB4x+4SrKBImqH6bDDm+vGorf u+Cdn5tmIvk5TkF7iwoOxJXBNyPoY3wI6shcscaDQsVuYxEygi7l78+GYbg8oz7Mrijo X8wg== X-Gm-Message-State: AMCzsaUazKZGoW+LwB25TSPT38mWJ6vIWny5/5fwbKIp8XBo/Rvtofo0 8YtPuFOHpe6dswq2f3luR1eCvF5m9pI= X-Google-Smtp-Source: ABhQp+TMCrEBPeKIz9m2AmbVMQ11m6vC8WF5Q5pmx5i5i2aK6eo+ney6E+BEZF2NLv4XdNf81nmRHw== X-Received: by 10.80.174.193 with SMTP id f1mr24749892edd.207.1510051697100; Tue, 07 Nov 2017 02:48:17 -0800 (PST) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id q12sm1044958edj.29.2017.11.07.02.48.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Nov 2017 02:48:16 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL 05/26] KVM: arm/arm64: Check that system supports split eoi/deactivate Date: Tue, 7 Nov 2017 11:47:38 +0100 Message-Id: <20171107104800.30021-6-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171107104800.30021-1-christoffer.dall@linaro.org> References: <20171107104800.30021-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171107_024840_823417_B8F04ABD X-CRM114-Status: GOOD ( 12.49 ) 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 , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.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. 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 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 651d726e8b12..cd9371b749c2 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -1367,7 +1367,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 @@ -1599,7 +1600,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; }