aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-06-21 09:24:55 -0400
committerAvi Kivity <avi@redhat.com>2010-08-01 03:47:14 -0400
commit4d29bdbf12f35f7e7816d67e99c150630684604f (patch)
tree2eb8955ba34b720004e959642fca355dd9b67fa3
parent3b249157c03154109d31ec95a3c80203adcf8b70 (diff)
KVM: PPC: Make BAT only guest segments work
When a guest sets its SR entry to invalid, we may still find a corresponding entry in a BAT. So we need to make sure we're not faulting on invalid SR entries, but instead just claim them to be BAT resolved. This resolves breakage experienced when using libogc based guests. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--arch/powerpc/kvm/book3s_32_mmu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/kvm/book3s_32_mmu.c b/arch/powerpc/kvm/book3s_32_mmu.c
index 0b10503c8a4a..3292d76101d2 100644
--- a/arch/powerpc/kvm/book3s_32_mmu.c
+++ b/arch/powerpc/kvm/book3s_32_mmu.c
@@ -354,10 +354,10 @@ static int kvmppc_mmu_book3s_32_esid_to_vsid(struct kvm_vcpu *vcpu, ulong esid,
354 *vsid = VSID_REAL_DR | gvsid; 354 *vsid = VSID_REAL_DR | gvsid;
355 break; 355 break;
356 case MSR_DR|MSR_IR: 356 case MSR_DR|MSR_IR:
357 if (!sr->valid) 357 if (sr->valid)
358 return -1; 358 *vsid = sr->vsid;
359 359 else
360 *vsid = sr->vsid; 360 *vsid = VSID_BAT | gvsid;
361 break; 361 break;
362 default: 362 default:
363 BUG(); 363 BUG();