Commit 73fa1362 authored by Ingo Molnar's avatar Ingo Molnar

Merge branch 'x86/cpu' into x86/mm, before applying dependent patch

Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents fdd3d8ce 6415813b
...@@ -80,7 +80,7 @@ extern u16 __read_mostly tlb_lld_1g[NR_INFO]; ...@@ -80,7 +80,7 @@ extern u16 __read_mostly tlb_lld_1g[NR_INFO];
/* /*
* CPU type and hardware bug flags. Kept separately for each CPU. * CPU type and hardware bug flags. Kept separately for each CPU.
* Members of this structure are referenced in head.S, so think twice * Members of this structure are referenced in head_32.S, so think twice
* before touching them. [mj] * before touching them. [mj]
*/ */
...@@ -89,14 +89,7 @@ struct cpuinfo_x86 { ...@@ -89,14 +89,7 @@ struct cpuinfo_x86 {
__u8 x86_vendor; /* CPU vendor */ __u8 x86_vendor; /* CPU vendor */
__u8 x86_model; __u8 x86_model;
__u8 x86_mask; __u8 x86_mask;
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_64
char wp_works_ok; /* It doesn't on 386's */
/* Problems on some 486Dx4's and old 386's: */
char rfu;
char pad0;
char pad1;
#else
/* Number of 4K pages in DTLB/ITLB combined(in pages): */ /* Number of 4K pages in DTLB/ITLB combined(in pages): */
int x86_tlbsize; int x86_tlbsize;
#endif #endif
......
...@@ -31,14 +31,13 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c) ...@@ -31,14 +31,13 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
"fpu\t\t: %s\n" "fpu\t\t: %s\n"
"fpu_exception\t: %s\n" "fpu_exception\t: %s\n"
"cpuid level\t: %d\n" "cpuid level\t: %d\n"
"wp\t\t: %s\n", "wp\t\t: yes\n",
static_cpu_has_bug(X86_BUG_FDIV) ? "yes" : "no", static_cpu_has_bug(X86_BUG_FDIV) ? "yes" : "no",
static_cpu_has_bug(X86_BUG_F00F) ? "yes" : "no", static_cpu_has_bug(X86_BUG_F00F) ? "yes" : "no",
static_cpu_has_bug(X86_BUG_COMA) ? "yes" : "no", static_cpu_has_bug(X86_BUG_COMA) ? "yes" : "no",
static_cpu_has(X86_FEATURE_FPU) ? "yes" : "no", static_cpu_has(X86_FEATURE_FPU) ? "yes" : "no",
static_cpu_has(X86_FEATURE_FPU) ? "yes" : "no", static_cpu_has(X86_FEATURE_FPU) ? "yes" : "no",
c->cpuid_level, c->cpuid_level);
c->wp_works_ok ? "yes" : "no");
} }
#else #else
static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c) static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
......
...@@ -173,14 +173,11 @@ static struct resource bss_resource = { ...@@ -173,14 +173,11 @@ static struct resource bss_resource = {
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
/* cpu data as detected by the assembly code in head.S */ /* cpu data as detected by the assembly code in head_32.S */
struct cpuinfo_x86 new_cpu_data = { struct cpuinfo_x86 new_cpu_data;
.wp_works_ok = -1,
};
/* common cpu data for all cpus */ /* common cpu data for all cpus */
struct cpuinfo_x86 boot_cpu_data __read_mostly = { struct cpuinfo_x86 boot_cpu_data __read_mostly;
.wp_works_ok = -1,
};
EXPORT_SYMBOL(boot_cpu_data); EXPORT_SYMBOL(boot_cpu_data);
unsigned int def_to_bigsmp; unsigned int def_to_bigsmp;
......
...@@ -726,15 +726,17 @@ void __init paging_init(void) ...@@ -726,15 +726,17 @@ void __init paging_init(void)
*/ */
static void __init test_wp_bit(void) static void __init test_wp_bit(void)
{ {
int wp_works_ok;
printk(KERN_INFO printk(KERN_INFO
"Checking if this processor honours the WP bit even in supervisor mode..."); "Checking if this processor honours the WP bit even in supervisor mode...");
/* Any page-aligned address will do, the test is non-destructive */ /* Any page-aligned address will do, the test is non-destructive */
__set_fixmap(FIX_WP_TEST, __pa(&swapper_pg_dir), PAGE_KERNEL_RO); __set_fixmap(FIX_WP_TEST, __pa(&swapper_pg_dir), PAGE_KERNEL_RO);
boot_cpu_data.wp_works_ok = do_test_wp_bit(); wp_works_ok = do_test_wp_bit();
clear_fixmap(FIX_WP_TEST); clear_fixmap(FIX_WP_TEST);
if (!boot_cpu_data.wp_works_ok) { if (!wp_works_ok) {
printk(KERN_CONT "No.\n"); printk(KERN_CONT "No.\n");
panic("Linux doesn't support CPUs with broken WP."); panic("Linux doesn't support CPUs with broken WP.");
} else { } else {
...@@ -821,8 +823,7 @@ void __init mem_init(void) ...@@ -821,8 +823,7 @@ void __init mem_init(void)
BUG_ON(VMALLOC_START >= VMALLOC_END); BUG_ON(VMALLOC_START >= VMALLOC_END);
BUG_ON((unsigned long)high_memory > VMALLOC_START); BUG_ON((unsigned long)high_memory > VMALLOC_START);
if (boot_cpu_data.wp_works_ok < 0) test_wp_bit();
test_wp_bit();
} }
#ifdef CONFIG_MEMORY_HOTPLUG #ifdef CONFIG_MEMORY_HOTPLUG
......
...@@ -1595,7 +1595,6 @@ asmlinkage __visible void __init xen_start_kernel(void) ...@@ -1595,7 +1595,6 @@ asmlinkage __visible void __init xen_start_kernel(void)
/* set up basic CPUID stuff */ /* set up basic CPUID stuff */
cpu_detect(&new_cpu_data); cpu_detect(&new_cpu_data);
set_cpu_cap(&new_cpu_data, X86_FEATURE_FPU); set_cpu_cap(&new_cpu_data, X86_FEATURE_FPU);
new_cpu_data.wp_works_ok = 1;
new_cpu_data.x86_capability[CPUID_1_EDX] = cpuid_edx(1); new_cpu_data.x86_capability[CPUID_1_EDX] = cpuid_edx(1);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment