powerpc/64s/radix: Fix radix_kvm_prefetch_workaround paca access of not possible CPU
Nicholas Piggin
reviewerPATCH 1/1 powerpc/64s/radix: Fix radix_kvm_prefetch_workaround paca access of not possible CPU
If possible CPUs are limited (e.g., by kexec), then the kvm prefetch workaround function can access the paca pointer for a !possible CPU.
Fixes d2e60075a3d44 ("powerpc/64: Use array of paca pointers and allocate pacas individually")
Reported-by Pridhiviraj Paidipeddi <[email protected]>
Signed-off-by Nicholas Piggin <[email protected]>
---
[kdump still seems to have a problem upstream, but this solves one crash]
arch/powerpc/mm/tlb-radix.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/mm/tlb-radix.c +2 -0
@@ -1043,6 +1043,8 @@ extern void radix_kvm_prefetch_workaround(struct mm_struct *mm)for (; sib <=cpu_last_thread_sibling (cpu) && !flush; sib++) {if (sib == cpu)continue ; +if (!cpu_possible (sib)) +continue ;if (paca_ptrs[sib]->kvm_hstate.kvm_vcpu) flush = true; }
Signature · 1 line
2.17.0
Michael Ellerman
AppliedQuoted 8 lines · Nicholas Piggin
If possible CPUs are limited (e.g., by kexec), then the kvm prefetch workaround function can access the paca pointer for a !possible CPU.
Fixes d2e60075a3d44 ("powerpc/64: Use array of paca pointers and allocate pacas individually")Reported-by Pridhiviraj Paidipeddi <[email protected]>Signed-off-by Nicholas Piggin <[email protected]>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/758380b8155f69b4e2f77f27562f8a
cheers