Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Redefine HMT_xxx macros as empty on PPC32

HMT_xxx macros are macros for adjusting thread priority
(hardware multi-threading) are macros inherited from PPC64
via commit 5f7c690728ac ("[PATCH] powerpc: Merged ppc_asm.h")

Those instructions are pointless on PPC32, but some common
fonctions like arch_cpu_idle() use them.

So make them empty on PPC32 to avoid those instructions.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/c5a07fadea33d640ad10cecf0ac8faaec1c524e0.1629898474.git.christophe.leroy@csgroup.eu

authored by

Christophe Leroy and committed by
Michael Ellerman
8149238f f50da6ed

+9
+9
arch/powerpc/include/asm/vdso/processor.h
··· 5 5 #ifndef __ASSEMBLY__ 6 6 7 7 /* Macros for adjusting thread priority (hardware multi-threading) */ 8 + #ifdef CONFIG_PPC64 8 9 #define HMT_very_low() asm volatile("or 31, 31, 31 # very low priority") 9 10 #define HMT_low() asm volatile("or 1, 1, 1 # low priority") 10 11 #define HMT_medium_low() asm volatile("or 6, 6, 6 # medium low priority") 11 12 #define HMT_medium() asm volatile("or 2, 2, 2 # medium priority") 12 13 #define HMT_medium_high() asm volatile("or 5, 5, 5 # medium high priority") 13 14 #define HMT_high() asm volatile("or 3, 3, 3 # high priority") 15 + #else 16 + #define HMT_very_low() 17 + #define HMT_low() 18 + #define HMT_medium_low() 19 + #define HMT_medium() 20 + #define HMT_medium_high() 21 + #define HMT_high() 22 + #endif 14 23 15 24 #ifdef CONFIG_PPC64 16 25 #define cpu_relax() do { HMT_low(); HMT_medium(); barrier(); } while (0)