diff options
author | Hollis Blanchard <hollisb@us.ibm.com> | 2009-01-03 17:23:00 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-03-24 05:02:56 -0400 |
commit | 475e7cdd69101939006659a63c2e4a32d5b71389 (patch) | |
tree | a9a70f430565226765b97f94c775acf89207fbb6 /arch/powerpc | |
parent | ecc0981ff07cbe7cdf95de20be5b24fee8e49cb5 (diff) |
KVM: ppc: small cosmetic changes to Book E DTLB miss handler
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kvm/booke.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 35485dd6927e..d196ae619303 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c | |||
@@ -290,6 +290,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
290 | struct kvmppc_44x_tlbe *gtlbe; | 290 | struct kvmppc_44x_tlbe *gtlbe; |
291 | unsigned long eaddr = vcpu->arch.fault_dear; | 291 | unsigned long eaddr = vcpu->arch.fault_dear; |
292 | int gtlb_index; | 292 | int gtlb_index; |
293 | gpa_t gpaddr; | ||
293 | gfn_t gfn; | 294 | gfn_t gfn; |
294 | 295 | ||
295 | /* Check the guest TLB. */ | 296 | /* Check the guest TLB. */ |
@@ -305,8 +306,8 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
305 | } | 306 | } |
306 | 307 | ||
307 | gtlbe = &vcpu_44x->guest_tlb[gtlb_index]; | 308 | gtlbe = &vcpu_44x->guest_tlb[gtlb_index]; |
308 | vcpu->arch.paddr_accessed = tlb_xlate(gtlbe, eaddr); | 309 | gpaddr = tlb_xlate(gtlbe, eaddr); |
309 | gfn = vcpu->arch.paddr_accessed >> PAGE_SHIFT; | 310 | gfn = gpaddr >> PAGE_SHIFT; |
310 | 311 | ||
311 | if (kvm_is_visible_gfn(vcpu->kvm, gfn)) { | 312 | if (kvm_is_visible_gfn(vcpu->kvm, gfn)) { |
312 | /* The guest TLB had a mapping, but the shadow TLB | 313 | /* The guest TLB had a mapping, but the shadow TLB |
@@ -315,13 +316,14 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
315 | * b) the guest used a large mapping which we're faking | 316 | * b) the guest used a large mapping which we're faking |
316 | * Either way, we need to satisfy the fault without | 317 | * Either way, we need to satisfy the fault without |
317 | * invoking the guest. */ | 318 | * invoking the guest. */ |
318 | kvmppc_mmu_map(vcpu, eaddr, vcpu->arch.paddr_accessed, gtlbe->tid, | 319 | kvmppc_mmu_map(vcpu, eaddr, gpaddr, gtlbe->tid, |
319 | gtlbe->word2, get_tlb_bytes(gtlbe), gtlb_index); | 320 | gtlbe->word2, get_tlb_bytes(gtlbe), gtlb_index); |
320 | kvmppc_account_exit(vcpu, DTLB_VIRT_MISS_EXITS); | 321 | kvmppc_account_exit(vcpu, DTLB_VIRT_MISS_EXITS); |
321 | r = RESUME_GUEST; | 322 | r = RESUME_GUEST; |
322 | } else { | 323 | } else { |
323 | /* Guest has mapped and accessed a page which is not | 324 | /* Guest has mapped and accessed a page which is not |
324 | * actually RAM. */ | 325 | * actually RAM. */ |
326 | vcpu->arch.paddr_accessed = gpaddr; | ||
325 | r = kvmppc_emulate_mmio(run, vcpu); | 327 | r = kvmppc_emulate_mmio(run, vcpu); |
326 | kvmppc_account_exit(vcpu, MMIO_EXITS); | 328 | kvmppc_account_exit(vcpu, MMIO_EXITS); |
327 | } | 329 | } |