[PATCH 1/3] x86/mm/pti: Fix 32 bit PCID check
From: Joerg Roedel
Date: Tue Aug 07 2018 - 06:24:50 EST
From: Joerg Roedel <jroedel@xxxxxxx>
The check uses the wrong operator and causes false positive
warnings in the kernel log on some systems.
Fixes: 5e8105950a8b3 ('x86/mm/pti: Add Warning when booting on a PCID capable CPU')
Signed-off-by: Joerg Roedel <jroedel@xxxxxxx>
---
arch/x86/mm/pti.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c
index ef8db6f..113ba14 100644
--- a/arch/x86/mm/pti.c
+++ b/arch/x86/mm/pti.c
@@ -549,7 +549,7 @@ void __init pti_init(void)
* supported on 32 bit anyway. To print the warning we need to
* check with cpuid directly again.
*/
- if (cpuid_ecx(0x1) && BIT(17)) {
+ if (cpuid_ecx(0x1) & BIT(17)) {
/* Use printk to work around pr_fmt() */
printk(KERN_WARNING "\n");
printk(KERN_WARNING "************************************************************\n");
--
2.7.4