public inbox for kvm-ppc@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: "kvm@vger.kernel.org list" <kvm@vger.kernel.org>
Cc: Avi Kivity <avi@redhat.com>,
	kvm-ppc@vger.kernel.org, mtosatti@redhat.com,
	Paul Mackerras <paulus@samba.org>
Subject: [PATCH 5/5] KVM: PPC: Book3S HV: Fix bug leading to deadlock in guest HPT updates
Date: Wed, 16 May 2012 13:05:19 +0000	[thread overview]
Message-ID: <1337173519-6780-6-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1337173519-6780-1-git-send-email-agraf@suse.de>

From: Paul Mackerras <paulus@samba.org>

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>
---
 arch/powerpc/kvm/book3s_hv_rm_mmu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
index def880a..cec4dad 100644
--- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c
+++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
@@ -463,6 +463,7 @@ long kvmppc_h_bulk_remove(struct kvm_vcpu *vcpu)
 				/* insert R and C bits from PTE */
 				rcbits = rev->guest_rpte & (HPTE_R_R|HPTE_R_C);
 				args[j] |= rcbits << (56 - 5);
+				hp[0] = 0;
 				continue;
 			}
 
-- 
1.6.0.2


  parent reply	other threads:[~2012-05-16 13:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-16 13:05 [PULL 0/5] ppc patch queue 2012-05-16 Alexander Graf
2012-05-16 13:05 ` [PATCH 1/5] KVM: PPC: Book3S: PR: Handle EMUL_ASSIST Alexander Graf
2012-05-16 13:05 ` [PATCH 2/5] KVM: PPC: Fix PR KVM on POWER7 bare metal Alexander Graf
2012-05-16 13:05 ` [PATCH 3/5] KVM: PPC: Book3S: PR: Fix hsrr code Alexander Graf
2012-05-16 13:05 ` [PATCH 4/5] powerpc/kvm: Fix VSID usage in 64-bit "PR" KVM Alexander Graf
2012-05-16 13:05 ` Alexander Graf [this message]
2012-05-16 13:23 ` [PULL 0/5] ppc patch queue 2012-05-16 Avi Kivity
2012-05-16 13:28   ` Alexander Graf
2012-05-16 13:34     ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337173519-6780-6-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox