Re: [Fwd: CPU detection revamp (Request for comments)]
Hi hpa,
First test, the AMD K6-2.
Before your patch..
cpu family : 5 model : 8 stepping : 12
After..
cpu family : 5 model : 8 stepping : 4
Line 1826 of setup.c
c->x86_mask = tfms & 7;
Should be..
c->x86_mask = tfms & 15;
I think?
Also, look at the feature flags:
before:
flags : fpu vme de pse tsc msr mce cx8 sep mtrr pge mmx 3dnow
after:
features : fpu vme de pse tsc msr mce cx8 pge mmx syscall 3dnow
Note, I lost MTRR & sep. This may be related to the stepping bug though. I'll recompile a kernel with the &15 fix, and see if that cures all.
btw, whilst all this is getting a shakedown, how about renaming that 'x86_mask' field to the more obvious 'x86_stepping' ? c->x86 would make more sense as c->x86_family too thinking about it.
regards,
Davej.
Signature · 7 lines
| Dave Jones <[email protected]> http://www.suse.de/~davej | SuSE Labs - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] Please read the FAQ at http://www.tux.org/lkml/
Quoted 30 lines · [email protected] wrote:
Hi hpa,
First test, the AMD K6-2.
Before your patch..
cpu family : 5 model : 8 stepping : 12After..
cpu family : 5 model : 8 stepping : 4Line 1826 of
setup.cc->x86_mask = tfms & 7;Should be..
c->x86_mask = tfms & 15;I think?
Also, look at the feature flags:
before:
flags : fpu vme de pse tsc msr mce cx8 sep mtrr pge mmx 3dnow
Quoted 7 lines
after:
features : fpu vme de pse tsc msr mce cx8 pge mmx syscall 3dnowNote, I lost MTRR & sep. This may be related to the stepping bug though. I'll recompile a kernel with the &15 fix, and see if that cures all.
That is actually correct -- the K6-2 doesn't actually have mtrr and sep, but has syscall and k6_mtrr instead (the stepping bug causes k6_mtrr not to show up.) Part of the bugginess of the old system was using one flag for multiple purposes. This was Linux' doing, not AMD's, by the way.
Quoted 4 lines
btw, whilst all this is getting a shakedown, how about renaming that '
x86_mask' field to the more obvious 'x86_stepping' ?c->x86would make more sense asc->x86_familytoo thinking about it.
Signature · 7 lines
<[email protected]> at work, <[email protected]> in private! "Unix gives you enough rope to shoot yourself in the foot." http://www.zytor.com/~hpa/puzzle.txt - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] Please read the FAQ at http://www.tux.org/lkml/
Quoted 9 lines · [email protected] wrote:
Hi hpa,
First test, the AMD K6-2.
Also, look at the feature flags:
before:
flags : fpu vme de pse tsc msr mce cx8 sep mtrr pge mmx 3dnow
Quoted 6 lines
after:
features : fpu vme de pse tsc msr mce cx8 pge mmx syscall 3dnowNote, I lost MTRR & sep. This may be related to the stepping bug though. I'll recompile a kernel with the &15 fix, and see if that cures all.
The K6's don't support sysenter/sysexit. It really should have been marked differently before. The early K6's used extended bit 10 to indicate syscall/sysret capabality, but this version has some quirks that make it pretty much unusable. Later K6's use extended bit 11 to indicate syscall/sysret.
--
Brian Gerst
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
Quoted 3 lines · Brian Gerst
Quoted 1 line
features : fpu vme de pse tsc msr mce cx8 pge mmx syscall 3dnow
The K6's don't support sysenter/sysexit.
The K6 datasheets suggests otherwise.
Some models seem to have sysenter/sysexit, whilst others have syscall/sysret. No model seems to have both.
The datasheets are somewhat confusing, as it doesn't mention bit 10 at all, just an oversized box for bit 11.
Quoted 1 line
It really should have been marked differently before.
Before we weren't mentioning it at all, look..
flags : fpu vme de pse tsc msr mce cx8 sep mtrr pge mmx 3dnow
Quoted 3 lines
The early K6's used extended bit 10 to indicate syscall/sysret capabality, but this version has some quirks that make it pretty much unusable. Later K6's use extended bit 11 to indicate syscall/sysret.
And where does sysenter/sysexit fit in?
regards,
Davej.
Signature · 7 lines
| Dave Jones <[email protected]> http://www.suse.de/~davej | SuSE Labs - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] Please read the FAQ at http://www.tux.org/lkml/
Quoted 4 lines · H. Peter Anvin
That is actually correct -- the K6-2 doesn't actually have mtrr and sep, but has syscall and
k6_mtrrinstead (the stepping bug causesk6_mtrrnot to show up.) Part of the bugginess of the old system was using one flag for multiple purposes. This was Linux' doing, not AMD's, by the way.
Yep, after the c->x86_mask = tfms & 15; change I got the correct stepping, and the flags are now correct:-
features : fpu vme de pse tsc msr mce cx8 pge mmx syscall 3dnow k6_mtrr
regards,
davej.
Signature · 7 lines
| Dave Jones <[email protected]> http://www.suse.de/~davej | SuSE Labs - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] Please read the FAQ at http://www.tux.org/lkml/
Quoted 9 lines · [email protected] wrote:
Quoted 3 lines · Brian Gerst
Quoted 1 line
features : fpu vme de pse tsc msr mce cx8 pge mmx syscall 3dnow
The K6's don't support sysenter/sysexit.
The K6 datasheets suggests otherwise.
Some models seem to have sysenter/sysexit, whilst others have syscall/sysret. No model seems to have both.
Athlons have both. Since the ext-bit 10 stuff is useless, I haven't bothered reporting it at all.
Quoted 5 lines
The datasheets are somewhat confusing, as it doesn't mention bit 10 at all, just an oversized box for bit 11.
Quoted 1 line
It really should have been marked differently before.
Quoted 8 lines
Before we weren't mentioning it at all, look..
flags : fpu vme de pse tsc msr mce cx8 sep mtrr pge mmx 3dnowQuoted 3 lines
The early K6's used extended bit 10 to indicate syscall/sysret capabality, but this version has some quirks that make it pretty much unusable. Later K6's use extended bit 11 to indicate syscall/sysret.
And where does sysenter/sysexit fit in?
sysenter/sysexit is the "sep" feature.
-hpa
Signature · 7 lines
<[email protected]> at work, <[email protected]> in private! "Unix gives you enough rope to shoot yourself in the foot." http://www.zytor.com/~hpa/puzzle.txt - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] Please read the FAQ at http://www.tux.org/lkml/
Quoted 2 lines · H. Peter Anvin
Quoted 1 line
And where does sysenter/sysexit fit in?
sysenter/sysexit is the "sep" feature.
Ah, of course.
*slaps head*
regards,
davej.
Signature · 7 lines
| Dave Jones <[email protected]> http://www.suse.de/~davej | SuSE Labs - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] Please read the FAQ at http://www.tux.org/lkml/
Quoted 5 lines · [email protected] wrote:
Quoted 2 lines · Brian Gerst
Quoted 1 line
features : fpu vme de pse tsc msr mce cx8 pge mmx syscall 3dnow
Quoted 8 lines
Quoted 1 line
The K6's don't support sysenter/sysexit.
The K6 datasheets suggests otherwise.
Some models seem to have sysenter/sysexit, whilst others have syscall/sysret. No model seems to have both.The datasheets are somewhat confusing, as it doesn't mention bit 10 at all, just an oversized box for bit 11.
The Athlons support sysenter and syscall, but the K6's only support syscall. The earlier version of syscall (bit 10) is undocumented by AMD.
--
Brian Gerst
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
Quoted 5 lines · Brian Gerst
Quoted 2 lines
The datasheets are somewhat confusing, as it doesn't mention bit 10 at all, just an oversized box for bit 11.
The Athlons support sysenter and syscall, but the K6's only support syscall. The earlier version of syscall (bit 10) is undocumented by AMD.
Ah, thanks for clearing that up.
regards,
davej.
Signature · 7 lines
| Dave Jones <[email protected]> http://www.suse.de/~davej | SuSE Labs - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] Please read the FAQ at http://www.tux.org/lkml/