KVM: PPC: Make BAT only guest segments work
authorAlexander Graf <agraf@suse.de>
Mon, 21 Jun 2010 13:24:55 +0000 (15:24 +0200)
committerAvi Kivity <avi@redhat.com>
Sun, 1 Aug 2010 07:47:14 +0000 (10:47 +0300)
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>
arch/powerpc/kvm/book3s_32_mmu.c

index 0b10503c8a4aac4dfce46c7bf50c4fa017aa0db3..3292d76101d2eefa6808b0bf72dd81c3fed1eba5 100644 (file)
@@ -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();