Skip to contentSkip to conversation

2.6.26, PAT and AMD family 6

DISCUSSION matthieu castet 1 participant 2 messages May 7, 2008 x86

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines

-- Why does this thing hide the fact that my CPU does have PAT from
me (even though it might elect to not trust it)?

Attach a trivial (untested) patch that should let know that PAT was disabled by kernel.

Matthieu

PS : if you want more tester you should print in this message a link of what should be tested to know if PAT is broken in this machine and where to report it.

arch/x86/kernel/cpu/common.c +4 -0
index 35b4f6a..7560222 100644
@@ -286,6 +286,7 @@ static void __cpuinit early_get_cap(struct cpuinfo_x86 *c)
 {
 	u32 tfms, xlvl;
 	unsigned int ebx;
+	int pat;
 
 	memset(&c->x86_capability, 0, sizeof c->x86_capability);
 	if (have_cpuid_p()) {
@@ -308,6 +309,7 @@ static void __cpuinit early_get_cap(struct cpuinfo_x86 *c)
 
 	}
 
+	pat = cpu_has_pat;
 	clear_cpu_cap(c, X86_FEATURE_PAT);
 
 	switch (c->x86_vendor) {
@@ -320,6 +322,8 @@ static void __cpuinit early_get_cap(struct cpuinfo_x86 *c)
 			set_cpu_cap(c, X86_FEATURE_PAT);
 		break;
 	}
+	if (pat != cpu_has_pat)
+		printk(KERN_INFO "PAT support disabled");
 
 }
 
#1 lore raw
Quoted 5 lines · matthieu castet
Quoted 2 lines

-- Why does this thing hide the fact that my CPU does have PAT from
me (even though it might elect to not trust it)?

Attach a trivial (untested) patch that should let know that PAT was disabled by kernel.

This one should be better

Quoted 4 lines

Matthieu

PS : if you want more tester you should print in this message a link of what should be tested to know if PAT is broken in this machine and where to report it.

arch/x86/kernel/cpu/common.c +4 -0
index 35b4f6a..27be8c2 100644
@@ -286,6 +286,7 @@ static void __cpuinit early_get_cap(struct cpuinfo_x86 *c)
 {
 	u32 tfms, xlvl;
 	unsigned int ebx;
+	int pat;
 
 	memset(&c->x86_capability, 0, sizeof c->x86_capability);
 	if (have_cpuid_p()) {
@@ -308,6 +309,7 @@ static void __cpuinit early_get_cap(struct cpuinfo_x86 *c)
 
 	}
 
+	pat = cpu_has(c, X86_FEATURE_PAT);
 	clear_cpu_cap(c, X86_FEATURE_PAT);
 
 	switch (c->x86_vendor) {
@@ -320,6 +322,8 @@ static void __cpuinit early_get_cap(struct cpuinfo_x86 *c)
 			set_cpu_cap(c, X86_FEATURE_PAT);
 		break;
 	}
+	if (pat != cpu_has(c, X86_FEATURE_PAT))
+		printk(KERN_INFO "PAT support disabled");
 
 }