-
- Downloads
x86: Store a per-cpu shadow copy of CR4
Context switches and TLB flushes can change individual bits of CR4. CR4 reads take several cycles, so store a shadow copy of CR4 in a per-cpu variable. To avoid wasting a cache line, I added the CR4 shadow to cpu_tlbstate, which is already touched in switch_mm. The heaviest users of the cr4 shadow will be switch_mm and __switch_to_xtra, and __switch_to_xtra is called shortly after switch_mm during context switch, so the cacheline is likely to be hot. Signed-off-by:Andy Lutomirski <luto@amacapital.net> Reviewed-by:
Thomas Gleixner <tglx@linutronix.de> Signed-off-by:
Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Kees Cook <keescook@chromium.org> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Vince Weaver <vince@deater.net> Cc: "hillf.zj" <hillf.zj@alibaba-inc.com> Cc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/3a54dd3353fffbf84804398e00dfdc5b7c1afd7d.1414190806.git.luto@amacapital.net Signed-off-by:
Ingo Molnar <mingo@kernel.org>
Showing
- arch/x86/include/asm/paravirt.h 3 additions, 3 deletionsarch/x86/include/asm/paravirt.h
- arch/x86/include/asm/special_insns.h 3 additions, 3 deletionsarch/x86/include/asm/special_insns.h
- arch/x86/include/asm/tlbflush.h 39 additions, 13 deletionsarch/x86/include/asm/tlbflush.h
- arch/x86/include/asm/virtext.h 1 addition, 1 deletionarch/x86/include/asm/virtext.h
- arch/x86/kernel/acpi/sleep.c 1 addition, 1 deletionarch/x86/kernel/acpi/sleep.c
- arch/x86/kernel/cpu/common.c 7 additions, 0 deletionsarch/x86/kernel/cpu/common.c
- arch/x86/kernel/cpu/mtrr/cyrix.c 3 additions, 3 deletionsarch/x86/kernel/cpu/mtrr/cyrix.c
- arch/x86/kernel/cpu/mtrr/generic.c 3 additions, 3 deletionsarch/x86/kernel/cpu/mtrr/generic.c
- arch/x86/kernel/head32.c 1 addition, 0 deletionsarch/x86/kernel/head32.c
- arch/x86/kernel/head64.c 2 additions, 0 deletionsarch/x86/kernel/head64.c
- arch/x86/kernel/process_32.c 1 addition, 1 deletionarch/x86/kernel/process_32.c
- arch/x86/kernel/process_64.c 1 addition, 1 deletionarch/x86/kernel/process_64.c
- arch/x86/kernel/setup.c 1 addition, 1 deletionarch/x86/kernel/setup.c
- arch/x86/kvm/svm.c 1 addition, 1 deletionarch/x86/kvm/svm.c
- arch/x86/kvm/vmx.c 3 additions, 3 deletionsarch/x86/kvm/vmx.c
- arch/x86/mm/fault.c 1 addition, 1 deletionarch/x86/mm/fault.c
- arch/x86/mm/init.c 9 additions, 0 deletionsarch/x86/mm/init.c
- arch/x86/mm/tlb.c 0 additions, 3 deletionsarch/x86/mm/tlb.c
- arch/x86/power/cpu.c 4 additions, 7 deletionsarch/x86/power/cpu.c
- arch/x86/realmode/init.c 1 addition, 1 deletionarch/x86/realmode/init.c
Loading