Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2058575imu; Wed, 12 Dec 2018 08:50:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/XsQ/F3FvacmW+WA0pH8WkmUkT0MGdw8wLqTFTzhBN3YRsYXlqnFVO7MQWIO0hZGIduBmsM X-Received: by 2002:a63:bf0b:: with SMTP id v11mr19298104pgf.302.1544633419650; Wed, 12 Dec 2018 08:50:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544633419; cv=none; d=google.com; s=arc-20160816; b=webz8SPgt+PsyP0OYru1gt94ga00WvEs3dsPkBpJJpw6fne2Xc/k1h365lvDlwkQ2u GZDB6WayL/PTgC6uVnWJcVtg0zOQ9anFRJOtZ20opkfR03Zb6SA2N1UTZTI013hglkGf TYba2KWr2MnZrYqorUCgVu3HfD3x+b6OlxlFwW9JsmNxkRvhClOMy73SRIEcFJvU1RC9 u3iViec3NYw4Wz0cLBlSAetPzhW5YGLWkGwRVSNMu+kEDPVffTct217i+loxUhOvjHeq c0wNAIaKM9h8alMPBQ0cISA1gwe5gdo3kienvU+rQJI4x7yyhHbguZm1uEugI/rX3bGg 5r5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Hlg1LmTR+mpS9aZi+irIqPrzKOLF4Hbcn+oky5yNXAc=; b=jUO4z1teY8sfwZ5Md/pgTaOTx5JHnTxsGdsrD3h/9Svs/U/J/cHc9Z5txN6l5MdQmJ dCVFX5VJKqxg9hJ5sUqfLBxcohdRLPz0/17IGNX60jLJaso4ko0dOVjJqm5rBm1zwT0v BTlrk4B09d/UxHwyiMg0E0exM+l+QllFqAfYEFRz4Fjk7DQtADRMewsH2K6KFYmaSpbG rz4KPoZMsMkIgbyuVI6+rPHRHI0YRuTeu4RwceuYiYBKhm2IfvogOD3cZy4QpCKOBO7P FYi+6D0Qb5DVKojASjKs/up2Wnfuhd8bwKXS3ro90qXML4v7n6Llak9OUlCom/sHa21N l5nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37si15422989plv.243.2018.12.12.08.50.05; Wed, 12 Dec 2018 08:50:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728212AbeLLQss (ORCPT + 99 others); Wed, 12 Dec 2018 11:48:48 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44768 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728200AbeLLQsq (ORCPT ); Wed, 12 Dec 2018 11:48:46 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9F9AF15BF; Wed, 12 Dec 2018 08:48:46 -0800 (PST) Received: from e112298-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A69DD3F575; Wed, 12 Dec 2018 08:48:44 -0800 (PST) From: Julien Thierry To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, daniel.thompson@linaro.org, joel@joelfernandes.org, marc.zyngier@arm.com, christoffer.dall@arm.com, james.morse@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com, Julien Thierry Subject: [PATCH v7 25/25] arm64: Enable the support of pseudo-NMIs Date: Wed, 12 Dec 2018 16:47:25 +0000 Message-Id: <1544633245-6036-26-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1544633245-6036-1-git-send-email-julien.thierry@arm.com> References: <1544633245-6036-1-git-send-email-julien.thierry@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a build option and a command line parameter to build and enable the support of pseudo-NMIs. Signed-off-by: Julien Thierry Suggested-by: Daniel Thompson Cc: Catalin Marinas Cc: Will Deacon --- Documentation/admin-guide/kernel-parameters.txt | 6 ++++++ arch/arm64/Kconfig | 14 ++++++++++++++ arch/arm64/kernel/cpufeature.c | 11 ++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index aefd358..0e6628d 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1184,6 +1184,12 @@ to discrete, to make X server driver able to add WB entry later. This parameter enables that. + enable_pseudo_nmi [ARM64] + Enables support for pseudo-NMIs in the kernel. This + requires both the kernel to be built with + CONFIG_ARM64_PSEUDO_NMI and to be running on a + platform with GICv3. + enable_timer_pin_1 [X86] Enable PIN 1 of APIC timer Can be useful to work around chipset bugs diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index ea2ab03..3c294f6 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -983,6 +983,20 @@ config ARM64_SSBD If unsure, say Y. +config ARM64_PSEUDO_NMI + bool "Support for NMI-like interrupts" + select CONFIG_ARM_GIC_V3 + help + Adds support for mimicking Non-Maskable Interrupts through the use of + GIC interrupt priority. This support requires version 3 or later of + Arm GIC. + + This high priority configuration for interrupts need to be + explicitly enabled through the new kernel parameter + "enable_pseudo_nmi". + + If unsure, say N + menuconfig ARMV8_DEPRECATED bool "Emulate deprecated/obsolete ARMv8 instructions" depends on COMPAT diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index b78205a..7f03f0b 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1149,10 +1149,19 @@ static void cpu_clear_disr(const struct arm64_cpu_capabilities *__unused) #endif /* CONFIG_ARM64_RAS_EXTN */ #ifdef CONFIG_ARM64_PSEUDO_NMI +static bool enable_pseudo_nmi; + +static int __init early_enable_pseudo_nmi(char *p) +{ + enable_pseudo_nmi = true; + return 0; +} +early_param("enable_pseudo_nmi", early_enable_pseudo_nmi); + static bool can_use_gic_priorities(const struct arm64_cpu_capabilities *entry, int scope) { - return false; + return enable_pseudo_nmi && has_useable_gicv3_cpuif(entry, scope); } #endif -- 1.9.1