hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/x86/kernel/asm-offsets.c
....@@ -29,17 +29,13 @@
2929 # include "asm-offsets_64.c"
3030 #endif
3131
32
-void common(void) {
32
+static void __used common(void)
33
+{
3334 BLANK();
3435 OFFSET(TASK_threadsp, task_struct, thread.sp);
3536 #ifdef CONFIG_STACKPROTECTOR
3637 OFFSET(TASK_stack_canary, task_struct, stack_canary);
3738 #endif
38
-
39
- BLANK();
40
- OFFSET(TASK_TI_flags, task_struct, thread_info.flags);
41
- OFFSET(TASK_TI_preempt_lazy_count, task_struct, thread_info.preempt_lazy_count);
42
- OFFSET(TASK_addr_limit, task_struct, thread.addr_limit);
4339
4440 BLANK();
4541 OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
....@@ -65,21 +61,19 @@
6561 OFFSET(IA32_RT_SIGFRAME_sigcontext, rt_sigframe_ia32, uc.uc_mcontext);
6662 #endif
6763
68
-#ifdef CONFIG_PARAVIRT
64
+#ifdef CONFIG_PARAVIRT_XXL
6965 BLANK();
70
- OFFSET(PARAVIRT_PATCH_pv_cpu_ops, paravirt_patch_template, pv_cpu_ops);
71
- OFFSET(PARAVIRT_PATCH_pv_irq_ops, paravirt_patch_template, pv_irq_ops);
72
- OFFSET(PV_IRQ_irq_disable, pv_irq_ops, irq_disable);
73
- OFFSET(PV_IRQ_irq_enable, pv_irq_ops, irq_enable);
74
- OFFSET(PV_CPU_iret, pv_cpu_ops, iret);
75
- OFFSET(PV_CPU_read_cr0, pv_cpu_ops, read_cr0);
76
- OFFSET(PV_MMU_read_cr2, pv_mmu_ops, read_cr2);
66
+ OFFSET(PV_IRQ_irq_disable, paravirt_patch_template, irq.irq_disable);
67
+ OFFSET(PV_IRQ_irq_enable, paravirt_patch_template, irq.irq_enable);
68
+ OFFSET(PV_CPU_iret, paravirt_patch_template, cpu.iret);
69
+ OFFSET(PV_MMU_read_cr2, paravirt_patch_template, mmu.read_cr2);
7770 #endif
7871
7972 #ifdef CONFIG_XEN
8073 BLANK();
8174 OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
8275 OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending);
76
+ OFFSET(XEN_vcpu_info_arch_cr2, vcpu_info, arch.cr2);
8377 #endif
8478
8579 BLANK();
....@@ -91,23 +85,20 @@
9185 OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
9286 OFFSET(BP_init_size, boot_params, hdr.init_size);
9387 OFFSET(BP_pref_address, boot_params, hdr.pref_address);
94
- OFFSET(BP_code32_start, boot_params, hdr.code32_start);
9588
9689 BLANK();
9790 DEFINE(PTREGS_SIZE, sizeof(struct pt_regs));
98
- DEFINE(_PREEMPT_ENABLED, PREEMPT_ENABLED);
9991
10092 /* TLB state for the entry code */
10193 OFFSET(TLB_STATE_user_pcid_flush_mask, tlb_state, user_pcid_flush_mask);
10294
10395 /* Layout info for cpu_entry_area */
104
- OFFSET(CPU_ENTRY_AREA_tss, cpu_entry_area, tss);
105
- OFFSET(CPU_ENTRY_AREA_entry_trampoline, cpu_entry_area, entry_trampoline);
10696 OFFSET(CPU_ENTRY_AREA_entry_stack, cpu_entry_area, entry_stack_page);
10797 DEFINE(SIZEOF_entry_stack, sizeof(struct entry_stack));
10898 DEFINE(MASK_entry_stack, (~(sizeof(struct entry_stack) - 1)));
10999
110
- /* Offset for sp0 and sp1 into the tss_struct */
100
+ /* Offset for fields in tss_struct */
111101 OFFSET(TSS_sp0, tss_struct, x86_tss.sp0);
112102 OFFSET(TSS_sp1, tss_struct, x86_tss.sp1);
103
+ OFFSET(TSS_sp2, tss_struct, x86_tss.sp2);
113104 }