diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> | 2020-12-14 13:31:21 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-12-14 23:12:27 +1100 |
commit | 44b4c4450f8d31296ba633d74be753a85fd627bd (patch) | |
tree | 80687fa4c6f9839e6e2867fa609baae4ef00d0d0 /arch/powerpc/mm/book3s64 | |
parent | dddc4ef92d1ce92987da1d6926cdfa99e8acb622 (diff) |
powerpc/64s: Mark the kuap/kuep functions non __init
The kernel calls these functions on CPU online and hence they must not
be marked __init.
Otherwise if the memory they occupied has been reused the system can
crash in various ways. Sachin reported it caused his LPAR to
spontaneously restart with no other output. With xmon enabled it may
drop into xmon with a dump like:
cpu 0x1: Vector: 700 (Program Check) at [c000000003c5fcb0]
pc: 00000000011e0a78
lr: 00000000011c51d4
sp: c000000003c5ff50
msr: 8000000000081001
current = 0xc000000002c12b00
paca = 0xc000000003cff280 irqmask: 0x03 irq_happened: 0x01
pid = 0, comm = swapper/1
...
[c000000003c5ff50] 0000000000087c38 (unreliable)
[c000000003c5ff70] 000000000003870c
[c000000003c5ff90] 000000000000d108
Fixes: 3b47b7549ead ("powerpc/book3s64/kuap: Move KUAP related function outside radix")
Reported-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
[mpe: Expand change log with details and xmon output]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201214080121.358567-1-aneesh.kumar@linux.ibm.com
Diffstat (limited to 'arch/powerpc/mm/book3s64')
-rw-r--r-- | arch/powerpc/mm/book3s64/pkeys.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index 2b7ded396db4..f1c6f264ed91 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++ b/arch/powerpc/mm/book3s64/pkeys.c @@ -251,7 +251,7 @@ out: } #ifdef CONFIG_PPC_KUEP -void __init setup_kuep(bool disabled) +void setup_kuep(bool disabled) { if (disabled) return; @@ -277,7 +277,7 @@ void __init setup_kuep(bool disabled) #endif #ifdef CONFIG_PPC_KUAP -void __init setup_kuap(bool disabled) +void setup_kuap(bool disabled) { if (disabled) return; |