diff options
author | Srikar Dronamraju <srikar@linux.vnet.ibm.com> | 2019-12-05 14:02:18 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-12-13 21:07:45 +1100 |
commit | 656c21d6af5d9279dd7b51ca7a4a71008127044b (patch) | |
tree | 4c68f89be4f658b948b21fb51cd92d6e119273af /arch | |
parent | 14c73bd344da60abaf7da3ea2e7733ddda35bbac (diff) | |
download | linux-stable-656c21d6af5d9279dd7b51ca7a4a71008127044b.tar.gz linux-stable-656c21d6af5d9279dd7b51ca7a4a71008127044b.tar.bz2 linux-stable-656c21d6af5d9279dd7b51ca7a4a71008127044b.zip |
powerpc/shared: Use static key to detect shared processor
With the static key shared processor available, is_shared_processor()
can return without having to query the lppaca structure.
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Acked-by: Phil Auld <pauld@redhat.com>
Acked-by: Waiman Long <longman@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191213035036.6913-2-mpe@ellerman.id.au
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/include/asm/spinlock.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h index cac95a3f30c2..1b55fc08f853 100644 --- a/arch/powerpc/include/asm/spinlock.h +++ b/arch/powerpc/include/asm/spinlock.h @@ -112,13 +112,8 @@ static inline void splpar_rw_yield(arch_rwlock_t *lock) {}; static inline bool is_shared_processor(void) { -/* - * LPPACA is only available on Pseries so guard anything LPPACA related to - * allow other platforms (which include this common header) to compile. - */ -#ifdef CONFIG_PPC_PSERIES - return (IS_ENABLED(CONFIG_PPC_SPLPAR) && - lppaca_shared_proc(local_paca->lppaca_ptr)); +#ifdef CONFIG_PPC_SPLPAR + return static_branch_unlikely(&shared_processor); #else return false; #endif |