From: Xu Qiang xuqiang36@huawei.com
ascend inclusion category: feature bugzilla: NA CVE: NA
---------------------------------------
For Ascend platform,automatically opens enable_pseudo_nmi and pmu_nmi_enable.
Signed-off-by: Xu Qiang xuqiang36@huawei.com Reviewed-by: Ding Tianhong dingtianhong@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- arch/arm64/include/asm/cpufeature.h | 4 ++++ arch/arm64/kernel/cpufeature.c | 2 +- arch/arm64/mm/init.c | 12 +++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h index e2637094ca6f..48f3da8996b0 100644 --- a/arch/arm64/include/asm/cpufeature.h +++ b/arch/arm64/include/asm/cpufeature.h @@ -84,6 +84,10 @@ extern struct arm64_ftr_reg arm64_ftr_reg_ctrel0;
int arm64_cpu_ftr_regs_traverse(int (*op)(u32, u64, void *), void *argp);
+#ifdef CONFIG_ARM64_PSEUDO_NMI +extern bool enable_pseudo_nmi; +#endif + /* * CPU capabilities: * diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 80d0e8bb0d10..c7b17e0e3e32 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1363,7 +1363,7 @@ static void cpu_enable_e0pd(struct arm64_cpu_capabilities const *cap) #endif /* CONFIG_ARM64_E0PD */
#ifdef CONFIG_ARM64_PSEUDO_NMI -static bool enable_pseudo_nmi; +bool enable_pseudo_nmi;
static int __init early_enable_pseudo_nmi(char *p) { diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index f23da539a476..a6b9048ea1a4 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -769,6 +769,9 @@ __setup("keepinitrd", keepinitrd_setup); #endif
#ifdef CONFIG_ASCEND_FEATURES + +#include <linux/perf/arm_pmu.h> + void ascend_enable_all_features(void) { if (IS_ENABLED(CONFIG_ASCEND_DVPP_MMAP)) @@ -782,6 +785,13 @@ void ascend_enable_all_features(void)
if (IS_ENABLED(CONFIG_SUSPEND)) mem_sleep_current = PM_SUSPEND_ON; + + if (IS_ENABLED(CONFIG_PMU_WATCHDOG)) + pmu_nmi_enable = true; + +#ifdef CONFIG_ARM64_PSEUDO_NMI + enable_pseudo_nmi = true; +#endif }
static int __init ascend_enable_setup(char *__unused) @@ -791,7 +801,7 @@ static int __init ascend_enable_setup(char *__unused) return 1; }
-__setup("ascend_enable_all", ascend_enable_setup); +early_param("ascend_enable_all", ascend_enable_setup); #endif