aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/dumpstack.c
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2017-12-19 16:33:46 -0500
committerIngo Molnar <mingo@kernel.org>2017-12-23 15:13:01 -0500
commit5f26d76c3fd67c48806415ef8b1116c97beff8ba (patch)
tree8ea8b98c3aa74d702923351d0d5e42c95278c36b /arch/x86/kernel/dumpstack.c
parent0a126abd576ebc6403f063dbe20cf7416c9d9393 (diff)
x86/dumpstack: Indicate in Oops whether PTI is configured and enabled
CONFIG_PAGE_TABLE_ISOLATION is relatively new and intrusive feature that may still have some corner cases which could take some time to manifest and be fixed. It would be useful to have Oops messages indicate whether it was enabled for building the kernel, and whether it was disabled during boot. Example of fully enabled: Oops: 0001 [#1] SMP PTI Example of enabled during build, but disabled during boot: Oops: 0001 [#1] SMP NOPTI We can decide to remove this after the feature has been tested in the field long enough. [ tglx: Made it use boot_cpu_has() as requested by Borislav ] Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Eduardo Valentin <eduval@amazon.com> Acked-by: Dave Hansen <dave.hansen@intel.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Andy Lutomirsky <luto@kernel.org> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: David Laight <David.Laight@aculab.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: Greg KH <gregkh@linuxfoundation.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Juergen Gross <jgross@suse.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Will Deacon <will.deacon@arm.com> Cc: aliguori@amazon.com Cc: bpetkov@suse.de Cc: daniel.gruss@iaik.tugraz.at Cc: hughd@google.com Cc: jkosina@suse.cz Cc: keescook@google.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/dumpstack.c')
-rw-r--r--arch/x86/kernel/dumpstack.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 36b17e0febe8..5fa110699ed2 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -297,11 +297,13 @@ int __die(const char *str, struct pt_regs *regs, long err)
297 unsigned long sp; 297 unsigned long sp;
298#endif 298#endif
299 printk(KERN_DEFAULT 299 printk(KERN_DEFAULT
300 "%s: %04lx [#%d]%s%s%s%s\n", str, err & 0xffff, ++die_counter, 300 "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, ++die_counter,
301 IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "", 301 IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "",
302 IS_ENABLED(CONFIG_SMP) ? " SMP" : "", 302 IS_ENABLED(CONFIG_SMP) ? " SMP" : "",
303 debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", 303 debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "",
304 IS_ENABLED(CONFIG_KASAN) ? " KASAN" : ""); 304 IS_ENABLED(CONFIG_KASAN) ? " KASAN" : "",
305 IS_ENABLED(CONFIG_PAGE_TABLE_ISOLATION) ?
306 (boot_cpu_has(X86_FEATURE_PTI) ? " PTI" : " NOPTI") : "");
305 307
306 if (notify_die(DIE_OOPS, str, regs, err, 308 if (notify_die(DIE_OOPS, str, regs, err,
307 current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP) 309 current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP)