.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Based on arch/arm/kernel/asm-offsets.c |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 1995-2003 Russell King |
---|
5 | 6 | * 2001-2002 Keith Owens |
---|
6 | 7 | * Copyright (C) 2012 ARM Ltd. |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License version 2 as |
---|
10 | | - * published by the Free Software Foundation. |
---|
11 | | - * |
---|
12 | | - * This program is distributed in the hope that it will be useful, |
---|
13 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
15 | | - * GNU General Public License for more details. |
---|
16 | | - * |
---|
17 | | - * You should have received a copy of the GNU General Public License |
---|
18 | | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
19 | 8 | */ |
---|
20 | 9 | |
---|
21 | 10 | #include <linux/arm_sdei.h> |
---|
.. | .. |
---|
25 | 14 | #include <linux/kvm_host.h> |
---|
26 | 15 | #include <linux/preempt.h> |
---|
27 | 16 | #include <linux/suspend.h> |
---|
28 | | -#include <vdso/datapage.h> |
---|
29 | 17 | #include <asm/cpufeature.h> |
---|
30 | 18 | #include <asm/fixmap.h> |
---|
31 | 19 | #include <asm/thread_info.h> |
---|
.. | .. |
---|
42 | 30 | BLANK(); |
---|
43 | 31 | DEFINE(TSK_TI_FLAGS, offsetof(struct task_struct, thread_info.flags)); |
---|
44 | 32 | DEFINE(TSK_TI_PREEMPT, offsetof(struct task_struct, thread_info.preempt_count)); |
---|
| 33 | + DEFINE(TSK_TI_PREEMPT_LAZY, offsetof(struct task_struct, thread_info.preempt_lazy_count)); |
---|
45 | 34 | DEFINE(TSK_TI_ADDR_LIMIT, offsetof(struct task_struct, thread_info.addr_limit)); |
---|
46 | 35 | #ifdef CONFIG_ARM64_SW_TTBR0_PAN |
---|
47 | 36 | DEFINE(TSK_TI_TTBR0, offsetof(struct task_struct, thread_info.ttbr0)); |
---|
48 | 37 | #endif |
---|
49 | 38 | #ifdef CONFIG_SHADOW_CALL_STACK |
---|
50 | | - DEFINE(TSK_TI_SCS, offsetof(struct task_struct, thread_info.shadow_call_stack)); |
---|
| 39 | + DEFINE(TSK_TI_SCS_BASE, offsetof(struct task_struct, thread_info.scs_base)); |
---|
| 40 | + DEFINE(TSK_TI_SCS_SP, offsetof(struct task_struct, thread_info.scs_sp)); |
---|
51 | 41 | #endif |
---|
52 | 42 | DEFINE(TSK_STACK, offsetof(struct task_struct, stack)); |
---|
| 43 | +#ifdef CONFIG_STACKPROTECTOR |
---|
| 44 | + DEFINE(TSK_STACK_CANARY, offsetof(struct task_struct, stack_canary)); |
---|
| 45 | +#endif |
---|
53 | 46 | BLANK(); |
---|
54 | 47 | DEFINE(THREAD_CPU_CONTEXT, offsetof(struct task_struct, thread.cpu_context)); |
---|
| 48 | + DEFINE(THREAD_SCTLR_USER, offsetof(struct task_struct, thread.sctlr_user)); |
---|
| 49 | +#ifdef CONFIG_ARM64_PTR_AUTH |
---|
| 50 | + DEFINE(THREAD_KEYS_USER, offsetof(struct task_struct, thread.keys_user)); |
---|
| 51 | + DEFINE(THREAD_KEYS_KERNEL, offsetof(struct task_struct, thread.keys_kernel)); |
---|
| 52 | +#endif |
---|
| 53 | +#ifdef CONFIG_ARM64_MTE |
---|
| 54 | + DEFINE(THREAD_MTE_CTRL, offsetof(struct task_struct, thread.mte_ctrl)); |
---|
| 55 | +#endif |
---|
55 | 56 | BLANK(); |
---|
56 | 57 | DEFINE(S_X0, offsetof(struct pt_regs, regs[0])); |
---|
57 | | - DEFINE(S_X1, offsetof(struct pt_regs, regs[1])); |
---|
58 | 58 | DEFINE(S_X2, offsetof(struct pt_regs, regs[2])); |
---|
59 | | - DEFINE(S_X3, offsetof(struct pt_regs, regs[3])); |
---|
60 | 59 | DEFINE(S_X4, offsetof(struct pt_regs, regs[4])); |
---|
61 | | - DEFINE(S_X5, offsetof(struct pt_regs, regs[5])); |
---|
62 | 60 | DEFINE(S_X6, offsetof(struct pt_regs, regs[6])); |
---|
63 | | - DEFINE(S_X7, offsetof(struct pt_regs, regs[7])); |
---|
64 | 61 | DEFINE(S_X8, offsetof(struct pt_regs, regs[8])); |
---|
65 | 62 | DEFINE(S_X10, offsetof(struct pt_regs, regs[10])); |
---|
66 | 63 | DEFINE(S_X12, offsetof(struct pt_regs, regs[12])); |
---|
.. | .. |
---|
72 | 69 | DEFINE(S_X24, offsetof(struct pt_regs, regs[24])); |
---|
73 | 70 | DEFINE(S_X26, offsetof(struct pt_regs, regs[26])); |
---|
74 | 71 | DEFINE(S_X28, offsetof(struct pt_regs, regs[28])); |
---|
| 72 | + DEFINE(S_FP, offsetof(struct pt_regs, regs[29])); |
---|
75 | 73 | DEFINE(S_LR, offsetof(struct pt_regs, regs[30])); |
---|
76 | 74 | DEFINE(S_SP, offsetof(struct pt_regs, sp)); |
---|
77 | | -#ifdef CONFIG_COMPAT |
---|
78 | | - DEFINE(S_COMPAT_SP, offsetof(struct pt_regs, compat_sp)); |
---|
79 | | -#endif |
---|
80 | 75 | DEFINE(S_PSTATE, offsetof(struct pt_regs, pstate)); |
---|
81 | 76 | DEFINE(S_PC, offsetof(struct pt_regs, pc)); |
---|
82 | | - DEFINE(S_ORIG_X0, offsetof(struct pt_regs, orig_x0)); |
---|
83 | 77 | DEFINE(S_SYSCALLNO, offsetof(struct pt_regs, syscallno)); |
---|
84 | 78 | DEFINE(S_ORIG_ADDR_LIMIT, offsetof(struct pt_regs, orig_addr_limit)); |
---|
| 79 | + DEFINE(S_PMR_SAVE, offsetof(struct pt_regs, pmr_save)); |
---|
85 | 80 | DEFINE(S_STACKFRAME, offsetof(struct pt_regs, stackframe)); |
---|
86 | 81 | DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs)); |
---|
87 | 82 | BLANK(); |
---|
.. | .. |
---|
99 | 94 | BLANK(); |
---|
100 | 95 | DEFINE(PAGE_SZ, PAGE_SIZE); |
---|
101 | 96 | BLANK(); |
---|
102 | | - DEFINE(DMA_BIDIRECTIONAL, DMA_BIDIRECTIONAL); |
---|
103 | 97 | DEFINE(DMA_TO_DEVICE, DMA_TO_DEVICE); |
---|
104 | 98 | DEFINE(DMA_FROM_DEVICE, DMA_FROM_DEVICE); |
---|
105 | 99 | BLANK(); |
---|
106 | 100 | DEFINE(PREEMPT_DISABLE_OFFSET, PREEMPT_DISABLE_OFFSET); |
---|
107 | | - BLANK(); |
---|
108 | | - DEFINE(CLOCK_REALTIME, CLOCK_REALTIME); |
---|
109 | | - DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC); |
---|
110 | | - DEFINE(CLOCK_MONOTONIC_RAW, CLOCK_MONOTONIC_RAW); |
---|
111 | | - DEFINE(CLOCK_REALTIME_RES, offsetof(struct vdso_data, hrtimer_res)); |
---|
112 | | - DEFINE(CLOCK_REALTIME_COARSE, CLOCK_REALTIME_COARSE); |
---|
113 | | - DEFINE(CLOCK_MONOTONIC_COARSE,CLOCK_MONOTONIC_COARSE); |
---|
114 | | - DEFINE(CLOCK_COARSE_RES, LOW_RES_NSEC); |
---|
115 | | - DEFINE(NSEC_PER_SEC, NSEC_PER_SEC); |
---|
116 | | - BLANK(); |
---|
117 | | - DEFINE(VDSO_SEQ, offsetof(struct vdso_data, seq)); |
---|
118 | | - DEFINE(VDSO_CLK_MODE, offsetof(struct vdso_data, clock_mode)); |
---|
119 | | - DEFINE(VDSO_CYCLE_LAST, offsetof(struct vdso_data, cycle_last)); |
---|
120 | | - DEFINE(VDSO_MASK, offsetof(struct vdso_data, mask)); |
---|
121 | | - DEFINE(VDSO_MULT, offsetof(struct vdso_data, mult)); |
---|
122 | | - DEFINE(VDSO_SHIFT, offsetof(struct vdso_data, shift)); |
---|
123 | | - DEFINE(VDSO_REALTIME_SEC, offsetof(struct vdso_data, basetime[CLOCK_REALTIME].sec)); |
---|
124 | | - DEFINE(VDSO_REALTIME_NSEC, offsetof(struct vdso_data, basetime[CLOCK_REALTIME].nsec)); |
---|
125 | | - DEFINE(VDSO_MONO_SEC, offsetof(struct vdso_data, basetime[CLOCK_MONOTONIC].sec)); |
---|
126 | | - DEFINE(VDSO_MONO_NSEC, offsetof(struct vdso_data, basetime[CLOCK_MONOTONIC].nsec)); |
---|
127 | | - DEFINE(VDSO_MONO_RAW_SEC, offsetof(struct vdso_data, basetime[CLOCK_MONOTONIC_RAW].sec)); |
---|
128 | | - DEFINE(VDSO_MONO_RAW_NSEC, offsetof(struct vdso_data, basetime[CLOCK_MONOTONIC_RAW].nsec)); |
---|
129 | | - DEFINE(VDSO_BOOTTIME_SEC, offsetof(struct vdso_data, basetime[CLOCK_BOOTTIME].sec)); |
---|
130 | | - DEFINE(VDSO_BOOTTIME_NSEC, offsetof(struct vdso_data, basetime[CLOCK_BOOTTIME].nsec)); |
---|
131 | | - DEFINE(VDSO_TAI_SEC, offsetof(struct vdso_data, basetime[CLOCK_TAI].sec)); |
---|
132 | | - DEFINE(VDSO_TAI_NSEC, offsetof(struct vdso_data, basetime[CLOCK_TAI].nsec)); |
---|
133 | | - DEFINE(VDSO_RT_COARSE_SEC, offsetof(struct vdso_data, basetime[CLOCK_REALTIME_COARSE].sec)); |
---|
134 | | - DEFINE(VDSO_RT_COARSE_NSEC, offsetof(struct vdso_data, basetime[CLOCK_REALTIME_COARSE].nsec)); |
---|
135 | | - DEFINE(VDSO_MONO_COARSE_SEC, offsetof(struct vdso_data, basetime[CLOCK_MONOTONIC_COARSE].sec)); |
---|
136 | | - DEFINE(VDSO_MONO_COARSE_NSEC, offsetof(struct vdso_data, basetime[CLOCK_MONOTONIC_COARSE].nsec)); |
---|
137 | | - DEFINE(VDSO_TZ_MINWEST, offsetof(struct vdso_data, tz_minuteswest)); |
---|
138 | | - DEFINE(VDSO_TZ_DSTTIME, offsetof(struct vdso_data, tz_dsttime)); |
---|
139 | | - BLANK(); |
---|
140 | | - DEFINE(TVAL_TV_SEC, offsetof(struct timeval, tv_sec)); |
---|
141 | | - DEFINE(TVAL_TV_USEC, offsetof(struct timeval, tv_usec)); |
---|
142 | | - DEFINE(TSPEC_TV_SEC, offsetof(struct timespec, tv_sec)); |
---|
143 | | - DEFINE(TSPEC_TV_NSEC, offsetof(struct timespec, tv_nsec)); |
---|
144 | | - BLANK(); |
---|
145 | | - DEFINE(TZ_MINWEST, offsetof(struct timezone, tz_minuteswest)); |
---|
146 | | - DEFINE(TZ_DSTTIME, offsetof(struct timezone, tz_dsttime)); |
---|
| 101 | + DEFINE(SOFTIRQ_SHIFT, SOFTIRQ_SHIFT); |
---|
| 102 | + DEFINE(IRQ_CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t, __softirq_pending)); |
---|
147 | 103 | BLANK(); |
---|
148 | 104 | DEFINE(CPU_BOOT_STACK, offsetof(struct secondary_data, stack)); |
---|
149 | 105 | DEFINE(CPU_BOOT_TASK, offsetof(struct secondary_data, task)); |
---|
150 | 106 | BLANK(); |
---|
151 | | -#ifdef CONFIG_KVM_ARM_HOST |
---|
| 107 | + DEFINE(FTR_OVR_VAL_OFFSET, offsetof(struct arm64_ftr_override, val)); |
---|
| 108 | + DEFINE(FTR_OVR_MASK_OFFSET, offsetof(struct arm64_ftr_override, mask)); |
---|
| 109 | + BLANK(); |
---|
| 110 | +#ifdef CONFIG_KVM |
---|
152 | 111 | DEFINE(VCPU_CONTEXT, offsetof(struct kvm_vcpu, arch.ctxt)); |
---|
153 | 112 | DEFINE(VCPU_FAULT_DISR, offsetof(struct kvm_vcpu, arch.fault.disr_el1)); |
---|
154 | 113 | DEFINE(VCPU_WORKAROUND_FLAGS, offsetof(struct kvm_vcpu, arch.workaround_flags)); |
---|
155 | | - DEFINE(CPU_GP_REGS, offsetof(struct kvm_cpu_context, gp_regs)); |
---|
156 | | - DEFINE(CPU_USER_PT_REGS, offsetof(struct kvm_regs, regs)); |
---|
157 | | - DEFINE(CPU_FP_REGS, offsetof(struct kvm_regs, fp_regs)); |
---|
158 | | - DEFINE(VCPU_FPEXC32_EL2, offsetof(struct kvm_vcpu, arch.ctxt.sys_regs[FPEXC32_EL2])); |
---|
159 | | - DEFINE(VCPU_HOST_CONTEXT, offsetof(struct kvm_vcpu, arch.host_cpu_context)); |
---|
| 114 | + DEFINE(VCPU_HCR_EL2, offsetof(struct kvm_vcpu, arch.hcr_el2)); |
---|
| 115 | + DEFINE(CPU_USER_PT_REGS, offsetof(struct kvm_cpu_context, regs)); |
---|
| 116 | + DEFINE(CPU_APIAKEYLO_EL1, offsetof(struct kvm_cpu_context, sys_regs[APIAKEYLO_EL1])); |
---|
| 117 | + DEFINE(CPU_APIBKEYLO_EL1, offsetof(struct kvm_cpu_context, sys_regs[APIBKEYLO_EL1])); |
---|
| 118 | + DEFINE(CPU_APDAKEYLO_EL1, offsetof(struct kvm_cpu_context, sys_regs[APDAKEYLO_EL1])); |
---|
| 119 | + DEFINE(CPU_APDBKEYLO_EL1, offsetof(struct kvm_cpu_context, sys_regs[APDBKEYLO_EL1])); |
---|
| 120 | + DEFINE(CPU_APGAKEYLO_EL1, offsetof(struct kvm_cpu_context, sys_regs[APGAKEYLO_EL1])); |
---|
160 | 121 | DEFINE(HOST_CONTEXT_VCPU, offsetof(struct kvm_cpu_context, __hyp_running_vcpu)); |
---|
| 122 | + DEFINE(HOST_DATA_CONTEXT, offsetof(struct kvm_host_data, host_ctxt)); |
---|
| 123 | + DEFINE(NVHE_INIT_MAIR_EL2, offsetof(struct kvm_nvhe_init_params, mair_el2)); |
---|
| 124 | + DEFINE(NVHE_INIT_TCR_EL2, offsetof(struct kvm_nvhe_init_params, tcr_el2)); |
---|
| 125 | + DEFINE(NVHE_INIT_TPIDR_EL2, offsetof(struct kvm_nvhe_init_params, tpidr_el2)); |
---|
| 126 | + DEFINE(NVHE_INIT_STACK_HYP_VA, offsetof(struct kvm_nvhe_init_params, stack_hyp_va)); |
---|
| 127 | + DEFINE(NVHE_INIT_PGD_PA, offsetof(struct kvm_nvhe_init_params, pgd_pa)); |
---|
| 128 | + DEFINE(NVHE_INIT_HCR_EL2, offsetof(struct kvm_nvhe_init_params, hcr_el2)); |
---|
| 129 | + DEFINE(NVHE_INIT_VTTBR, offsetof(struct kvm_nvhe_init_params, vttbr)); |
---|
| 130 | + DEFINE(NVHE_INIT_VTCR, offsetof(struct kvm_nvhe_init_params, vtcr)); |
---|
161 | 131 | #endif |
---|
162 | 132 | #ifdef CONFIG_CPU_PM |
---|
163 | | - DEFINE(CPU_SUSPEND_SZ, sizeof(struct cpu_suspend_ctx)); |
---|
164 | 133 | DEFINE(CPU_CTX_SP, offsetof(struct cpu_suspend_ctx, sp)); |
---|
165 | 134 | DEFINE(MPIDR_HASH_MASK, offsetof(struct mpidr_hash, mask)); |
---|
166 | 135 | DEFINE(MPIDR_HASH_SHIFTS, offsetof(struct mpidr_hash, shift_aff)); |
---|
.. | .. |
---|
184 | 153 | DEFINE(SDEI_EVENT_INTREGS, offsetof(struct sdei_registered_event, interrupted_regs)); |
---|
185 | 154 | DEFINE(SDEI_EVENT_PRIORITY, offsetof(struct sdei_registered_event, priority)); |
---|
186 | 155 | #endif |
---|
| 156 | +#ifdef CONFIG_ARM64_PTR_AUTH |
---|
| 157 | + DEFINE(PTRAUTH_USER_KEY_APIA, offsetof(struct ptrauth_keys_user, apia)); |
---|
| 158 | + DEFINE(PTRAUTH_KERNEL_KEY_APIA, offsetof(struct ptrauth_keys_kernel, apia)); |
---|
| 159 | + BLANK(); |
---|
| 160 | +#endif |
---|
187 | 161 | return 0; |
---|
188 | 162 | } |
---|