diff options
author | Andi Kleen <ak@suse.de> | 2005-04-16 18:25:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:25:10 -0400 |
commit | 1f2c958ad51fed18b23558e2047b98dfa752e689 (patch) | |
tree | a82d8c45c10498dad5b7e2187b842c0e76d4490a /arch/i386/kernel/cpu | |
parent | f0de53bbc2118c754ee923516122d91add288582 (diff) |
[PATCH] x86_64: Always use CPUID 80000008 to figure out MTRR address space size
It doesn't make sense to only do this only for AMD K8.
This would support future CPUs with extended address spaces properly.
For i386 and x86-64
Cc: <davej@redhat.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/cpu')
-rw-r--r-- | arch/i386/kernel/cpu/mtrr/main.c | 49 |
1 files changed, 15 insertions, 34 deletions
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c index 8f67b490a7fd..54999e4c55fd 100644 --- a/arch/i386/kernel/cpu/mtrr/main.c +++ b/arch/i386/kernel/cpu/mtrr/main.c | |||
@@ -614,40 +614,21 @@ static int __init mtrr_init(void) | |||
614 | mtrr_if = &generic_mtrr_ops; | 614 | mtrr_if = &generic_mtrr_ops; |
615 | size_or_mask = 0xff000000; /* 36 bits */ | 615 | size_or_mask = 0xff000000; /* 36 bits */ |
616 | size_and_mask = 0x00f00000; | 616 | size_and_mask = 0x00f00000; |
617 | 617 | ||
618 | switch (boot_cpu_data.x86_vendor) { | 618 | /* This is an AMD specific MSR, but we assume(hope?) that |
619 | case X86_VENDOR_AMD: | 619 | Intel will implement it to when they extend the address |
620 | /* The original Athlon docs said that | 620 | bus of the Xeon. */ |
621 | total addressable memory is 44 bits wide. | 621 | if (cpuid_eax(0x80000000) >= 0x80000008) { |
622 | It was not really clear whether its MTRRs | 622 | u32 phys_addr; |
623 | follow this or not. (Read: 44 or 36 bits). | 623 | phys_addr = cpuid_eax(0x80000008) & 0xff; |
624 | However, "x86-64_overview.pdf" explicitly | 624 | size_or_mask = ~((1 << (phys_addr - PAGE_SHIFT)) - 1); |
625 | states that "previous implementations support | 625 | size_and_mask = ~size_or_mask & 0xfff00000; |
626 | 36 bit MTRRs" and also provides a way to | 626 | } else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR && |
627 | query the width (in bits) of the physical | 627 | boot_cpu_data.x86 == 6) { |
628 | addressable memory on the Hammer family. | 628 | /* VIA C* family have Intel style MTRRs, but |
629 | */ | 629 | don't support PAE */ |
630 | if (boot_cpu_data.x86 == 15 | 630 | size_or_mask = 0xfff00000; /* 32 bits */ |
631 | && (cpuid_eax(0x80000000) >= 0x80000008)) { | 631 | size_and_mask = 0; |
632 | u32 phys_addr; | ||
633 | phys_addr = cpuid_eax(0x80000008) & 0xff; | ||
634 | size_or_mask = | ||
635 | ~((1 << (phys_addr - PAGE_SHIFT)) - 1); | ||
636 | size_and_mask = ~size_or_mask & 0xfff00000; | ||
637 | } | ||
638 | /* Athlon MTRRs use an Intel-compatible interface for | ||
639 | * getting and setting */ | ||
640 | break; | ||
641 | case X86_VENDOR_CENTAUR: | ||
642 | if (boot_cpu_data.x86 == 6) { | ||
643 | /* VIA Cyrix family have Intel style MTRRs, but don't support PAE */ | ||
644 | size_or_mask = 0xfff00000; /* 32 bits */ | ||
645 | size_and_mask = 0; | ||
646 | } | ||
647 | break; | ||
648 | |||
649 | default: | ||
650 | break; | ||
651 | } | 632 | } |
652 | } else { | 633 | } else { |
653 | switch (boot_cpu_data.x86_vendor) { | 634 | switch (boot_cpu_data.x86_vendor) { |