hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/arch/powerpc/include/asm/cputhreads.h
....@@ -28,6 +28,7 @@
2828 #define threads_per_core 1
2929 #define threads_per_subcore 1
3030 #define threads_shift 0
31
+#define has_big_cores 0
3132 #define threads_core_mask (*get_cpu_mask(0))
3233 #endif
3334
....@@ -97,6 +98,36 @@
9798 return cpu | (threads_per_core - 1);
9899 }
99100
101
+/*
102
+ * tlb_thread_siblings are siblings which share a TLB. This is not
103
+ * architected, is not something a hypervisor could emulate and a future
104
+ * CPU may change behaviour even in compat mode, so this should only be
105
+ * used on PowerNV, and only with care.
106
+ */
107
+static inline int cpu_first_tlb_thread_sibling(int cpu)
108
+{
109
+ if (cpu_has_feature(CPU_FTR_ARCH_300) && (threads_per_core == 8))
110
+ return cpu & ~0x6; /* Big Core */
111
+ else
112
+ return cpu_first_thread_sibling(cpu);
113
+}
114
+
115
+static inline int cpu_last_tlb_thread_sibling(int cpu)
116
+{
117
+ if (cpu_has_feature(CPU_FTR_ARCH_300) && (threads_per_core == 8))
118
+ return cpu | 0x6; /* Big Core */
119
+ else
120
+ return cpu_last_thread_sibling(cpu);
121
+}
122
+
123
+static inline int cpu_tlb_thread_sibling_step(void)
124
+{
125
+ if (cpu_has_feature(CPU_FTR_ARCH_300) && (threads_per_core == 8))
126
+ return 2; /* Big Core */
127
+ else
128
+ return 1;
129
+}
130
+
100131 static inline u32 get_tensr(void)
101132 {
102133 #ifdef CONFIG_BOOKE