linux_dsm_epyc7002/arch/x86/include/asm
Andy Lutomirski 1e02ce4ccc 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>
2015-02-04 12:10:42 +01:00
..
crypto
numachip
trace
uv x86: UV BAU: Increase maximum CPUs per socket/hub 2014-11-03 13:49:24 +01:00
xen xen: introduce helper functions to do safe read and write accesses 2014-12-08 10:53:59 +00:00
a.out-core.h
acenv.h ACPICA: Linux: Add support to exclude <asm/acenv.h> inclusion. 2014-07-23 01:10:44 +02:00
acpi.h x86/xen: Override ACPI IRQ management callback __acpi_unregister_gsi 2015-01-20 11:44:41 +01:00
agp.h
alternative-asm.h
alternative.h
amd_nb.h
apb_timer.h
apic_flat_64.h
apic.h Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-08-13 18:23:32 -06:00
apicdef.h
apm.h
arch_hweight.h
archrandom.h
asm-offsets.h
asm.h
atomic64_32.h
atomic64_64.h locking,arch: Use ACCESS_ONCE() instead of cast to volatile in atomic_read() 2014-10-03 06:06:23 +02:00
atomic.h locking,arch: Use ACCESS_ONCE() instead of cast to volatile in atomic_read() 2014-10-03 06:06:23 +02:00
barrier.h arch: Add lightweight memory barriers dma_rmb() and dma_wmb() 2014-12-11 21:15:06 -05:00
bios_ebda.h
bitops.h Make ARCH_HAS_FAST_MULTIPLIER a real config variable 2014-09-13 11:14:53 -07:00
boot.h
bootparam_utils.h
bug.h
bugs.h
cache.h
cacheflush.h x86: mm: Move PAT only functions to mm/pat.c 2014-11-16 18:59:19 +01:00
calgary.h
calling.h x86: entry_64.S: delete unused code 2015-01-13 14:00:33 -08:00
ce4100.h
checksum_32.h
checksum_64.h
checksum.h
clocksource.h
cmdline.h
cmpxchg_32.h x86: Simplify __HAVE_ARCH_CMPXCHG tests 2014-07-11 17:28:51 -07:00
cmpxchg_64.h x86: Simplify __HAVE_ARCH_CMPXCHG tests 2014-07-11 17:28:51 -07:00
cmpxchg.h x86: Simplify __HAVE_ARCH_CMPXCHG tests 2014-07-11 17:28:51 -07:00
compat.h
context_tracking.h
cpu_device_id.h
cpu.h
cpufeature.h Merge branch 'perf/hw_breakpoints' into perf/core 2015-01-28 15:48:59 +01:00
cpumask.h
crash.h kexec: support for kexec on panic using new system call 2014-08-08 15:57:33 -07:00
current.h
debugreg.h perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8 2014-12-03 15:14:26 +01:00
delay.h
desc_defs.h
desc.h x86, tls: Interpret an all-zero struct user_desc as "no segment" 2015-01-22 21:45:07 +01:00
device.h
disabled-features.h x86, mpx: Add MPX to disabled features 2014-11-18 00:58:53 +01:00
div64.h
dma-mapping.h
dma.h x86/mm: Fix zone ranges boot printout 2014-12-11 11:35:02 +01:00
dmi.h
dwarf2.h
e820.h
edac.h
efi.h efi/x86: Move x86 back to libstub 2014-11-11 22:23:11 +00:00
elf.h x86: Reject x32 executables if x32 ABI not supported 2014-10-08 11:17:42 +02:00
emergency-restart.h
entry_arch.h
espfix.h
exec.h
fb.h x86: Use new cache mode type in include/asm/fb.h 2014-11-16 11:04:24 +01:00
fixmap.h Merge branch 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-12-10 14:24:20 -08:00
floppy.h
fpu-internal.h x86, fpu: Change __thread_fpu_begin() to use use_eager_fpu() 2014-09-02 14:51:15 -07:00
frame.h
ftrace.h ftrace/x86: Move MCOUNT_SAVE_FRAME out of header file 2014-12-01 14:07:16 -05:00
futex.h
gart.h
genapic.h
geode.h
gpio.h
hardirq.h x86, irq, trivial: Minor improvements of IRQ related code 2014-06-21 23:05:41 +02:00
highmem.h x86: mm: Re-use the early_ioremap fixed area 2014-11-03 13:40:44 +01:00
hpet.h
hugetlb.h
hw_breakpoint.h perf/x86/amd: AMD support for bp_len > HW_BREAKPOINT_LEN_8 2014-12-03 15:14:26 +01:00
hw_irq.h x86, irq: Move IOAPIC related declarations from hw_irq.h into io_apic.h 2014-12-16 14:08:17 +01:00
hypertransport.h
hypervisor.h
i387.h
i8259.h x86, irq: Count legacy IRQs by legacy_pic->nr_legacy_irqs instead of NR_IRQS_LEGACY 2014-06-21 23:05:42 +02:00
ia32_unistd.h
ia32.h
idle.h
inat_types.h
inat.h
init.h
insn.h x86: Remove arbitrary instruction size limit in instruction decoder 2014-11-18 00:58:52 +01:00
inst.h
intel_mid_vrtc.h
intel_scu_ipc.h
intel-mid.h
io_apic.h x86, irq: Move IRQ initialization routines from io_apic.c into vector.c 2014-12-16 14:08:17 +01:00
io.h Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-12-10 13:59:34 -08:00
iomap.h
iommu_table.h
iommu.h
iosf_mbi.h
ipi.h
irq_regs.h
irq_remapping.h
irq_vectors.h x86: Avoid building unused IRQ entry stubs 2014-12-16 14:08:14 +01:00
irq_work.h x86: Tell irq work about self IPI support 2014-09-13 18:38:29 +02:00
irq.h nmi: provide the option to issue an NMI back trace to every cpu but current 2014-06-23 16:47:44 -07:00
irqflags.h x86_64/entry/xen: Do not invoke espfix64 on Xen 2014-07-28 15:25:40 -07:00
ist.h
jump_label.h
kbdleds.h
Kbuild x86: use generic dma-contiguous.h 2014-09-22 13:35:52 +02:00
kdebug.h
kexec-bzimage64.h kexec-bzImage64: support for loading bzImage using 64bit entry 2014-08-08 15:57:33 -07:00
kexec.h kexec: support for kexec on panic using new system call 2014-08-08 15:57:33 -07:00
kgdb.h
kmap_types.h
kmemcheck.h
kprobes.h kprobes/x86: Remove stale ARCH_SUPPORTS_KPROBES_ON_FTRACE define 2014-10-17 07:18:34 +02:00
kvm_emulate.h KVM: emulate: put pointers in the fetch_cache 2014-07-11 09:14:03 +02:00
kvm_guest.h
kvm_host.h KVM: move APIC types to arch/x86/ 2014-12-18 09:39:51 +01:00
kvm_para.h x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only 2014-09-24 14:07:57 +02:00
lguest_hcall.h
lguest.h
linkage.h
local64.h
local.h
mach_timer.h
mach_traps.h
math_emu.h
mc146818rtc.h x86: Simplify __HAVE_ARCH_CMPXCHG tests 2014-07-11 17:28:51 -07:00
mce.h x86, mce: Get rid of TIF_MCE_NOTIFY and associated mce tricks 2015-01-07 07:47:42 -08:00
microcode_amd.h x86, microcode: Reload microcode on resume 2014-12-06 13:03:03 +01:00
microcode_intel.h x86, microcode: Reload microcode on resume 2014-12-06 13:03:03 +01:00
microcode.h x86, microcode: Reload microcode on resume 2014-12-06 13:03:03 +01:00
misc.h
mmconfig.h
mmu_context.h x86, mpx: Fix potential performance issue on unmaps 2015-01-22 21:11:06 +01:00
mmu.h
mmx.h
mmzone_32.h
mmzone_64.h
mmzone.h
module.h
mpspec_def.h
mpspec.h x86, apic: Remove mps_oem_check callback 2014-07-31 08:05:42 -07:00
mpx.h x86, mpx: Cleanup unused bound tables 2014-11-18 00:58:54 +01:00
mshyperv.h
msidef.h
msr.h
mtrr.h
mutex_32.h x86: Simplify __HAVE_ARCH_CMPXCHG tests 2014-07-11 17:28:51 -07:00
mutex_64.h
mutex.h
mwait.h x86, cpufeature: Convert more "features" to bugs 2014-06-18 15:27:04 -07:00
nmi.h
nops.h
numa_32.h
numa.h x86/mm/numa: Drop dead code and rename setup_node_data() to setup_alloc_data() 2014-09-16 08:55:10 +02:00
olpc_ofw.h
olpc.h
page_32_types.h x86_64, traps: Stop using IST for #SS 2014-11-23 13:56:19 -08:00
page_32.h
page_64_types.h x86_64, traps: Stop using IST for #SS 2014-11-23 13:56:19 -08:00
page_64.h x86_64,vsyscall: Make vsyscall emulation configurable 2014-11-03 21:44:57 +01:00
page_types.h
page.h arm64,ia64,ppc,s390,sh,tile,um,x86,mm: remove default gate area 2014-08-08 15:57:27 -07:00
paravirt_types.h
paravirt.h x86: Store a per-cpu shadow copy of CR4 2015-02-04 12:10:42 +01:00
parport.h
pat.h x86: Enable PAT to use cache mode translation tables 2014-11-16 11:04:26 +01:00
pci_64.h
pci_x86.h x86: irq: Fix placement of mp_should_keep_irq() 2014-12-16 14:08:14 +01:00
pci-direct.h
pci-functions.h
pci.h x86, irq: Move PCI MSI related code from io_apic.c into msi.c 2014-12-16 14:08:17 +01:00
percpu.h x86-64: Use RIP-relative addressing for most per-CPU accesses 2014-11-04 20:43:14 +01:00
perf_event_p4.h percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t 2014-08-28 08:58:57 -04:00
perf_event.h perf/x86/amd/ibs: Update IBS MSRs and feature definitions 2014-11-12 15:12:32 +01:00
pgalloc.h
pgtable_32_types.h x86: mm: Re-use the early_ioremap fixed area 2014-11-03 13:40:44 +01:00
pgtable_32.h x86: Remove set_pmd_pfn 2014-09-01 10:15:31 +02:00
pgtable_64_types.h x86, ptdump: Add section for EFI runtime services 2014-11-11 22:28:57 +00:00
pgtable_64.h Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-10-14 02:22:41 +02:00
pgtable_types.h xen: additional features for 3.19-rc0 2014-12-16 13:23:03 -08:00
pgtable-2level_types.h
pgtable-2level.h mm: x86 pgtable: require X86_64 for soft-dirty tracker 2014-06-04 16:54:05 -07:00
pgtable-3level_types.h
pgtable-3level.h
pgtable.h Merge branch 'akpm' (patchbomb from Andrew) 2014-12-10 18:34:42 -08:00
platform_sst_audio.h ASoC: Intel: mrfld: Define sst_res_info for acpi 2014-10-27 18:02:38 +00:00
pmc_atom.h x86/pmc_atom: Expose PMC device state and platform sleep state 2014-07-25 14:12:14 -07:00
posix_types.h
preempt.h sched: Kill task_preempt_count() 2014-10-28 10:47:56 +01:00
probe_roms.h
processor-cyrix.h
processor-flags.h
processor.h x86: Clean up cr4 manipulation 2015-02-04 12:10:41 +01:00
prom.h x86, devicetree, irq: Use common mechanism to support irqdomain 2014-06-21 23:05:43 +02:00
proto.h
ptrace.h x86: Split syscall_trace_enter into two phases 2014-09-08 14:14:03 -07:00
pvclock-abi.h
pvclock.h
qrwlock.h x86, locking: Use no more OOSTORE nonsense 2014-06-18 18:41:22 +02:00
realmode.h
reboot_fixups.h
reboot.h
required-features.h
resume-trace.h
rio.h
rmwcc.h
rtc.h
rwsem.h
seccomp_32.h
seccomp_64.h
seccomp.h
sections.h
segment.h x86/asm: Unify segment selector defines 2014-12-11 11:45:03 +01:00
serial.h x86/tty/serial/8250: Clean up the asm/serial.h include file a bit 2014-09-06 10:20:55 +02:00
setup_arch.h
setup.h
shmparam.h
sigcontext.h
sigframe.h
sighandling.h
signal.h signals: kill sigfindinword() 2014-06-06 16:08:11 -07:00
simd.h
smap.h
smp.h x86/core, x86/xen/smp: Use 'die_complete' completion when taking CPU down 2014-11-10 11:16:40 +01:00
smpboot_hooks.h x86, apic: Replace trampoline physical addresses with defaults 2014-07-31 08:05:41 -07:00
sparsemem.h
special_insns.h x86: Store a per-cpu shadow copy of CR4 2015-02-04 12:10:42 +01:00
spinlock_types.h locking/rwlock, x86: Clean up asm/spinlock*.h to remove old rwlock code 2014-09-10 11:46:38 +02:00
spinlock.h kernel: Provide READ_ONCE and ASSIGN_ONCE 2014-12-20 16:48:59 -08:00
sta2x11.h
stackprotector.h
stacktrace.h
string_32.h
string_64.h
string.h
suspend_32.h
suspend_64.h
suspend.h
svm.h
swiotlb.h x86: enable DMA CMA with swiotlb 2014-06-04 16:53:57 -07:00
switch_to.h sched/x86_64: Don't save flags on context switch 2014-10-28 11:11:30 +01:00
sync_bitops.h
sys_ia32.h
syscall.h
syscalls.h
sysfb.h
tce.h
thread_info.h x86, mce: Get rid of TIF_MCE_NOTIFY and associated mce tricks 2015-01-07 07:47:42 -08:00
time.h
timer.h
timex.h
tlb.h
tlbflush.h x86: Store a per-cpu shadow copy of CR4 2015-02-04 12:10:42 +01:00
topology.h
trace_clock.h
traps.h x86, traps: Add ist_begin_non_atomic and ist_end_non_atomic 2015-01-02 10:22:46 -08:00
tsc.h
uaccess_32.h
uaccess_64.h
uaccess.h
unaligned.h
unistd.h sys_sgetmask/sys_ssetmask: add CONFIG_SGETMASK_SYSCALL 2014-06-04 16:54:14 -07:00
uprobes.h uprobes/x86: Rename arch_uprobe->def to ->defparam, minor comment updates 2014-06-05 16:21:57 +02:00
user32.h
user_32.h
user_64.h
user.h
vdso.h x86, vdso: Move the vvar area before the vdso text 2014-07-11 16:57:51 -07:00
vga.h x86, ia64: Move EFI_FB vga_default_device() initialization to pci_vga_fixup() 2014-07-10 16:48:48 -06:00
vgtod.h x86, vdso: Use asm volatile in __getcpu 2014-12-23 13:05:30 -08:00
virtext.h x86: Store a per-cpu shadow copy of CR4 2015-02-04 12:10:42 +01:00
vm86.h
vmx.h kvm: x86: handle XSAVES vmcs and vmexit 2014-12-05 13:57:33 +01:00
vsyscall.h x86_64,vsyscall: Make vsyscall emulation configurable 2014-11-03 21:44:57 +01:00
vvar.h x86,vdso: Use LSL unconditionally for vgetcpu 2014-11-03 13:41:53 +01:00
word-at-a-time.h
x2apic.h
x86_init.h Revert "PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq()" 2014-11-11 15:14:30 -07:00
xcr.h
xor_32.h
xor_64.h
xor_avx.h
xor.h
xsave.h KVM: x86: Enable Intel AVX-512 for guest 2014-11-03 12:07:30 +01:00