Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCH 2/4] x86, CPU: Extend TLB size detection for AMD

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


bp at amd64

Aug 3, 2012, 9:37 AM

Post #1 of 3 (50 views)
Permalink
[PATCH 2/4] x86, CPU: Extend TLB size detection for AMD

From: Borislav Petkov <borislav.petkov [at] amd>

TLB characteristics on AMD are in the extended CPUID level, leafs
0x8000000{5,6} so we need to check those before doing the detection.

Signed-off-by: Borislav Petkov <borislav.petkov [at] amd>
---
arch/x86/kernel/cpu/common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index d239977f361f..ebab0e77e691 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -940,7 +940,8 @@ void __init identify_boot_cpu(void)
#else
vgetcpu_set_mode();
#endif
- if (boot_cpu_data.cpuid_level >= 2)
+ if (boot_cpu_data.cpuid_level >= 2 ||
+ boot_cpu_data.extended_cpuid_level >= 0x80000006)
cpu_detect_tlb(&boot_cpu_data);
}

--
1.7.11.rc1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


hpa at zytor

Aug 3, 2012, 11:32 AM

Post #2 of 3 (44 views)
Permalink
Re: [PATCH 2/4] x86, CPU: Extend TLB size detection for AMD [In reply to]

On 08/03/2012 09:37 AM, Borislav Petkov wrote:
> From: Borislav Petkov <borislav.petkov [at] amd>
>
> TLB characteristics on AMD are in the extended CPUID level, leafs
> 0x8000000{5,6} so we need to check those before doing the detection.
>
> Signed-off-by: Borislav Petkov <borislav.petkov [at] amd>
> ---
> arch/x86/kernel/cpu/common.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index d239977f361f..ebab0e77e691 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -940,7 +940,8 @@ void __init identify_boot_cpu(void)
> #else
> vgetcpu_set_mode();
> #endif
> - if (boot_cpu_data.cpuid_level >= 2)
> + if (boot_cpu_data.cpuid_level >= 2 ||
> + boot_cpu_data.extended_cpuid_level >= 0x80000006)
> cpu_detect_tlb(&boot_cpu_data);
> }
>

This really belongs in cpu_detect_tlb() itself (or rather, in the
subfunctions called by it.) Can we just lose the general test here, please?

-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


bp at amd64

Aug 6, 2012, 8:39 AM

Post #3 of 3 (43 views)
Permalink
Re: [PATCH 2/4] x86, CPU: Extend TLB size detection for AMD [In reply to]

On Fri, Aug 03, 2012 at 11:32:51AM -0700, H. Peter Anvin wrote:
> > - if (boot_cpu_data.cpuid_level >= 2)
> > + if (boot_cpu_data.cpuid_level >= 2 ||
> > + boot_cpu_data.extended_cpuid_level >= 0x80000006)
> > cpu_detect_tlb(&boot_cpu_data);
>
> This really belongs in cpu_detect_tlb() itself (or rather, in the
> subfunctions called by it.) Can we just lose the general test here,
> please?

Sure, will resend in a bit.

--
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.