diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-08-13 04:33:43 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-08-31 07:25:59 +0300 |
commit | b68b1d7487195d17bdd7e06f183acfb896eafcc7 (patch) | |
tree | f2cfc8a9e3426604191c19e94af1e33ef6172930 /arch/powerpc/kernel/paca.c | |
parent | d55071905ee1719094c66dd3c40e2a9ef5c65eaf (diff) | |
download | linux-b68b1d7487195d17bdd7e06f183acfb896eafcc7.tar.xz |
powerpc/64s/radix: Do not allocate SLB shadow structures
These are unused in radix mode.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/paca.c')
-rw-r--r-- | arch/powerpc/kernel/paca.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index 8d63627e067f..70f073d6c3b2 100644 --- a/arch/powerpc/kernel/paca.c +++ b/arch/powerpc/kernel/paca.c @@ -99,18 +99,27 @@ static inline void free_lppacas(void) { } * If you make the number of persistent SLB entries dynamic, please also * update PR KVM to flush and restore them accordingly. */ -static struct slb_shadow *slb_shadow; +static struct slb_shadow * __initdata slb_shadow; static void __init allocate_slb_shadows(int nr_cpus, int limit) { int size = PAGE_ALIGN(sizeof(struct slb_shadow) * nr_cpus); + + if (early_radix_enabled()) + return; + slb_shadow = __va(memblock_alloc_base(size, PAGE_SIZE, limit)); memset(slb_shadow, 0, size); } static struct slb_shadow * __init init_slb_shadow(int cpu) { - struct slb_shadow *s = &slb_shadow[cpu]; + struct slb_shadow *s; + + if (early_radix_enabled()) + return NULL; + + s = &slb_shadow[cpu]; /* * When we come through here to initialise boot_paca, the slb_shadow |