[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1531713820-24544-5-git-send-email-jiang.biao2@zte.com.cn>
Date: Mon, 16 Jul 2018 12:03:39 +0800
From: Jiang Biao <jiang.biao2@....com.cn>
To: tglx@...utronix.de, mingo@...hat.com
Cc: dave.hansen@...ux.intel.com, luto@...nel.org, hpa@...or.com,
x86@...nel.org, albcamus@...il.com, linux-kernel@...r.kernel.org,
zhong.weidong@....com.cn, jiang.biao2@....com.cn
Subject: [PATCH 4/5] x86/pti: warn for unknown pti boot options
When using unknown pti boot options other than on/off/auto, we
select auto silently, which is sometimes confusing. Add warning for
unknown pti boot options like we do in
spectre_v2_select_mitigation().
Signed-off-by: Jiang Biao <jiang.biao2@....com.cn>
---
arch/x86/mm/pti.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c
index a76b2cc..a368656 100644
--- a/arch/x86/mm/pti.c
+++ b/arch/x86/mm/pti.c
@@ -92,14 +92,14 @@ void __init pti_check_boottime_disable(void)
pti_mode = PTI_FORCE_OFF;
pti_print_if_insecure("disabled on command line.");
return;
- }
- if (ret == 2 && !strncmp(arg, "on", 2)) {
+ } else if (ret == 2 && !strncmp(arg, "on", 2)) {
pti_mode = PTI_FORCE_ON;
pti_print_if_secure("force enabled on command line.");
goto enable;
- }
- if (ret == 4 && !strncmp(arg, "auto", 4)) {
- pti_mode = PTI_AUTO;
+ } else if (ret == 4 && !strncmp(arg, "auto", 4)) {
+ goto autosel;
+ } else {
+ pr_err("unknown option (%s). Switching to AUTO select\n", arg);
goto autosel;
}
}
--
2.7.4
Powered by blists - more mailing lists