diff options
| author | Nicholas Piggin <npiggin@gmail.com> | 2018-06-12 05:38:08 -0400 |
|---|---|---|
| committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-06-19 19:13:25 -0400 |
| commit | 758380b8155f69b4e2f77f27562f8a7a466749d6 (patch) | |
| tree | 0af02cb69c005b84975989068e21693134f50b1b | |
| parent | e08ecba17b72aeb01859601bc242a5bc48620109 (diff) | |
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")
Cc: stable@kernel.org
Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
Tested-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
| -rw-r--r-- | arch/powerpc/mm/tlb-radix.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/mm/tlb-radix.c b/arch/powerpc/mm/tlb-radix.c index a734e486664d..1135b43a597c 100644 --- a/arch/powerpc/mm/tlb-radix.c +++ b/arch/powerpc/mm/tlb-radix.c | |||
| @@ -1097,6 +1097,8 @@ extern void radix_kvm_prefetch_workaround(struct mm_struct *mm) | |||
| 1097 | for (; sib <= cpu_last_thread_sibling(cpu) && !flush; sib++) { | 1097 | for (; sib <= cpu_last_thread_sibling(cpu) && !flush; sib++) { |
| 1098 | if (sib == cpu) | 1098 | if (sib == cpu) |
| 1099 | continue; | 1099 | continue; |
| 1100 | if (!cpu_possible(sib)) | ||
| 1101 | continue; | ||
| 1100 | if (paca_ptrs[sib]->kvm_hstate.kvm_vcpu) | 1102 | if (paca_ptrs[sib]->kvm_hstate.kvm_vcpu) |
| 1101 | flush = true; | 1103 | flush = true; |
| 1102 | } | 1104 | } |
