Dave Jones 046ffa1
Occasionally we see reports of page table corruption, and it's not clear why.
Dave Jones 046ffa1
By printing out the hardware name, we could potentially see some patterns.
Dave Jones 046ffa1
Dave Jones 046ffa1
Signed-off-by: Dave Jones <davej@redhat.com>
Dave Jones 046ffa1
54cd486
--- linux.orig/include/asm-generic/bug.h
54cd486
+++ linux/include/asm-generic/bug.h
Dave Jones 77c62fd
@@ -55,6 +55,8 @@ struct bug_entry {
Dave Jones 77c62fd
 #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
Dave Jones 77c62fd
 #endif
Dave Jones 77c62fd
 
Dave Jones 77c62fd
+void print_hardware_dmi_name(void);
Dave Jones 77c62fd
+
Dave Jones 77c62fd
 /*
Dave Jones 77c62fd
  * WARN(), WARN_ON(), WARN_ON_ONCE, and so on can be used to report
Dave Jones 77c62fd
  * significant issues that need prompt attention if they should ever
54cd486
--- linux.orig/kernel/panic.c
54cd486
+++ linux/kernel/panic.c
54cd486
@@ -391,6 +391,15 @@ void oops_exit(void)
54cd486
 	kmsg_dump(KMSG_DUMP_OOPS);
54cd486
 }
Dave Jones 77c62fd
 
Dave Jones 77c62fd
+void print_hardware_dmi_name(void)
54cd486
+{
54cd486
+	const char *board;
54cd486
+
54cd486
+	board = dmi_get_system_info(DMI_PRODUCT_NAME);
54cd486
+	if (board)
54cd486
+		printk(KERN_WARNING "Hardware name: %s\n", board);
Dave Jones 77c62fd
+}
Dave Jones 77c62fd
+
54cd486
 #ifdef WANT_WARN_ON_SLOWPATH
54cd486
 struct slowpath_args {
54cd486
 	const char *fmt;
54cd486
@@ -400,13 +409,10 @@ struct slowpath_args {
54cd486
 static void warn_slowpath_common(const char *file, int line, void *caller,
54cd486
 				 unsigned taint, struct slowpath_args *args)
54cd486
 {
54cd486
-	const char *board;
54cd486
-
54cd486
 	printk(KERN_WARNING "------------[ cut here ]------------\n");
54cd486
 	printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
54cd486
-	board = dmi_get_system_info(DMI_PRODUCT_NAME);
54cd486
-	if (board)
54cd486
-		printk(KERN_WARNING "Hardware name: %s\n", board);
Dave Jones 77c62fd
+
Dave Jones 77c62fd
+	print_hardware_dmi_name();
Dave Jones 77c62fd
 
Dave Jones 77c62fd
 	if (args)
Dave Jones 77c62fd
 		vprintk(args->fmt, args->args);
54cd486
--- linux.orig/mm/memory.c
54cd486
+++ linux/mm/memory.c
54cd486
@@ -706,6 +706,8 @@ static void print_bad_pte(struct vm_area
Dave Jones 77c62fd
 		"BUG: Bad page map in process %s  pte:%08llx pmd:%08llx\n",
Dave Jones 77c62fd
 		current->comm,
Dave Jones 77c62fd
 		(long long)pte_val(pte), (long long)pmd_val(*pmd));
Dave Jones 77c62fd
+	print_hardware_dmi_name();
Dave Jones 77c62fd
+
Dave Jones 77c62fd
 	if (page)
Dave Jones 77c62fd
 		dump_page(page);
Dave Jones 77c62fd
 	printk(KERN_ALERT
54cd486
--- linux.orig/mm/page_alloc.c
54cd486
+++ linux/mm/page_alloc.c
Dave Jones 77c62fd
@@ -321,6 +321,7 @@ static void bad_page(struct page *page)
Dave Jones 77c62fd
 		current->comm, page_to_pfn(page));
Dave Jones 77c62fd
 	dump_page(page);
Dave Jones 77c62fd
 
Dave Jones 77c62fd
+	print_hardware_dmi_name();
Dave Jones 77c62fd
 	print_modules();
Dave Jones 77c62fd
 	dump_stack();
Dave Jones 77c62fd
 out: