Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86, cpu: Preset default tlb_flushall_shift on AMD

Run the mprotect.c microbenchmark on all our families >= K8 and preset
the flushall shift variable accordingly.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Link: http://lkml.kernel.org/r/1344272439-29080-5-git-send-email-bp@amd64.org
Signed-off-by: H. Peter Anvin <hpa@zytor.com>

authored by

Borislav Petkov and committed by
H. Peter Anvin
057237bb b46882e4

+13
+13
arch/x86/kernel/cpu/amd.c
··· 737 737 } 738 738 #endif 739 739 740 + static void __cpuinit cpu_set_tlb_flushall_shift(struct cpuinfo_x86 *c) 741 + { 742 + if (!cpu_has_invlpg) 743 + return; 744 + 745 + tlb_flushall_shift = 5; 746 + 747 + if (c->x86 <= 0x11) 748 + tlb_flushall_shift = 4; 749 + } 750 + 740 751 static void __cpuinit cpu_detect_tlb_amd(struct cpuinfo_x86 *c) 741 752 { 742 753 u32 ebx, eax, ecx, edx; ··· 799 788 tlb_lli_2m[ENTRIES] = eax & mask; 800 789 801 790 tlb_lli_4m[ENTRIES] = tlb_lli_2m[ENTRIES] >> 1; 791 + 792 + cpu_set_tlb_flushall_shift(c); 802 793 } 803 794 804 795 static const struct cpu_dev __cpuinitconst amd_cpu_dev = {