hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/arch/powerpc/include/asm/paca.h
....@@ -1,14 +1,10 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * This control block defines the PACA which defines the processor
34 * specific data for each logical processor on the system.
45 * There are some pointers defined that are utilized by PLIC.
56 *
67 * C 2001 PPC 64 Team, IBM Corp
7
- *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU General Public License
10
- * as published by the Free Software Foundation; either version
11
- * 2 of the License, or (at your option) any later version.
128 */
139 #ifndef _ASM_POWERPC_PACA_H
1410 #define _ASM_POWERPC_PACA_H
....@@ -34,6 +30,8 @@
3430 #include <asm/cpuidle.h>
3531 #include <asm/atomic.h>
3632
33
+#include <asm-generic/mmiowb_types.h>
34
+
3735 register struct paca_struct *local_paca asm("r13");
3836
3937 #if defined(CONFIG_DEBUG_PREEMPT) && defined(CONFIG_SMP)
....@@ -54,6 +52,7 @@
5452 #define get_slb_shadow() (get_paca()->slb_shadow_ptr)
5553
5654 struct task_struct;
55
+struct rtas_args;
5756
5857 /*
5958 * Defines the layout of the paca.
....@@ -113,7 +112,13 @@
113112 * on the linear mapping */
114113 /* SLB related definitions */
115114 u16 vmalloc_sllp;
116
- u16 slb_cache_ptr;
115
+ u8 slb_cache_ptr;
116
+ u8 stab_rr; /* stab/slb round-robin counter */
117
+#ifdef CONFIG_DEBUG_VM
118
+ u8 in_kernel_slb_handler;
119
+#endif
120
+ u32 slb_used_bitmap; /* Bitmaps for first 32 SLB entries. */
121
+ u32 slb_kern_bitmap;
117122 u32 slb_cache[SLB_CACHE_ENTRIES];
118123 #endif /* CONFIG_PPC_BOOK3S_64 */
119124
....@@ -160,15 +165,14 @@
160165 */
161166 struct task_struct *__current; /* Pointer to current */
162167 u64 kstack; /* Saved Kernel stack addr */
163
- u64 stab_rr; /* stab/slb round-robin counter */
164168 u64 saved_r1; /* r1 save for RTAS calls or PM or EE=0 */
165169 u64 saved_msr; /* MSR saved here by enter_rtas */
170
+#ifdef CONFIG_PPC_BOOK3E
166171 u16 trap_save; /* Used when bad stack is encountered */
172
+#endif
167173 u8 irq_soft_mask; /* mask for irq soft masking */
168174 u8 irq_happened; /* irq happened while soft-disabled */
169
- u8 io_sync; /* writel() needs spin_unlock sync */
170175 u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */
171
- u8 nap_state_lost; /* NV GPR values lost in power7_idle */
172176 #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
173177 u8 pmcregs_in_use; /* pseries puts this in lppaca */
174178 #endif
....@@ -178,23 +182,28 @@
178182 #endif
179183
180184 #ifdef CONFIG_PPC_POWERNV
181
- /* Per-core mask tracking idle threads and a lock bit-[L][TTTTTTTT] */
182
- u32 *core_idle_state_ptr;
183
- u8 thread_idle_state; /* PNV_THREAD_RUNNING/NAP/SLEEP */
184
- /* Mask to indicate thread id in core */
185
- u8 thread_mask;
186
- /* Mask to denote subcore sibling threads */
187
- u8 subcore_sibling_mask;
188
- /* Flag to request this thread not to stop */
189
- atomic_t dont_stop;
190
- /* The PSSCR value that the kernel requested before going to stop */
191
- u64 requested_psscr;
185
+ /* PowerNV idle fields */
186
+ /* PNV_CORE_IDLE_* bits, all siblings work on thread 0 paca */
187
+ unsigned long idle_state;
188
+ union {
189
+ /* P7/P8 specific fields */
190
+ struct {
191
+ /* PNV_THREAD_RUNNING/NAP/SLEEP */
192
+ u8 thread_idle_state;
193
+ /* Mask to denote subcore sibling threads */
194
+ u8 subcore_sibling_mask;
195
+ };
192196
193
- /*
194
- * Save area for additional SPRs that need to be
195
- * saved/restored during cpuidle stop.
196
- */
197
- struct stop_sprs stop_sprs;
197
+ /* P9 specific fields */
198
+ struct {
199
+#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
200
+ /* The PSSCR value that the kernel requested before going to stop */
201
+ u64 requested_psscr;
202
+ /* Flag to request this thread not to stop */
203
+ atomic_t dont_stop;
204
+#endif
205
+ };
206
+ };
198207 #endif
199208
200209 #ifdef CONFIG_PPC_BOOK3S_64
....@@ -216,6 +225,7 @@
216225 u16 in_mce;
217226 u8 hmi_event_available; /* HMI event is available */
218227 u8 hmi_p9_special_emu; /* HMI P9 special emulation */
228
+ u32 hmi_irqs; /* HMI irq stat */
219229 #endif
220230 u8 ftrace_enabled; /* Hard disable ftrace */
221231
....@@ -248,8 +258,21 @@
248258 u64 l1d_flush_size;
249259 #endif
250260 #ifdef CONFIG_PPC_PSERIES
261
+ struct rtas_args *rtas_args_reentrant;
251262 u8 *mce_data_buf; /* buffer to hold per cpu rtas errlog */
252263 #endif /* CONFIG_PPC_PSERIES */
264
+
265
+#ifdef CONFIG_PPC_BOOK3S_64
266
+ /* Capture SLB related old contents in MCE handler. */
267
+ struct slb_entry *mce_faulty_slbs;
268
+ u16 slb_save_cache_ptr;
269
+#endif /* CONFIG_PPC_BOOK3S_64 */
270
+#ifdef CONFIG_STACKPROTECTOR
271
+ unsigned long canary;
272
+#endif
273
+#ifdef CONFIG_MMIOWB
274
+ struct mmiowb_state mmiowb_state;
275
+#endif
253276 } ____cacheline_aligned;
254277
255278 extern void copy_mm_to_paca(struct mm_struct *mm);