public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: kvm-ppc@vger.kernel.org
Cc: "kvm@vger.kernel.org mailing list" <kvm@vger.kernel.org>,
	Gleb Natapov <gleb@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Scott Wood <scottwood@freescale.com>
Subject: [PATCH 5/7] kvm/ppc/e500: g2h_tlb1_map: clear old bit before setting new bit
Date: Fri, 22 Mar 2013 15:26:01 +0100	[thread overview]
Message-ID: <1363962363-7968-6-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1363962363-7968-1-git-send-email-agraf@suse.de>

From: Scott Wood <scottwood@freescale.com>

It's possible that we're using the same host TLB1 slot to map (a
presumably different portion of) the same guest TLB1 entry.  Clear
the bit in the map before setting it, so that if the esels are the same
the bit will remain set.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kvm/e500_mmu_host.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
index 35fb80e..8e72b21 100644
--- a/arch/powerpc/kvm/e500_mmu_host.c
+++ b/arch/powerpc/kvm/e500_mmu_host.c
@@ -507,13 +507,14 @@ static int kvmppc_e500_tlb1_map_tlb1(struct kvmppc_vcpu_e500 *vcpu_e500,
 	if (unlikely(vcpu_e500->host_tlb1_nv >= tlb1_max_shadow_size()))
 		vcpu_e500->host_tlb1_nv = 0;
 
-	vcpu_e500->tlb_refs[1][sesel] = *ref;
-	vcpu_e500->g2h_tlb1_map[esel] |= (u64)1 << sesel;
-	vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_BITMAP;
 	if (vcpu_e500->h2g_tlb1_rmap[sesel]) {
 		unsigned int idx = vcpu_e500->h2g_tlb1_rmap[sesel] - 1;
 		vcpu_e500->g2h_tlb1_map[idx] &= ~(1ULL << sesel);
 	}
+
+	vcpu_e500->tlb_refs[1][sesel] = *ref;
+	vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_BITMAP;
+	vcpu_e500->g2h_tlb1_map[esel] |= (u64)1 << sesel;
 	vcpu_e500->h2g_tlb1_rmap[sesel] = esel + 1;
 
 	return sesel;
-- 
1.6.0.2

  parent reply	other threads:[~2013-03-22 14:26 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-22 14:25 [PULL 0/7] ppc patch queue 2013-03-22 Alexander Graf
2013-03-22 14:25 ` [PATCH 1/7] KVM: PPC: move tsr update in a separate function Alexander Graf
2013-03-22 14:25 ` [PATCH 2/7] KVM: PPC: Added one_reg interface for timer registers Alexander Graf
2013-03-22 14:25 ` [PATCH 3/7] KVM: PPC: booke: Added debug handler Alexander Graf
2013-03-22 14:26 ` [PATCH 4/7] kvm/ppc/e500: h2g_tlb1_rmap: esel 0 is valid Alexander Graf
2013-03-22 14:26 ` Alexander Graf [this message]
2013-03-22 14:26 ` [PATCH 6/7] kvm/ppc/e500: eliminate tlb_refs Alexander Graf
2013-03-22 14:26 ` [PATCH 7/7] KVM: PPC: Remove unused argument to kvmppc_core_dequeue_external Alexander Graf
2013-03-24  9:45 ` [PULL 0/7] ppc patch queue 2013-03-22 Gleb Natapov
2013-03-25 22:21 ` Scott Wood
2013-03-25 22:32   ` Alexander Graf
2013-03-25 22:54     ` Scott Wood
2013-03-25 22:59       ` Alexander Graf
2013-03-25 23:16         ` Scott Wood
2013-03-25 23:35           ` Alexander Graf
2013-03-26  1:33             ` Gleb Natapov
2013-03-26  1:59               ` Paul Mackerras
2013-04-11 13:45                 ` Marcelo Tosatti
2013-04-11 13:50                   ` Alexander Graf
2013-04-12 20:54                     ` Marcelo Tosatti
2013-04-12 20:56                       ` Alexander Graf
2013-04-16 17:26                         ` Alexander Graf
2013-04-16 21:28                           ` Marcelo Tosatti
2013-03-26 16:37               ` Scott Wood
2013-03-31 10:49                 ` Gleb Natapov
2013-03-31 11:05                   ` Alexander Graf
2013-04-08 18:17                     ` Scott Wood

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=1363962363-7968-6-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=gleb@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=scottwood@freescale.com \
    /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