hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
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
....@@ -16,9 +12,9 @@
1612
1713 #ifdef CONFIG_PPC64
1814
15
+#include <linux/cache.h>
1916 #include <linux/string.h>
2017 #include <asm/types.h>
21
-#include <asm/lppaca.h>
2218 #include <asm/mmu.h>
2319 #include <asm/page.h>
2420 #ifdef CONFIG_PPC_BOOK3E
....@@ -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)
....@@ -47,13 +45,11 @@
4745 #define get_paca() local_paca
4846 #endif
4947
50
-#ifdef CONFIG_PPC_PSERIES
51
-#define get_lppaca() (get_paca()->lppaca_ptr)
52
-#endif
53
-
5448 #define get_slb_shadow() (get_paca()->slb_shadow_ptr)
5549
5650 struct task_struct;
51
+struct rtas_args;
52
+struct lppaca;
5753
5854 /*
5955 * Defines the layout of the paca.
....@@ -113,7 +109,13 @@
113109 * on the linear mapping */
114110 /* SLB related definitions */
115111 u16 vmalloc_sllp;
116
- u16 slb_cache_ptr;
112
+ u8 slb_cache_ptr;
113
+ u8 stab_rr; /* stab/slb round-robin counter */
114
+#ifdef CONFIG_DEBUG_VM
115
+ u8 in_kernel_slb_handler;
116
+#endif
117
+ u32 slb_used_bitmap; /* Bitmaps for first 32 SLB entries. */
118
+ u32 slb_kern_bitmap;
117119 u32 slb_cache[SLB_CACHE_ENTRIES];
118120 #endif /* CONFIG_PPC_BOOK3S_64 */
119121
....@@ -160,15 +162,14 @@
160162 */
161163 struct task_struct *__current; /* Pointer to current */
162164 u64 kstack; /* Saved Kernel stack addr */
163
- u64 stab_rr; /* stab/slb round-robin counter */
164165 u64 saved_r1; /* r1 save for RTAS calls or PM or EE=0 */
165166 u64 saved_msr; /* MSR saved here by enter_rtas */
167
+#ifdef CONFIG_PPC_BOOK3E
166168 u16 trap_save; /* Used when bad stack is encountered */
169
+#endif
167170 u8 irq_soft_mask; /* mask for irq soft masking */
168171 u8 irq_happened; /* irq happened while soft-disabled */
169
- u8 io_sync; /* writel() needs spin_unlock sync */
170172 u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */
171
- u8 nap_state_lost; /* NV GPR values lost in power7_idle */
172173 #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
173174 u8 pmcregs_in_use; /* pseries puts this in lppaca */
174175 #endif
....@@ -178,23 +179,28 @@
178179 #endif
179180
180181 #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;
182
+ /* PowerNV idle fields */
183
+ /* PNV_CORE_IDLE_* bits, all siblings work on thread 0 paca */
184
+ unsigned long idle_state;
185
+ union {
186
+ /* P7/P8 specific fields */
187
+ struct {
188
+ /* PNV_THREAD_RUNNING/NAP/SLEEP */
189
+ u8 thread_idle_state;
190
+ /* Mask to denote subcore sibling threads */
191
+ u8 subcore_sibling_mask;
192
+ };
192193
193
- /*
194
- * Save area for additional SPRs that need to be
195
- * saved/restored during cpuidle stop.
196
- */
197
- struct stop_sprs stop_sprs;
194
+ /* P9 specific fields */
195
+ struct {
196
+#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
197
+ /* The PSSCR value that the kernel requested before going to stop */
198
+ u64 requested_psscr;
199
+ /* Flag to request this thread not to stop */
200
+ atomic_t dont_stop;
201
+#endif
202
+ };
203
+ };
198204 #endif
199205
200206 #ifdef CONFIG_PPC_BOOK3S_64
....@@ -216,6 +222,7 @@
216222 u16 in_mce;
217223 u8 hmi_event_available; /* HMI event is available */
218224 u8 hmi_p9_special_emu; /* HMI P9 special emulation */
225
+ u32 hmi_irqs; /* HMI irq stat */
219226 #endif
220227 u8 ftrace_enabled; /* Hard disable ftrace */
221228
....@@ -248,8 +255,21 @@
248255 u64 l1d_flush_size;
249256 #endif
250257 #ifdef CONFIG_PPC_PSERIES
258
+ struct rtas_args *rtas_args_reentrant;
251259 u8 *mce_data_buf; /* buffer to hold per cpu rtas errlog */
252260 #endif /* CONFIG_PPC_PSERIES */
261
+
262
+#ifdef CONFIG_PPC_BOOK3S_64
263
+ /* Capture SLB related old contents in MCE handler. */
264
+ struct slb_entry *mce_faulty_slbs;
265
+ u16 slb_save_cache_ptr;
266
+#endif /* CONFIG_PPC_BOOK3S_64 */
267
+#ifdef CONFIG_STACKPROTECTOR
268
+ unsigned long canary;
269
+#endif
270
+#ifdef CONFIG_MMIOWB
271
+ struct mmiowb_state mmiowb_state;
272
+#endif
253273 } ____cacheline_aligned;
254274
255275 extern void copy_mm_to_paca(struct mm_struct *mm);