/usr/src/linux-headers-5.15.0-190/arch/x86/include/asm
NameSizeModeActions
e820/-0755rm
fpu/-0755rm
numachip/-0755rm
trace/-0755rm
uv/-0755rm
vdso/-0755rm
xen/-0755rm
acenv.h14500644editdlrm
acpi.h48040644editdlrm
acrn.h18340644editdlrm
agp.h10730644editdlrm
alternative.h135740644editdlrm
amd-ibs.h42470644editdlrm
amd_nb.h31360644editdlrm
apic.h136460644editdlrm
apicdef.h115630644editdlrm
apm.h18420644editdlrm
archrandom.h23470644editdlrm
arch_hweight.h10830644editdlrm
asm-offsets.h350644editdlrm
asm-prototypes.h4310644editdlrm
asm.h60600644editdlrm
atomic.h67660644editdlrm
atomic64_32.h83670644editdlrm
atomic64_64.h64100644editdlrm
audit.h1700644editdlrm
barrier.h23680644editdlrm
bios_ebda.h9140644editdlrm
bitops.h101490644editdlrm
boot.h23970644editdlrm
bootparam_utils.h28660644editdlrm
bug.h23920644editdlrm
bugs.h3440644editdlrm
cache.h6220644editdlrm
cacheflush.h3290644editdlrm
cacheinfo.h2630644editdlrm
ce4100.h1210644editdlrm
checksum.h2400644editdlrm
checksum_32.h46820644editdlrm
checksum_64.h51640644editdlrm
clocksource.h4800644editdlrm
cmdline.h3020644editdlrm
cmpxchg.h79370644editdlrm
cmpxchg_32.h32430644editdlrm
cmpxchg_64.h5610644editdlrm
compat.h41020644editdlrm
cpu.h20990644editdlrm
cpufeature.h84280644editdlrm
cpufeatures.h333830644editdlrm
cpuidle_haltpoll.h1890644editdlrm
cpumask.h8290644editdlrm
cpu_device_id.h109450644editdlrm
cpu_entry_area.h41960644editdlrm
crash.h3000644editdlrm
current.h4430644editdlrm
debugreg.h36410644editdlrm
delay.h2750644editdlrm
desc.h115240644editdlrm
desc_defs.h33960644editdlrm
device.h1760644editdlrm
disabled-features.h31730644editdlrm
div64.h23350644editdlrm
dma-mapping.h5190644editdlrm
dma.h98110644editdlrm
dmi.h5560644editdlrm
doublefault.h2710644editdlrm
dwarf2.h13250644editdlrm
edac.h4740644editdlrm
efi.h123080644editdlrm
elf.h126230644editdlrm
elfcore-compat.h8900644editdlrm
emergency-restart.h2020644editdlrm
emulate_prefix.h4840644editdlrm
enclu.h1810644editdlrm
entry-common.h33220644editdlrm
espfix.h4260644editdlrm
exec.h370644editdlrm
extable.h18710644editdlrm
extable_fixup_types.h18750644editdlrm
fb.h5400644editdlrm
fixmap.h60940644editdlrm
floppy.h68600644editdlrm
frame.h25550644editdlrm
fsgsbase.h20720644editdlrm
ftrace.h32340644editdlrm
futex.h25530644editdlrm
gart.h27040644editdlrm
GEN-for-each-reg.h3450644editdlrm
genapic.h220644editdlrm
geode.h6930644editdlrm
hardirq.h23420644editdlrm
highmem.h24660644editdlrm
hpet.h30020644editdlrm
hugetlb.h2430644editdlrm
hw_breakpoint.h21120644editdlrm
hw_irq.h30700644editdlrm
hyperv-tlfs.h175550644editdlrm
hypervisor.h23600644editdlrm
i8259.h20610644editdlrm
ia32.h17910644editdlrm
ia32_unistd.h3130644editdlrm
idtentry.h241970644editdlrm
imr.h16840644editdlrm
inat.h60920644editdlrm
inat_types.h3410644editdlrm
init.h6320644editdlrm
insn-eval.h13790644editdlrm
insn.h78670644editdlrm
inst.h20660644editdlrm
intel-family.h57750644editdlrm
intel-mid.h11320644editdlrm
intel_ds.h8490644editdlrm
intel_pconfig.h15450644editdlrm
intel_pt.h12350644editdlrm
intel_punit_ipc.h46660644editdlrm
intel_scu_ipc.h22340644editdlrm
intel_telemetry.h37230644editdlrm
invpcid.h14870644editdlrm
io.h126900644editdlrm
iomap.h5360644editdlrm
iommu.h7800644editdlrm
iommu_table.h39100644editdlrm
iosf_mbi.h73840644editdlrm
io_apic.h52040644editdlrm
io_bitmap.h13700644editdlrm
irq.h12800644editdlrm
irqdomain.h19150644editdlrm
irqflags.h29760644editdlrm
irq_remapping.h20610644editdlrm
irq_stack.h75360644editdlrm
irq_vectors.h42960644editdlrm
irq_work.h3580644editdlrm
ist.h2940644editdlrm
jailhouse_para.h4490644editdlrm
jump_label.h14060644editdlrm
kasan.h12910644editdlrm
kaslr.h3980644editdlrm
kbdleds.h4540644editdlrm
Kbuild3000644editdlrm
kdebug.h10870644editdlrm
kexec-bzimage64.h1950644editdlrm
kexec.h60110644editdlrm
kfence.h21400644editdlrm
kgdb.h21430644editdlrm
kprobes.h34630644editdlrm
kvm-x86-ops.h39210644editdlrm
kvmclock.h5060644editdlrm
kvm_host.h600660644editdlrm
kvm_page_track.h25040644editdlrm
kvm_para.h34670644editdlrm
kvm_types.h1780644editdlrm
kvm_vcpu_regs.h6060644editdlrm
linkage.h11390644editdlrm
livepatch.h4720644editdlrm
local.h39250644editdlrm
mach_timer.h15900644editdlrm
mach_traps.h10130644editdlrm
math_emu.h3950644editdlrm
mc146818rtc.h28350644editdlrm
mce.h131250644editdlrm
memtype.h8990644editdlrm
mem_encrypt.h34270644editdlrm
microcode.h38650644editdlrm
microcode_amd.h15730644editdlrm
microcode_intel.h25210644editdlrm
misc.h1430644editdlrm
mmconfig.h3740644editdlrm
mmu.h17400644editdlrm
mmu_context.h60740644editdlrm
mmx.h3370644editdlrm
mmzone.h1290644editdlrm
mmzone_32.h3430644editdlrm
mmzone_64.h4300644editdlrm
module.h3240644editdlrm
mpspec.h36520644editdlrm
mpspec_def.h42560644editdlrm
mshyperv.h56040644editdlrm
msi.h15490644editdlrm
msr-index.h402300644editdlrm
msr-trace.h13870644editdlrm
msr.h110610644editdlrm
mtrr.h47530644editdlrm
mwait.h44570644editdlrm
nmi.h14440644editdlrm
nops.h19050644editdlrm
nospec-branch.h130730644editdlrm
numa.h21930644editdlrm
numa_32.h2560644editdlrm
olpc.h23820644editdlrm
olpc_ofw.h11280644editdlrm
orc_lookup.h10650644editdlrm
orc_types.h20250644editdlrm
page.h25100644editdlrm
page_32.h10430644editdlrm
page_32_types.h23990644editdlrm
page_64.h27370644editdlrm
page_64_types.h31390644editdlrm
page_types.h22620644editdlrm
paravirt.h188130644editdlrm
paravirt_types.h196710644editdlrm
parport.h3140644editdlrm
pc-conf-reg.h7230644editdlrm
pci-direct.h8500644editdlrm
pci-functions.h6540644editdlrm
pci.h31910644editdlrm
pci_x86.h64770644editdlrm
percpu.h169920644editdlrm
perf_event.h160790644editdlrm
perf_event_p4.h267310644editdlrm
pgalloc.h53060644editdlrm
pgtable-2level.h28150644editdlrm
pgtable-2level_types.h9210644editdlrm
pgtable-3level.h89630644editdlrm
pgtable-3level_types.h10300644editdlrm
pgtable-invert.h10910644editdlrm
pgtable.h334640644editdlrm
pgtable_32.h23460644editdlrm
pgtable_32_areas.h15820644editdlrm
pgtable_32_types.h6340644editdlrm
pgtable_64.h72570644editdlrm
pgtable_64_types.h44680644editdlrm
pgtable_areas.h6230644editdlrm
pgtable_types.h175800644editdlrm
pkeys.h35130644editdlrm
pkru.h13460644editdlrm
platform_sst_audio.h31010644editdlrm
pm-trace.h6110644editdlrm
posix_types.h1440644editdlrm
preempt.h40510644editdlrm
probe_roms.h2730644editdlrm
processor-cyrix.h3830644editdlrm
processor-flags.h17500644editdlrm
processor.h224710644editdlrm
prom.h8210644editdlrm
proto.h9520644editdlrm
pti.h3720644editdlrm
ptrace.h104910644editdlrm
purgatory.h2350644editdlrm
pvclock-abi.h15300644editdlrm
pvclock.h27020644editdlrm
qrwlock.h1990644editdlrm
qspinlock.h31320644editdlrm
qspinlock_paravirt.h19080644editdlrm
realmode.h20990644editdlrm
reboot.h9480644editdlrm
reboot_fixups.h1830644editdlrm
required-features.h28390644editdlrm
resctrl.h28470644editdlrm
rmwcc.h22770644editdlrm
seccomp.h12050644editdlrm
sections.h8950644editdlrm
segment.h106130644editdlrm
serial.h11370644editdlrm
setup.h36330644editdlrm
setup_arch.h770644editdlrm
set_memory.h53880644editdlrm
sev-common.h30530644editdlrm
sev.h24430644editdlrm
sgx.h113890644editdlrm
shmparam.h1930644editdlrm
sigcontext.h2610644editdlrm
sigframe.h21410644editdlrm
sighandling.h5260644editdlrm
signal.h24280644editdlrm
simd.h2870644editdlrm
smap.h20380644editdlrm
smp.h50670644editdlrm
softirq_stack.h2160644editdlrm
sparsemem.h11020644editdlrm
spec-ctrl.h28750644editdlrm
special_insns.h71700644editdlrm
spinlock.h12140644editdlrm
spinlock_types.h2530644editdlrm
sta2x11.h3520644editdlrm
stackprotector.h30950644editdlrm
stacktrace.h28500644editdlrm
static_call.h28680644editdlrm
string.h1290644editdlrm
string_32.h61110644editdlrm
string_64.h28520644editdlrm
suspend.h4960644editdlrm
suspend_32.h8760644editdlrm
suspend_64.h18330644editdlrm
svm.h107910644editdlrm
swiotlb.h6450644editdlrm
switch_to.h23300644editdlrm
sync_bitops.h33360644editdlrm
sync_core.h33150644editdlrm
syscall.h43100644editdlrm
syscalls.h3740644editdlrm
syscall_wrapper.h99980644editdlrm
text-patching.h56460644editdlrm
thermal.h4280644editdlrm
thread_info.h79950644editdlrm
time.h3310644editdlrm
timer.h10270644editdlrm
timex.h5460644editdlrm
tlb.h12000644editdlrm
tlbbatch.h3320644editdlrm
tlbflush.h77100644editdlrm
topology.h64820644editdlrm
trace_clock.h4060644editdlrm
trapnr.h13160644editdlrm
traps.h12600644editdlrm
trap_pf.h7090644editdlrm
tsc.h20160644editdlrm
uaccess.h222100644editdlrm
uaccess_32.h10060644editdlrm
uaccess_64.h24400644editdlrm
umip.h3170644editdlrm
unistd.h16300644editdlrm
unwind.h32200644editdlrm
unwind_hints.h14610644editdlrm
uprobes.h10170644editdlrm
user.h22570644editdlrm
user32.h21560644editdlrm
user_32.h50420644editdlrm
user_64.h53390644editdlrm
vdso.h13910644editdlrm
vermagic.h19930644editdlrm
vga.h7400644editdlrm
vgtod.h5180644editdlrm
virtext.h34600644editdlrm
vm86.h21820644editdlrm
vmalloc.h5600644editdlrm
vmware.h19420644editdlrm
vmx.h261410644editdlrm
vmxfeatures.h60490644editdlrm
vsyscall.h9880644editdlrm
vvar.h15910644editdlrm
word-at-a-time.h25960644editdlrm
x86_init.h101760644editdlrm
xor.h101070644editdlrm
xor_32.h143470644editdlrm
xor_64.h7160644editdlrm
xor_avx.h43440644editdlrm
Edit: /usr/src/linux-headers-5.15.0-190/arch/x86/include/asm/idtentry.h (24197B)
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_X86_IDTENTRY_H #define _ASM_X86_IDTENTRY_H /* Interrupts/Exceptions */ #include #ifndef __ASSEMBLY__ #include #include #include typedef void (*idtentry_t)(struct pt_regs *regs); /** * DECLARE_IDTENTRY - Declare functions for simple IDT entry points * No error code pushed by hardware * @vector: Vector number (ignored for C) * @func: Function name of the entry point * * Declares four functions: * - The ASM entry point: asm_##func * - The XEN PV trap entry point: xen_##func (maybe unused) * - The C handler called from the FRED event dispatcher (maybe unused) * - The C handler called from the ASM entry point * * Note: This is the C variant of DECLARE_IDTENTRY(). As the name says it * declares the entry points for usage in C code. There is an ASM variant * as well which is used to emit the entry stubs in entry_32/64.S. */ #define DECLARE_IDTENTRY(vector, func) \ asmlinkage void asm_##func(void); \ asmlinkage void xen_asm_##func(void); \ void fred_##func(struct pt_regs *regs); \ __visible void func(struct pt_regs *regs) /** * DEFINE_IDTENTRY - Emit code for simple IDT entry points * @func: Function name of the entry point * * @func is called from ASM entry code with interrupts disabled. * * The macro is written so it acts as function definition. Append the * body with a pair of curly brackets. * * irqentry_enter() contains common code which has to be invoked before * arbitrary code in the body. irqentry_exit() contains common code * which has to run before returning to the low level assembly code. */ #define DEFINE_IDTENTRY(func) \ static __always_inline void __##func(struct pt_regs *regs); \ \ __visible noinstr void func(struct pt_regs *regs) \ { \ irqentry_state_t state = irqentry_enter(regs); \ \ instrumentation_begin(); \ __##func (regs); \ instrumentation_end(); \ irqentry_exit(regs, state); \ } \ \ static __always_inline void __##func(struct pt_regs *regs) /* Special case for 32bit IRET 'trap' */ #define DECLARE_IDTENTRY_SW DECLARE_IDTENTRY #define DEFINE_IDTENTRY_SW DEFINE_IDTENTRY /** * DECLARE_IDTENTRY_ERRORCODE - Declare functions for simple IDT entry points * Error code pushed by hardware * @vector: Vector number (ignored for C) * @func: Function name of the entry point * * Declares three functions: * - The ASM entry point: asm_##func * - The XEN PV trap entry point: xen_##func (maybe unused) * - The C handler called from the ASM entry point * * Same as DECLARE_IDTENTRY, but has an extra error_code argument for the * C-handler. */ #define DECLARE_IDTENTRY_ERRORCODE(vector, func) \ asmlinkage void asm_##func(void); \ asmlinkage void xen_asm_##func(void); \ __visible void func(struct pt_regs *regs, unsigned long error_code) /** * DEFINE_IDTENTRY_ERRORCODE - Emit code for simple IDT entry points * Error code pushed by hardware * @func: Function name of the entry point * * Same as DEFINE_IDTENTRY, but has an extra error_code argument */ #define DEFINE_IDTENTRY_ERRORCODE(func) \ static __always_inline void __##func(struct pt_regs *regs, \ unsigned long error_code); \ \ __visible noinstr void func(struct pt_regs *regs, \ unsigned long error_code) \ { \ irqentry_state_t state = irqentry_enter(regs); \ \ instrumentation_begin(); \ __##func (regs, error_code); \ instrumentation_end(); \ irqentry_exit(regs, state); \ } \ \ static __always_inline void __##func(struct pt_regs *regs, \ unsigned long error_code) /** * DECLARE_IDTENTRY_RAW - Declare functions for raw IDT entry points * No error code pushed by hardware * @vector: Vector number (ignored for C) * @func: Function name of the entry point * * Maps to DECLARE_IDTENTRY(). */ #define DECLARE_IDTENTRY_RAW(vector, func) \ DECLARE_IDTENTRY(vector, func) /** * DEFINE_IDTENTRY_RAW - Emit code for raw IDT entry points * @func: Function name of the entry point * * @func is called from ASM entry code with interrupts disabled. * * The macro is written so it acts as function definition. Append the * body with a pair of curly brackets. * * Contrary to DEFINE_IDTENTRY() this does not invoke the * idtentry_enter/exit() helpers before and after the body invocation. This * needs to be done in the body itself if applicable. Use if extra work * is required before the enter/exit() helpers are invoked. */ #define DEFINE_IDTENTRY_RAW(func) \ __visible noinstr void func(struct pt_regs *regs) /** * DEFINE_FREDENTRY_RAW - Emit code for raw FRED entry points * @func: Function name of the entry point * * @func is called from the FRED event dispatcher with interrupts disabled. * * See @DEFINE_IDTENTRY_RAW for further details. */ #define DEFINE_FREDENTRY_RAW(func) \ noinstr void fred_##func(struct pt_regs *regs) /** * DECLARE_IDTENTRY_RAW_ERRORCODE - Declare functions for raw IDT entry points * Error code pushed by hardware * @vector: Vector number (ignored for C) * @func: Function name of the entry point * * Maps to DECLARE_IDTENTRY_ERRORCODE() */ #define DECLARE_IDTENTRY_RAW_ERRORCODE(vector, func) \ DECLARE_IDTENTRY_ERRORCODE(vector, func) /** * DEFINE_IDTENTRY_RAW_ERRORCODE - Emit code for raw IDT entry points * @func: Function name of the entry point * * @func is called from ASM entry code with interrupts disabled. * * The macro is written so it acts as function definition. Append the * body with a pair of curly brackets. * * Contrary to DEFINE_IDTENTRY_ERRORCODE() this does not invoke the * irqentry_enter/exit() helpers before and after the body invocation. This * needs to be done in the body itself if applicable. Use if extra work * is required before the enter/exit() helpers are invoked. */ #define DEFINE_IDTENTRY_RAW_ERRORCODE(func) \ __visible noinstr void func(struct pt_regs *regs, unsigned long error_code) /** * DECLARE_IDTENTRY_IRQ - Declare functions for device interrupt IDT entry * points (common/spurious) * @vector: Vector number (ignored for C) * @func: Function name of the entry point * * Maps to DECLARE_IDTENTRY_ERRORCODE() */ #define DECLARE_IDTENTRY_IRQ(vector, func) \ DECLARE_IDTENTRY_ERRORCODE(vector, func) /** * DEFINE_IDTENTRY_IRQ - Emit code for device interrupt IDT entry points * @func: Function name of the entry point * * The vector number is pushed by the low level entry stub and handed * to the function as error_code argument which needs to be truncated * to an u8 because the push is sign extending. * * irq_enter/exit_rcu() are invoked before the function body and the * KVM L1D flush request is set. Stack switching to the interrupt stack * has to be done in the function body if necessary. */ #define DEFINE_IDTENTRY_IRQ(func) \ static void __##func(struct pt_regs *regs, u32 vector); \ \ __visible noinstr void func(struct pt_regs *regs, \ unsigned long error_code) \ { \ irqentry_state_t state = irqentry_enter(regs); \ u32 vector = (u32)(u8)error_code; \ \ kvm_set_cpu_l1tf_flush_l1d(); \ instrumentation_begin(); \ run_irq_on_irqstack_cond(__##func, regs, vector); \ instrumentation_end(); \ irqentry_exit(regs, state); \ } \ \ static noinline void __##func(struct pt_regs *regs, u32 vector) /** * DECLARE_IDTENTRY_SYSVEC - Declare functions for system vector entry points * @vector: Vector number (ignored for C) * @func: Function name of the entry point * * Declares three functions: * - The ASM entry point: asm_##func * - The XEN PV trap entry point: xen_##func (maybe unused) * - The C handler called from the ASM entry point * * Maps to DECLARE_IDTENTRY(). */ #define DECLARE_IDTENTRY_SYSVEC(vector, func) \ DECLARE_IDTENTRY(vector, func) /** * DEFINE_IDTENTRY_SYSVEC - Emit code for system vector IDT entry points * @func: Function name of the entry point * * irqentry_enter/exit() and irq_enter/exit_rcu() are invoked before the * function body. KVM L1D flush request is set. * * Runs the function on the interrupt stack if the entry hit kernel mode */ #define DEFINE_IDTENTRY_SYSVEC(func) \ static void __##func(struct pt_regs *regs); \ \ static __always_inline void instr_##func(struct pt_regs *regs) \ { \ run_sysvec_on_irqstack_cond(__##func, regs); \ } \ \ __visible noinstr void func(struct pt_regs *regs) \ { \ irqentry_state_t state = irqentry_enter(regs); \ \ kvm_set_cpu_l1tf_flush_l1d(); \ instrumentation_begin(); \ instr_##func (regs); \ instrumentation_end(); \ irqentry_exit(regs, state); \ } \ \ void fred_##func(struct pt_regs *regs) \ { \ instr_##func (regs); \ } \ \ static noinline void __##func(struct pt_regs *regs) /** * DEFINE_IDTENTRY_SYSVEC_SIMPLE - Emit code for simple system vector IDT * entry points * @func: Function name of the entry point * * Runs the function on the interrupted stack. No switch to IRQ stack and * only the minimal __irq_enter/exit() handling. * * Only use for 'empty' vectors like reschedule IPI and KVM posted * interrupt vectors. */ #define DEFINE_IDTENTRY_SYSVEC_SIMPLE(func) \ static __always_inline void __##func(struct pt_regs *regs); \ \ static __always_inline void instr_##func(struct pt_regs *regs) \ { \ __irq_enter_raw(); \ __##func (regs); \ __irq_exit_raw(); \ } \ \ __visible noinstr void func(struct pt_regs *regs) \ { \ irqentry_state_t state = irqentry_enter(regs); \ \ kvm_set_cpu_l1tf_flush_l1d(); \ instrumentation_begin(); \ instr_##func (regs); \ instrumentation_end(); \ irqentry_exit(regs, state); \ } \ \ void fred_##func(struct pt_regs *regs) \ { \ instr_##func (regs); \ } \ \ static __always_inline void __##func(struct pt_regs *regs) /** * DECLARE_IDTENTRY_XENCB - Declare functions for XEN HV callback entry point * @vector: Vector number (ignored for C) * @func: Function name of the entry point * * Declares three functions: * - The ASM entry point: asm_##func * - The XEN PV trap entry point: xen_##func (maybe unused) * - The C handler called from the ASM entry point * * Maps to DECLARE_IDTENTRY(). Distinct entry point to handle the 32/64-bit * difference */ #define DECLARE_IDTENTRY_XENCB(vector, func) \ DECLARE_IDTENTRY(vector, func) #ifdef CONFIG_X86_64 /** * DECLARE_IDTENTRY_IST - Declare functions for IST handling IDT entry points * @vector: Vector number (ignored for C) * @func: Function name of the entry point * * Maps to DECLARE_IDTENTRY_RAW, but declares also the NOIST C handler * which is called from the ASM entry point on user mode entry */ #define DECLARE_IDTENTRY_IST(vector, func) \ DECLARE_IDTENTRY_RAW(vector, func); \ __visible void noist_##func(struct pt_regs *regs) /** * DECLARE_IDTENTRY_VC - Declare functions for the VC entry point * @vector: Vector number (ignored for C) * @func: Function name of the entry point * * Maps to DECLARE_IDTENTRY_RAW_ERRORCODE, but declares also the * safe_stack C handler. */ #define DECLARE_IDTENTRY_VC(vector, func) \ DECLARE_IDTENTRY_RAW_ERRORCODE(vector, func); \ __visible noinstr void kernel_##func(struct pt_regs *regs, unsigned long error_code); \ __visible noinstr void user_##func(struct pt_regs *regs, unsigned long error_code) /** * DEFINE_IDTENTRY_IST - Emit code for IST entry points * @func: Function name of the entry point * * Maps to DEFINE_IDTENTRY_RAW */ #define DEFINE_IDTENTRY_IST(func) \ DEFINE_IDTENTRY_RAW(func) /** * DEFINE_IDTENTRY_NOIST - Emit code for NOIST entry points which * belong to a IST entry point (MCE, DB) * @func: Function name of the entry point. Must be the same as * the function name of the corresponding IST variant * * Maps to DEFINE_IDTENTRY_RAW(). */ #define DEFINE_IDTENTRY_NOIST(func) \ DEFINE_IDTENTRY_RAW(noist_##func) /** * DECLARE_IDTENTRY_DF - Declare functions for double fault * @vector: Vector number (ignored for C) * @func: Function name of the entry point * * Maps to DECLARE_IDTENTRY_RAW_ERRORCODE */ #define DECLARE_IDTENTRY_DF(vector, func) \ DECLARE_IDTENTRY_RAW_ERRORCODE(vector, func) /** * DEFINE_IDTENTRY_DF - Emit code for double fault * @func: Function name of the entry point * * Maps to DEFINE_IDTENTRY_RAW_ERRORCODE */ #define DEFINE_IDTENTRY_DF(func) \ DEFINE_IDTENTRY_RAW_ERRORCODE(func) /** * DEFINE_IDTENTRY_VC_KERNEL - Emit code for VMM communication handler when raised from kernel mode * @func: Function name of the entry point * * Maps to DEFINE_IDTENTRY_RAW_ERRORCODE */ #define DEFINE_IDTENTRY_VC_KERNEL(func) \ DEFINE_IDTENTRY_RAW_ERRORCODE(kernel_##func) /** * DEFINE_IDTENTRY_VC_USER - Emit code for VMM communication handler when raised from user mode * @func: Function name of the entry point * * Maps to DEFINE_IDTENTRY_RAW_ERRORCODE */ #define DEFINE_IDTENTRY_VC_USER(func) \ DEFINE_IDTENTRY_RAW_ERRORCODE(user_##func) #else /* CONFIG_X86_64 */ /** * DECLARE_IDTENTRY_DF - Declare functions for double fault 32bit variant * @vector: Vector number (ignored for C) * @func: Function name of the entry point * * Declares two functions: * - The ASM entry point: asm_##func * - The C handler called from the C shim */ #define DECLARE_IDTENTRY_DF(vector, func) \ asmlinkage void asm_##func(void); \ __visible void func(struct pt_regs *regs, \ unsigned long error_code, \ unsigned long address) /** * DEFINE_IDTENTRY_DF - Emit code for double fault on 32bit * @func: Function name of the entry point * * This is called through the doublefault shim which already provides * cr2 in the address argument. */ #define DEFINE_IDTENTRY_DF(func) \ __visible noinstr void func(struct pt_regs *regs, \ unsigned long error_code, \ unsigned long address) #endif /* !CONFIG_X86_64 */ /* C-Code mapping */ #define DECLARE_IDTENTRY_NMI DECLARE_IDTENTRY_RAW #define DEFINE_IDTENTRY_NMI DEFINE_IDTENTRY_RAW #define DEFINE_FREDENTRY_NMI DEFINE_FREDENTRY_RAW #ifdef CONFIG_X86_64 #define DECLARE_IDTENTRY_MCE DECLARE_IDTENTRY_IST #define DEFINE_IDTENTRY_MCE DEFINE_IDTENTRY_IST #define DEFINE_IDTENTRY_MCE_USER DEFINE_IDTENTRY_NOIST #define DEFINE_FREDENTRY_MCE DEFINE_FREDENTRY_RAW #define DECLARE_IDTENTRY_DEBUG DECLARE_IDTENTRY_IST #define DEFINE_IDTENTRY_DEBUG DEFINE_IDTENTRY_IST #define DEFINE_IDTENTRY_DEBUG_USER DEFINE_IDTENTRY_NOIST #define DEFINE_FREDENTRY_DEBUG DEFINE_FREDENTRY_RAW #endif #else /* !__ASSEMBLY__ */ /* * The ASM variants for DECLARE_IDTENTRY*() which emit the ASM entry stubs. */ #define DECLARE_IDTENTRY(vector, func) \ idtentry vector asm_##func func has_error_code=0 #define DECLARE_IDTENTRY_ERRORCODE(vector, func) \ idtentry vector asm_##func func has_error_code=1 /* Special case for 32bit IRET 'trap'. Do not emit ASM code */ #define DECLARE_IDTENTRY_SW(vector, func) #define DECLARE_IDTENTRY_RAW(vector, func) \ DECLARE_IDTENTRY(vector, func) #define DECLARE_IDTENTRY_RAW_ERRORCODE(vector, func) \ DECLARE_IDTENTRY_ERRORCODE(vector, func) /* Entries for common/spurious (device) interrupts */ #define DECLARE_IDTENTRY_IRQ(vector, func) \ idtentry_irq vector func /* System vector entries */ #define DECLARE_IDTENTRY_SYSVEC(vector, func) \ idtentry_sysvec vector func #ifdef CONFIG_X86_64 # define DECLARE_IDTENTRY_MCE(vector, func) \ idtentry_mce_db vector asm_##func func # define DECLARE_IDTENTRY_DEBUG(vector, func) \ idtentry_mce_db vector asm_##func func # define DECLARE_IDTENTRY_DF(vector, func) \ idtentry_df vector asm_##func func # define DECLARE_IDTENTRY_XENCB(vector, func) \ DECLARE_IDTENTRY(vector, func) # define DECLARE_IDTENTRY_VC(vector, func) \ idtentry_vc vector asm_##func func #else # define DECLARE_IDTENTRY_MCE(vector, func) \ DECLARE_IDTENTRY(vector, func) /* No ASM emitted for DF as this goes through a C shim */ # define DECLARE_IDTENTRY_DF(vector, func) /* No ASM emitted for XEN hypervisor callback */ # define DECLARE_IDTENTRY_XENCB(vector, func) #endif /* No ASM code emitted for NMI */ #define DECLARE_IDTENTRY_NMI(vector, func) /* * ASM code to emit the common vector entry stubs where each stub is * packed into 8 bytes. * * Note, that the 'pushq imm8' is emitted via '.byte 0x6a, vector' because * GCC treats the local vector variable as unsigned int and would expand * all vectors above 0x7F to a 5 byte push. The original code did an * adjustment of the vector number to be in the signed byte range to avoid * this. While clever it's mindboggling counterintuitive and requires the * odd conversion back to a real vector number in the C entry points. Using * .byte achieves the same thing and the only fixup needed in the C entry * point is to mask off the bits above bit 7 because the push is sign * extending. */ .align 8 SYM_CODE_START(irq_entries_start) vector=FIRST_EXTERNAL_VECTOR .rept NR_EXTERNAL_VECTORS UNWIND_HINT_IRET_REGS 0 : .byte 0x6a, vector jmp asm_common_interrupt nop /* Ensure that the above is 8 bytes max */ . = 0b + 8 vector = vector+1 .endr SYM_CODE_END(irq_entries_start) #ifdef CONFIG_X86_LOCAL_APIC .align 8 SYM_CODE_START(spurious_entries_start) vector=FIRST_SYSTEM_VECTOR .rept NR_SYSTEM_VECTORS UNWIND_HINT_IRET_REGS 0 : .byte 0x6a, vector jmp asm_spurious_interrupt nop /* Ensure that the above is 8 bytes max */ . = 0b + 8 vector = vector+1 .endr SYM_CODE_END(spurious_entries_start) #endif #endif /* __ASSEMBLY__ */ /* * The actual entry points. Note that DECLARE_IDTENTRY*() serves two * purposes: * - provide the function declarations when included from C-Code * - emit the ASM stubs when included from entry_32/64.S * * This avoids duplicate defines and ensures that everything is consistent. */ /* * Dummy trap number so the low level ASM macro vector number checks do not * match which results in emitting plain IDTENTRY stubs without bells and * whistles. */ #define X86_TRAP_OTHER 0xFFFF /* Simple exception entry points. No hardware error code */ DECLARE_IDTENTRY(X86_TRAP_DE, exc_divide_error); DECLARE_IDTENTRY(X86_TRAP_OF, exc_overflow); DECLARE_IDTENTRY(X86_TRAP_BR, exc_bounds); DECLARE_IDTENTRY(X86_TRAP_NM, exc_device_not_available); DECLARE_IDTENTRY(X86_TRAP_OLD_MF, exc_coproc_segment_overrun); DECLARE_IDTENTRY(X86_TRAP_SPURIOUS, exc_spurious_interrupt_bug); DECLARE_IDTENTRY(X86_TRAP_MF, exc_coprocessor_error); DECLARE_IDTENTRY(X86_TRAP_XF, exc_simd_coprocessor_error); /* 32bit software IRET trap. Do not emit ASM code */ DECLARE_IDTENTRY_SW(X86_TRAP_IRET, iret_error); /* Simple exception entries with error code pushed by hardware */ DECLARE_IDTENTRY_ERRORCODE(X86_TRAP_TS, exc_invalid_tss); DECLARE_IDTENTRY_ERRORCODE(X86_TRAP_NP, exc_segment_not_present); DECLARE_IDTENTRY_ERRORCODE(X86_TRAP_SS, exc_stack_segment); DECLARE_IDTENTRY_ERRORCODE(X86_TRAP_GP, exc_general_protection); DECLARE_IDTENTRY_ERRORCODE(X86_TRAP_AC, exc_alignment_check); /* Raw exception entries which need extra work */ DECLARE_IDTENTRY_RAW(X86_TRAP_UD, exc_invalid_op); DECLARE_IDTENTRY_RAW(X86_TRAP_BP, exc_int3); DECLARE_IDTENTRY_RAW_ERRORCODE(X86_TRAP_PF, exc_page_fault); #if defined(CONFIG_IA32_EMULATION) DECLARE_IDTENTRY_RAW(IA32_SYSCALL_VECTOR, int80_emulation); #endif #ifdef CONFIG_X86_MCE #ifdef CONFIG_X86_64 DECLARE_IDTENTRY_MCE(X86_TRAP_MC, exc_machine_check); #else DECLARE_IDTENTRY_RAW(X86_TRAP_MC, exc_machine_check); #endif #ifdef CONFIG_XEN_PV DECLARE_IDTENTRY_RAW(X86_TRAP_MC, xenpv_exc_machine_check); #endif #endif /* NMI */ #if defined(CONFIG_X86_64) && IS_ENABLED(CONFIG_KVM_INTEL) /* * Special NOIST entry point for VMX which invokes this on the kernel * stack. asm_exc_nmi() requires an IST to work correctly vs. the NMI * 'executing' marker. * * On 32bit this just uses the regular NMI entry point because 32-bit does * not have ISTs. */ DECLARE_IDTENTRY(X86_TRAP_NMI, exc_nmi_noist); #else #define asm_exc_nmi_noist asm_exc_nmi #endif DECLARE_IDTENTRY_NMI(X86_TRAP_NMI, exc_nmi); #ifdef CONFIG_XEN_PV DECLARE_IDTENTRY_RAW(X86_TRAP_NMI, xenpv_exc_nmi); #endif /* #DB */ #ifdef CONFIG_X86_64 DECLARE_IDTENTRY_DEBUG(X86_TRAP_DB, exc_debug); #else DECLARE_IDTENTRY_RAW(X86_TRAP_DB, exc_debug); #endif #ifdef CONFIG_XEN_PV DECLARE_IDTENTRY_RAW(X86_TRAP_DB, xenpv_exc_debug); #endif /* #DF */ DECLARE_IDTENTRY_DF(X86_TRAP_DF, exc_double_fault); #ifdef CONFIG_XEN_PV DECLARE_IDTENTRY_RAW_ERRORCODE(X86_TRAP_DF, xenpv_exc_double_fault); #endif /* #VC */ #ifdef CONFIG_AMD_MEM_ENCRYPT DECLARE_IDTENTRY_VC(X86_TRAP_VC, exc_vmm_communication); #endif #ifdef CONFIG_XEN_PV DECLARE_IDTENTRY_XENCB(X86_TRAP_OTHER, exc_xen_hypervisor_callback); DECLARE_IDTENTRY_RAW(X86_TRAP_OTHER, exc_xen_unknown_trap); #endif /* Device interrupts common/spurious */ DECLARE_IDTENTRY_IRQ(X86_TRAP_OTHER, common_interrupt); #ifdef CONFIG_X86_LOCAL_APIC DECLARE_IDTENTRY_IRQ(X86_TRAP_OTHER, spurious_interrupt); #endif /* System vector entry points */ #ifdef CONFIG_X86_LOCAL_APIC DECLARE_IDTENTRY_SYSVEC(ERROR_APIC_VECTOR, sysvec_error_interrupt); DECLARE_IDTENTRY_SYSVEC(SPURIOUS_APIC_VECTOR, sysvec_spurious_apic_interrupt); DECLARE_IDTENTRY_SYSVEC(LOCAL_TIMER_VECTOR, sysvec_apic_timer_interrupt); DECLARE_IDTENTRY_SYSVEC(X86_PLATFORM_IPI_VECTOR, sysvec_x86_platform_ipi); #endif #ifdef CONFIG_SMP DECLARE_IDTENTRY(RESCHEDULE_VECTOR, sysvec_reschedule_ipi); DECLARE_IDTENTRY_SYSVEC(IRQ_MOVE_CLEANUP_VECTOR, sysvec_irq_move_cleanup); DECLARE_IDTENTRY_SYSVEC(REBOOT_VECTOR, sysvec_reboot); DECLARE_IDTENTRY_SYSVEC(CALL_FUNCTION_SINGLE_VECTOR, sysvec_call_function_single); DECLARE_IDTENTRY_SYSVEC(CALL_FUNCTION_VECTOR, sysvec_call_function); #else # define fred_sysvec_reschedule_ipi NULL # define fred_sysvec_reboot NULL # define fred_sysvec_call_function_single NULL # define fred_sysvec_call_function NULL #endif #ifdef CONFIG_X86_LOCAL_APIC # ifdef CONFIG_X86_MCE_THRESHOLD DECLARE_IDTENTRY_SYSVEC(THRESHOLD_APIC_VECTOR, sysvec_threshold); # else # define fred_sysvec_threshold NULL # endif # ifdef CONFIG_X86_MCE_AMD DECLARE_IDTENTRY_SYSVEC(DEFERRED_ERROR_VECTOR, sysvec_deferred_error); # else # define fred_sysvec_deferred_error NULL # endif # ifdef CONFIG_X86_THERMAL_VECTOR DECLARE_IDTENTRY_SYSVEC(THERMAL_APIC_VECTOR, sysvec_thermal); # else # define fred_sysvec_thermal NULL # endif # ifdef CONFIG_IRQ_WORK DECLARE_IDTENTRY_SYSVEC(IRQ_WORK_VECTOR, sysvec_irq_work); # else # define fred_sysvec_irq_work NULL # endif #endif #ifdef CONFIG_HAVE_KVM DECLARE_IDTENTRY_SYSVEC(POSTED_INTR_VECTOR, sysvec_kvm_posted_intr_ipi); DECLARE_IDTENTRY_SYSVEC(POSTED_INTR_WAKEUP_VECTOR, sysvec_kvm_posted_intr_wakeup_ipi); DECLARE_IDTENTRY_SYSVEC(POSTED_INTR_NESTED_VECTOR, sysvec_kvm_posted_intr_nested_ipi); #else # define fred_sysvec_kvm_posted_intr_ipi NULL # define fred_sysvec_kvm_posted_intr_wakeup_ipi NULL # define fred_sysvec_kvm_posted_intr_nested_ipi NULL #endif #if IS_ENABLED(CONFIG_HYPERV) DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_CALLBACK_VECTOR, sysvec_hyperv_callback); DECLARE_IDTENTRY_SYSVEC(HYPERV_REENLIGHTENMENT_VECTOR, sysvec_hyperv_reenlightenment); DECLARE_IDTENTRY_SYSVEC(HYPERV_STIMER0_VECTOR, sysvec_hyperv_stimer0); #endif #if IS_ENABLED(CONFIG_ACRN_GUEST) DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_CALLBACK_VECTOR, sysvec_acrn_hv_callback); #endif #ifdef CONFIG_XEN_PVHVM DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_CALLBACK_VECTOR, sysvec_xen_hvm_callback); #endif #ifdef CONFIG_KVM_GUEST DECLARE_IDTENTRY_SYSVEC(HYPERVISOR_CALLBACK_VECTOR, sysvec_kvm_asyncpf_interrupt); #endif #undef X86_TRAP_OTHER #endif