x86/mm/pti: Fix 32 bit PCID check
authorJoerg Roedel <jroedel@suse.de>
Tue, 7 Aug 2018 10:24:29 +0000 (12:24 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 7 Aug 2018 16:51:22 +0000 (18:51 +0200)
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@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "H . Peter Anvin" <hpa@zytor.com>
Cc: linux-mm@kvack.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: David Laight <David.Laight@aculab.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Eduardo Valentin <eduval@amazon.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: aliguori@amazon.com
Cc: daniel.gruss@iaik.tugraz.at
Cc: hughd@google.com
Cc: keescook@google.com
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Waiman Long <llong@redhat.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: "David H . Gutteridge" <dhgutteridge@sympatico.ca>
Cc: joro@8bytes.org
Link: https://lkml.kernel.org/r/1533637471-30953-2-git-send-email-joro@8bytes.org
arch/x86/mm/pti.c

index ef8db6ffc836e6cf26d26c6e60be00604e76b90e..113ba14a03d85991bdc015a2d32b4be02833608b 100644 (file)
@@ -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");