From e49a52f0cc028acbe41ea7aaee67b2f68f7a7d5b Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Tue, 4 Aug 2020 23:02:15 +0530 Subject: chip: Fix pir_to_thread_id for fused cores pir_to_core_id() and pir_to_thread_id() are extensively used by the direct controls code and are expected to return the "normal" (non-fused, aka EC) core/thread IDs. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Michael Neuling Signed-off-by: Vaidyanathan Srinivasan Signed-off-by: Oliver O'Halloran --- include/chip.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/chip.h') diff --git a/include/chip.h b/include/chip.h index 38fafcf..2063cd2 100644 --- a/include/chip.h +++ b/include/chip.h @@ -98,6 +98,8 @@ (P9_PIR2FUSEDCOREID(pir) << 1) | \ (P9_PIR2FUSEDTHREADID(pir) & 1) +#define P9_PIRFUSED2NORMALTHREADID(pir) (((pir) >> 1) & 0x3) + /* P9 specific ones mostly used by XIVE */ #define P9_PIR2LOCALCPU(pir) ((pir) & 0xff) #define P9_PIRFROMLOCALCPU(chip, cpu) (((chip) << 8) | (cpu)) @@ -229,6 +231,11 @@ struct proc_chip { }; extern uint32_t pir_to_chip_id(uint32_t pir); + +/* + * Note: In P9 fused-core mode, these will return the "normal" + * core ID and thread ID (ie, thread ID 0..3) + */ extern uint32_t pir_to_core_id(uint32_t pir); extern uint32_t pir_to_thread_id(uint32_t pir); -- cgit v1.1