1 // SPDX-License-Identifier: GPL-2.0
2 #ifndef __LINUX_KBUILD_H
3 # error "Please do not build this file directly, build asm-offsets.c instead"
4 #endif
5
6 #include <asm/ia32.h>
7
8 #if defined(CONFIG_KVM_GUEST) && defined(CONFIG_PARAVIRT_SPINLOCKS)
9 #include <asm/kvm_para.h>
10 #endif
11
main(void)12 int main(void)
13 {
14 #ifdef CONFIG_PARAVIRT
15 #ifdef CONFIG_PARAVIRT_XXL
16 OFFSET(PV_CPU_usergs_sysret64, paravirt_patch_template,
17 cpu.usergs_sysret64);
18 #ifdef CONFIG_DEBUG_ENTRY
19 OFFSET(PV_IRQ_save_fl, paravirt_patch_template, irq.save_fl);
20 #endif
21 #endif
22 BLANK();
23 #endif
24
25 #if defined(CONFIG_KVM_GUEST) && defined(CONFIG_PARAVIRT_SPINLOCKS)
26 OFFSET(KVM_STEAL_TIME_preempted, kvm_steal_time, preempted);
27 BLANK();
28 #endif
29
30 #define ENTRY(entry) OFFSET(pt_regs_ ## entry, pt_regs, entry)
31 ENTRY(bx);
32 ENTRY(cx);
33 ENTRY(dx);
34 ENTRY(sp);
35 ENTRY(bp);
36 ENTRY(si);
37 ENTRY(di);
38 ENTRY(r8);
39 ENTRY(r9);
40 ENTRY(r10);
41 ENTRY(r11);
42 ENTRY(r12);
43 ENTRY(r13);
44 ENTRY(r14);
45 ENTRY(r15);
46 ENTRY(flags);
47 BLANK();
48 #undef ENTRY
49
50 #define ENTRY(entry) OFFSET(saved_context_ ## entry, saved_context, entry)
51 ENTRY(cr0);
52 ENTRY(cr2);
53 ENTRY(cr3);
54 ENTRY(cr4);
55 ENTRY(gdt_desc);
56 BLANK();
57 #undef ENTRY
58
59 BLANK();
60
61 #ifdef CONFIG_STACKPROTECTOR
62 DEFINE(stack_canary_offset, offsetof(struct fixed_percpu_data, stack_canary));
63 BLANK();
64 #endif
65 return 0;
66 }
67