linux/arch/x86/include/asm
Andy Lutomirski 9592747538 x86, traps: Track entry into and exit from IST context
We currently pretend that IST context is like standard exception
context, but this is incorrect.  IST entries from userspace are like
standard exceptions except that they use per-cpu stacks, so they are
atomic.  IST entries from kernel space are like NMIs from RCU's
perspective -- they are not quiescent states even if they
interrupted the kernel during a quiescent state.

Add and use ist_enter and ist_exit to track IST context.  Even
though x86_32 has no IST stacks, we track these interrupts the same
way.

This fixes two issues:

 - Scheduling from an IST interrupt handler will now warn.  It would
   previously appear to work as long as we got lucky and nothing
   overwrote the stack frame.  (I don't know of any bugs in this
   that would trigger the warning, but it's good to be on the safe
   side.)

 - RCU handling in IST context was dangerous.  As far as I know,
   only machine checks were likely to trigger this, but it's good to
   be on the safe side.

Note that the machine check handlers appears to have been missing
any context tracking at all before this patch.

Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
2015-01-02 10:22:46 -08: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
acpi.h
agp.h
alternative-asm.h
alternative.h
amd_nb.h
apb_timer.h
apic_flat_64.h
apic.h
apicdef.h
apm.h
arch_hweight.h
archrandom.h
asm-offsets.h
asm.h
atomic64_32.h
atomic64_64.h
atomic.h
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
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
ce4100.h
checksum_32.h
checksum_64.h
checksum.h
clocksource.h
cmdline.h
cmpxchg_32.h
cmpxchg_64.h
cmpxchg.h
compat.h
context_tracking.h
cpu_device_id.h
cpu.h
cpufeature.h x86: Add support for Intel HWP feature detection. 2014-11-12 00:04:37 +01:00
cpumask.h
crash.h
current.h
debugreg.h
delay.h
desc_defs.h
desc.h
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
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
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
highmem.h
hpet.h
hugetlb.h
hw_breakpoint.h
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
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
irq.h
irqflags.h
ist.h
jump_label.h
kbdleds.h
Kbuild
kdebug.h
kexec-bzimage64.h
kexec.h
kgdb.h
kmap_types.h
kmemcheck.h
kprobes.h
kvm_emulate.h
kvm_guest.h
kvm_host.h KVM: move APIC types to arch/x86/ 2014-12-18 09:39:51 +01:00
kvm_para.h
lguest_hcall.h
lguest.h
linkage.h
local64.h
local.h
mach_timer.h
mach_traps.h
math_emu.h
mc146818rtc.h
mce.h x86, mce, severity: Extend the the mce_severity mechanism to handle UCNA/DEFERRED error 2014-11-19 10:55:43 -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 Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-12-10 12:09:26 -08:00
mmu.h
mmx.h
mmzone_32.h
mmzone_64.h
mmzone.h
module.h
mpspec_def.h
mpspec.h
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
mutex_64.h
mutex.h
mwait.h
nmi.h
nops.h
numa_32.h
numa.h
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
paravirt_types.h
paravirt.h x86: Cleanly separate use of asm-generic/mm_hooks.h 2014-11-19 11:54:13 +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
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
pgtable_32.h
pgtable_64_types.h x86, ptdump: Add section for EFI runtime services 2014-11-11 22:28:57 +00:00
pgtable_64.h
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
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
pmc_atom.h
posix_types.h
preempt.h
probe_roms.h
processor-cyrix.h
processor-flags.h
processor.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
prom.h
proto.h
ptrace.h
pvclock-abi.h
pvclock.h
qrwlock.h
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
setup_arch.h
setup.h
shmparam.h
sigcontext.h
sigframe.h
sighandling.h
signal.h
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
sparsemem.h
special_insns.h
spinlock_types.h
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
switch_to.h
sync_bitops.h
sys_ia32.h
syscall.h
syscalls.h
sysfb.h
tce.h
thread_info.h uprobes, x86: Fix _TIF_UPROBE vs _TIF_NOTIFY_RESUME 2014-11-23 14:25:28 -08:00
time.h
timer.h
timex.h
tlb.h
tlbflush.h
topology.h
trace_clock.h
traps.h x86, traps: Track entry into and exit from IST context 2015-01-02 10:22:46 -08:00
tsc.h
uaccess_32.h
uaccess_64.h
uaccess.h
unaligned.h
unistd.h
uprobes.h
user32.h
user_32.h
user_64.h
user.h
vdso.h
vga.h
vgtod.h
virtext.h
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
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