Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6361685imu; Mon, 21 Jan 2019 07:37:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN6piPmUO34rZHH3483WHCoA+JdprX/bGK0A/7UYW3F23RR4wExKDBehY85vJOrxskDaiBAD X-Received: by 2002:a63:c42:: with SMTP id 2mr28641620pgm.372.1548085062069; Mon, 21 Jan 2019 07:37:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548085062; cv=none; d=google.com; s=arc-20160816; b=ykpLsLr32M65NB4qzbrxDicdhQJoYzmvhqeYPIMPr7BoXW38etgEyT8f/h3ItroZeY SNdZD5pNsoImjWrMbvVDRWwDM9aQLSJ0AVY1k8Nj3GdEZHUPF5pjG2YzWdjkbqEKV64v x3iKdFEavNS9mun3BEUFZuGgtDBlITQadsJs3h7z3U+/WxH6V4iecxJwDFs51afJh4Mv CKbnvnx7bEDVNKSAdlHdwWxagiIppApgx/TbIZieSRjKJRPYJMtL9zbbAp575+Xq9LeI uCSK4Y/JbyZb3a8MgQZAxtYA1wb6lHVmkq03irufFb2ZytBXAluZUASEJt2GaqoBTcei EtwA== 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=1yI1N/xPVx5xrd/X7U3Uz8lpA9zwF9XDXj//pCLjN/0=; b=uPlzm0VL99qrghDD9RdM+/+GZDv+gy08k3s27GmWvkGwiThK6iB4QN2jgbA1jHk5Sw sOiiyKQC4cqateBsQDkTA1XemNKokfVSUieGqjhOTYWyYhsGdnWj4+keQhFqxbRWkok2 qD5XsAGks2OOtTMvhqjs6DVd33JlY2RML2kUd9/sw5um1E774hfBq1lc+EgFXf6HpnCI x8TWb/7zEQ4GUD5D0jgDzB52CT7vvShYtB6E1ySqz8v2W6He+2bla/o4RSpxYk0H0LXO 2aHBCgSr9fbxg9u6NjHuRR1bC9+Ygz37wC0R8WzwkAKS82SKzDXq4vGVA0PxhJ7o2D+n T77Q== 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 g1si12742369pgu.149.2019.01.21.07.37.26; Mon, 21 Jan 2019 07:37:42 -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 S1730027AbfAUPfI (ORCPT + 99 others); Mon, 21 Jan 2019 10:35:08 -0500 Received: from foss.arm.com ([217.140.101.70]:36714 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730564AbfAUPfC (ORCPT ); Mon, 21 Jan 2019 10:35:02 -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 51DEA15BE; Mon, 21 Jan 2019 07:35:02 -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 57AD63F5C1; Mon, 21 Jan 2019 07:35:00 -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 v9 26/26] arm64: Enable the support of pseudo-NMIs Date: Mon, 21 Jan 2019 15:33:45 +0000 Message-Id: <1548084825-8803-27-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1548084825-8803-1-git-send-email-julien.thierry@arm.com> References: <1548084825-8803-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 b799bcf..173e2cc 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1197,6 +1197,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 a4168d3..8d84bfd 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1328,6 +1328,20 @@ config ARM64_MODULE_PLTS bool select HAVE_MOD_ARCH_SPECIFIC +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 + config RELOCATABLE bool help diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index b530fb24..e66d778 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1207,10 +1207,19 @@ static void cpu_enable_address_auth(struct arm64_cpu_capabilities const *cap) #endif /* CONFIG_ARM64_PTR_AUTH */ #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