diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2023-08-14 14:46:03 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-08-14 14:46:03 +0300 |
commit | 15f63e306d96b702ce3e0d335e9ddf55972da32c (patch) | |
tree | 86bf3f16f1aac13f911c2736b996efc772ef274b /arch/powerpc/include/asm | |
parent | 7f96539437eafec8fd062fb13f31cf53251ea18d (diff) | |
parent | d1099e2276df1d8dd4037552c2f34eb4c4df4a75 (diff) | |
download | linux-15f63e306d96b702ce3e0d335e9ddf55972da32c.tar.xz |
Merge branch 'topic/cpu-smt' into next
Merge SMT changes we are sharing with the tip tree.
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r-- | arch/powerpc/include/asm/topology.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 8a4d4f4d9749..f4e6f2dd04b7 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h @@ -143,5 +143,20 @@ static inline int cpu_to_coregroup_id(int cpu) #endif #endif +#ifdef CONFIG_HOTPLUG_SMT +#include <linux/cpu_smt.h> +#include <asm/cputhreads.h> + +static inline bool topology_is_primary_thread(unsigned int cpu) +{ + return cpu == cpu_first_thread_sibling(cpu); +} + +static inline bool topology_smt_thread_allowed(unsigned int cpu) +{ + return cpu_thread_in_core(cpu) < cpu_smt_num_threads; +} +#endif + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_TOPOLOGY_H */ |