Skip to contentSkip to conversation

x86/fixmap: Set the debugstore fixmap entries on Intel only

PATCH New Borislav Petkov 1 participant 1 message Dec 15, 2017 x86

lore
Share & tools
lore

Borislav Petkov

author maintainer
#0 lore raw

PATCH 1/1 x86/fixmap: Set the debugstore fixmap entries on Intel only

From: Borislav Petkov <[email protected]>

No need to setup those during boot on !Intel vendors.

Cc Linus Torvalds <[email protected]>
Cc Andy Lutomirsky <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Greg KH <[email protected]>
Cc Brian Gerst <[email protected]>
Cc Josh Poimboeuf <[email protected]>
Cc Denys Vlasenko <[email protected]>
Cc Boris Ostrovsky <[email protected]>
Cc Juergen Gross <[email protected]>
Cc David Laight <[email protected]>
Cc Eduardo Valentin <[email protected]>
Cc Will Deacon <[email protected]>
---
 arch/x86/kernel/cpu/common.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
arch/x86/kernel/cpu/common.c +10 -6
index 7b2988e521a7..bca5570d40bc 100644
@@ -582,12 +582,16 @@ static void __init setup_cpu_entry_area(int cpu)
 
 #ifdef CONFIG_CPU_SUP_INTEL
 	BUILD_BUG_ON(sizeof(struct debug_store) % PAGE_SIZE != 0);
-	set_percpu_fixmap_pages(get_cpu_entry_area_index(cpu, cpu_debug_store),
-				&per_cpu(cpu_debug_store, cpu),
-				sizeof(struct debug_store) / PAGE_SIZE,
-				PAGE_KERNEL);
-	set_percpu_fixmap_ptes(get_cpu_entry_area_index(cpu, cpu_debug_buffers),
-			       sizeof(struct debug_store_buffers) / PAGE_SIZE);
+
+	if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
+		set_percpu_fixmap_pages(get_cpu_entry_area_index(cpu, cpu_debug_store),
+					&per_cpu(cpu_debug_store, cpu),
+					sizeof(struct debug_store) / PAGE_SIZE,
+					PAGE_KERNEL);
+
+		set_percpu_fixmap_ptes(get_cpu_entry_area_index(cpu, cpu_debug_buffers),
+				       sizeof(struct debug_store_buffers) / PAGE_SIZE);
+	}
 #endif
 	set_percpu_fixmap_ptes(get_cpu_entry_area_index(cpu, ldt_entries),
 			       (LDT_ENTRIES * LDT_ENTRY_SIZE) / PAGE_SIZE);
Signature · 1 line
2.13.0