Skip to content

Commit

Permalink
KVM: PPC: Make BAT only guest segments work
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Graf authored and Avi Kivity committed Aug 1, 2010
1 parent 3b24915 commit 4d29bdb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/powerpc/kvm/book3s_32_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ static int kvmppc_mmu_book3s_32_esid_to_vsid(struct kvm_vcpu *vcpu, ulong esid,
*vsid = VSID_REAL_DR | gvsid;
break;
case MSR_DR|MSR_IR:
if (!sr->valid)
return -1;

*vsid = sr->vsid;
if (sr->valid)
*vsid = sr->vsid;
else
*vsid = VSID_BAT | gvsid;
break;
default:
BUG();
Expand Down

0 comments on commit 4d29bdb

Please sign in to comment.