All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/64s/radix: Fix radix_kvm_prefetch_workaround paca access of not possible CPU
@ 2018-06-12  9:38 Nicholas Piggin
  2018-06-23 12:56 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Piggin @ 2018-06-12  9:38 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nicholas Piggin, Pridhiviraj Paidipeddi, stable

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>

---
[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(+)

diff --git a/arch/powerpc/mm/tlb-radix.c b/arch/powerpc/mm/tlb-radix.c
index 67a6e86d3e7e..06ea845d8033 100644
--- a/arch/powerpc/mm/tlb-radix.c
+++ b/arch/powerpc/mm/tlb-radix.c
@@ -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;
 		}
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: powerpc/64s/radix: Fix radix_kvm_prefetch_workaround paca access of not possible CPU
  2018-06-12  9:38 [PATCH] powerpc/64s/radix: Fix radix_kvm_prefetch_workaround paca access of not possible CPU Nicholas Piggin
@ 2018-06-23 12:56 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-06-23 12:56 UTC (permalink / raw)
  To: Nicholas Piggin, linuxppc-dev
  Cc: stable, Nicholas Piggin, Pridhiviraj Paidipeddi

On Tue, 2018-06-12 at 09:38:08 UTC, Nicholas Piggin wrote:
> 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>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/758380b8155f69b4e2f77f27562f8a

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-23 12:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12  9:38 [PATCH] powerpc/64s/radix: Fix radix_kvm_prefetch_workaround paca access of not possible CPU Nicholas Piggin
2018-06-23 12:56 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.