Commit 7b65b798 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'powerpc-5.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
 "Fix KVM using a Power9 instruction on earlier CPUs, which could lead
  to the host SLB being incorrectly invalidated and a subsequent host
  crash.

  Fix kernel hardlockup on vmap stack overflow on 32-bit.

  Thanks to Christophe Leroy, Nicholas Piggin, and Fabiano Rosas"

* tag 'powerpc-5.16-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/32: Fix hardlockup on vmap stack overflow
  KVM: PPC: Book3S HV: Prevent POWER7/8 TLB flush flushing SLB
parents 6be08803 5bb60ea6
...@@ -202,11 +202,11 @@ _ASM_NOKPROBE_SYMBOL(\name\()_virt) ...@@ -202,11 +202,11 @@ _ASM_NOKPROBE_SYMBOL(\name\()_virt)
mfspr r1, SPRN_SPRG_THREAD mfspr r1, SPRN_SPRG_THREAD
lwz r1, TASK_CPU - THREAD(r1) lwz r1, TASK_CPU - THREAD(r1)
slwi r1, r1, 3 slwi r1, r1, 3
addis r1, r1, emergency_ctx@ha addis r1, r1, emergency_ctx-PAGE_OFFSET@ha
#else #else
lis r1, emergency_ctx@ha lis r1, emergency_ctx-PAGE_OFFSET@ha
#endif #endif
lwz r1, emergency_ctx@l(r1) lwz r1, emergency_ctx-PAGE_OFFSET@l(r1)
addi r1, r1, THREAD_SIZE - INT_FRAME_SIZE addi r1, r1, THREAD_SIZE - INT_FRAME_SIZE
EXCEPTION_PROLOG_2 0 vmap_stack_overflow EXCEPTION_PROLOG_2 0 vmap_stack_overflow
prepare_transfer_to_handler prepare_transfer_to_handler
......
...@@ -695,6 +695,7 @@ static void flush_guest_tlb(struct kvm *kvm) ...@@ -695,6 +695,7 @@ static void flush_guest_tlb(struct kvm *kvm)
"r" (0) : "memory"); "r" (0) : "memory");
} }
asm volatile("ptesync": : :"memory"); asm volatile("ptesync": : :"memory");
// POWER9 congruence-class TLBIEL leaves ERAT. Flush it now.
asm volatile(PPC_RADIX_INVALIDATE_ERAT_GUEST : : :"memory"); asm volatile(PPC_RADIX_INVALIDATE_ERAT_GUEST : : :"memory");
} else { } else {
for (set = 0; set < kvm->arch.tlb_sets; ++set) { for (set = 0; set < kvm->arch.tlb_sets; ++set) {
...@@ -705,6 +706,8 @@ static void flush_guest_tlb(struct kvm *kvm) ...@@ -705,6 +706,8 @@ static void flush_guest_tlb(struct kvm *kvm)
rb += PPC_BIT(51); /* increment set number */ rb += PPC_BIT(51); /* increment set number */
} }
asm volatile("ptesync": : :"memory"); asm volatile("ptesync": : :"memory");
// POWER9 congruence-class TLBIEL leaves ERAT. Flush it now.
if (cpu_has_feature(CPU_FTR_ARCH_300))
asm volatile(PPC_ISA_3_0_INVALIDATE_ERAT : : :"memory"); asm volatile(PPC_ISA_3_0_INVALIDATE_ERAT : : :"memory");
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment