Commit 51bfd2998113e1f8ce8dcf853407b76a04b5f2a0

Authored by Paul Mackerras
Committed by Alexander Graf
1 parent ffe3649282

KVM: PPC: Book3S HV: Fix bug leading to deadlock in guest HPT updates

When handling the H_BULK_REMOVE hypercall, we were forgetting to
invalidate and unlock the hashed page table entry (HPTE) in the case
where the page had been paged out.  This fixes it by clearing the
first doubleword of the HPTE in that case.

This fixes a regression introduced in commit a92bce95f0 ("KVM: PPC:
Book3S HV: Keep HPTE locked when invalidating").  The effect of the
regression is that the host kernel will sometimes hang when under
memory pressure.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

arch/powerpc/kvm/book3s_hv_rm_mmu.c
... ... @@ -463,6 +463,7 @@
463 463 /* insert R and C bits from PTE */
464 464 rcbits = rev->guest_rpte & (HPTE_R_R|HPTE_R_C);
465 465 args[j] |= rcbits << (56 - 5);
  466 + hp[0] = 0;
466 467 continue;
467 468 }
468 469