public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: amd k6-2 mtrr not detected fix
@ 2008-08-31 13:58 Krzysztof Helt
  2008-08-31 14:53 ` H. Peter Anvin
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Helt @ 2008-08-31 13:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: hpa, tglx, mingo

From: Krzysztof Helt <krzysztof.h1@wp.pl>

The AMD K6-2 cpus have 2 mtrr registers 
which are not detected by the latest Linux
kernel.
The mtrr capability is not reported through
the cpuid on these cpus. This fools early
detection function [mtrr_bp_init()] as the
mtrr capability bit is set later in
the init_amd() function.
Fix it by setting the K6 mtrr capability bit
just before the check in mtrr_bp_init().
The added condition is copied from the init_amd().

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
---

It seems that the same problem affects Cyrix and
Centaur/VIA cpus. Can some x86 guy inspect the
mtrr initialization code ?

 arch/x86/kernel/cpu/mtrr/main.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index 58ac5d3..4bef914 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -1612,6 +1612,12 @@ void __init mtrr_bp_init(void)
 	} else {
 		switch (boot_cpu_data.x86_vendor) {
 		case X86_VENDOR_AMD:
+			if (boot_cpu_data.x86_model == 13 ||
+			    boot_cpu_data.x86_model == 9 ||
+			    (boot_cpu_data.x86_model == 8 &&
+			     boot_cpu_data.x86_mask >= 8))
+				set_cpu_cap(&boot_cpu_data,
+					    X86_FEATURE_K6_MTRR);
 			if (cpu_has_k6_mtrr) {
 				/* Pre-Athlon (K6) AMD CPU MTRRs */
 				mtrr_if = mtrr_ops[X86_VENDOR_AMD];
-- 
1.5.2.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: amd k6-2 mtrr not detected fix
  2008-08-31 13:58 [PATCH] x86: amd k6-2 mtrr not detected fix Krzysztof Helt
@ 2008-08-31 14:53 ` H. Peter Anvin
  2008-09-01  3:45   ` Yinghai Lu
  0 siblings, 1 reply; 3+ messages in thread
From: H. Peter Anvin @ 2008-08-31 14:53 UTC (permalink / raw)
  To: Krzysztof Helt; +Cc: linux-kernel, tglx, mingo

Krzysztof Helt wrote:
> 
> It seems that the same problem affects Cyrix and
> Centaur/VIA cpus. Can some x86 guy inspect the
> mtrr initialization code ?
> 

*GROAN*

I would prefer if we could move the CPU detection code before the MTRR 
code; I don't think there is an inherent reason why we shouldn't be able 
to.  It would be much preferrable to scattering all kinds of CPU 
detection information all over the system.

I am going to be away today so I can't look at this myself until 
tomorrow at the earliest (tomorrow is a holiday here, though, so I can't 
promise I'll be around then either.)

	-hpa

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: amd k6-2 mtrr not detected fix
  2008-08-31 14:53 ` H. Peter Anvin
@ 2008-09-01  3:45   ` Yinghai Lu
  0 siblings, 0 replies; 3+ messages in thread
From: Yinghai Lu @ 2008-09-01  3:45 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Krzysztof Helt, linux-kernel, tglx, mingo

On Sun, Aug 31, 2008 at 7:53 AM, H. Peter Anvin <hpa@zytor.com> wrote:
> Krzysztof Helt wrote:
>>
>> It seems that the same problem affects Cyrix and
>> Centaur/VIA cpus. Can some x86 guy inspect the
>> mtrr initialization code ?
>>
>
> *GROAN*
>
> I would prefer if we could move the CPU detection code before the MTRR code;
> I don't think there is an inherent reason why we shouldn't be able to.  It
> would be much preferrable to scattering all kinds of CPU detection
> information all over the system.
>
> I am going to be away today so I can't look at this myself until tomorrow at
> the earliest (tomorrow is a holiday here, though, so I can't promise I'll be
> around then either.)
>
will send one for Helt to test it...

YH

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-01  3:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-31 13:58 [PATCH] x86: amd k6-2 mtrr not detected fix Krzysztof Helt
2008-08-31 14:53 ` H. Peter Anvin
2008-09-01  3:45   ` Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox