diff options
author | Alexander Graf <agraf@suse.de> | 2010-07-29 08:47:44 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-10-24 04:50:44 -0400 |
commit | d562de48de68b60b3d2522e7d8273d7112034ee6 (patch) | |
tree | ec58ea23bea8aec64be3d169033cece19cd6d3e8 /arch/powerpc/kvm/book3s.c | |
parent | 666e7252a15b7fc4a116e65deaf6da5e4ce660e3 (diff) |
KVM: PPC: Convert DSISR to shared page
The DSISR register contains information about a data page fault. It is fully
read/write from inside the guest context and we don't need to worry about
interacting based on writes of this register.
This patch converts all users of the current field to the shared page.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/book3s.c')
-rw-r--r-- | arch/powerpc/kvm/book3s.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index 2efe69240e1b..eb401b6d4d8c 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c | |||
@@ -595,15 +595,16 @@ int kvmppc_handle_pagefault(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
595 | if (page_found == -ENOENT) { | 595 | if (page_found == -ENOENT) { |
596 | /* Page not found in guest PTE entries */ | 596 | /* Page not found in guest PTE entries */ |
597 | vcpu->arch.dear = kvmppc_get_fault_dar(vcpu); | 597 | vcpu->arch.dear = kvmppc_get_fault_dar(vcpu); |
598 | to_book3s(vcpu)->dsisr = to_svcpu(vcpu)->fault_dsisr; | 598 | vcpu->arch.shared->dsisr = to_svcpu(vcpu)->fault_dsisr; |
599 | vcpu->arch.shared->msr |= | 599 | vcpu->arch.shared->msr |= |
600 | (to_svcpu(vcpu)->shadow_srr1 & 0x00000000f8000000ULL); | 600 | (to_svcpu(vcpu)->shadow_srr1 & 0x00000000f8000000ULL); |
601 | kvmppc_book3s_queue_irqprio(vcpu, vec); | 601 | kvmppc_book3s_queue_irqprio(vcpu, vec); |
602 | } else if (page_found == -EPERM) { | 602 | } else if (page_found == -EPERM) { |
603 | /* Storage protection */ | 603 | /* Storage protection */ |
604 | vcpu->arch.dear = kvmppc_get_fault_dar(vcpu); | 604 | vcpu->arch.dear = kvmppc_get_fault_dar(vcpu); |
605 | to_book3s(vcpu)->dsisr = to_svcpu(vcpu)->fault_dsisr & ~DSISR_NOHPTE; | 605 | vcpu->arch.shared->dsisr = |
606 | to_book3s(vcpu)->dsisr |= DSISR_PROTFAULT; | 606 | to_svcpu(vcpu)->fault_dsisr & ~DSISR_NOHPTE; |
607 | vcpu->arch.shared->dsisr |= DSISR_PROTFAULT; | ||
607 | vcpu->arch.shared->msr |= | 608 | vcpu->arch.shared->msr |= |
608 | (to_svcpu(vcpu)->shadow_srr1 & 0x00000000f8000000ULL); | 609 | (to_svcpu(vcpu)->shadow_srr1 & 0x00000000f8000000ULL); |
609 | kvmppc_book3s_queue_irqprio(vcpu, vec); | 610 | kvmppc_book3s_queue_irqprio(vcpu, vec); |
@@ -867,7 +868,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
867 | r = kvmppc_handle_pagefault(run, vcpu, dar, exit_nr); | 868 | r = kvmppc_handle_pagefault(run, vcpu, dar, exit_nr); |
868 | } else { | 869 | } else { |
869 | vcpu->arch.dear = dar; | 870 | vcpu->arch.dear = dar; |
870 | to_book3s(vcpu)->dsisr = to_svcpu(vcpu)->fault_dsisr; | 871 | vcpu->arch.shared->dsisr = to_svcpu(vcpu)->fault_dsisr; |
871 | kvmppc_book3s_queue_irqprio(vcpu, exit_nr); | 872 | kvmppc_book3s_queue_irqprio(vcpu, exit_nr); |
872 | kvmppc_mmu_pte_flush(vcpu, vcpu->arch.dear, ~0xFFFUL); | 873 | kvmppc_mmu_pte_flush(vcpu, vcpu->arch.dear, ~0xFFFUL); |
873 | r = RESUME_GUEST; | 874 | r = RESUME_GUEST; |
@@ -994,7 +995,7 @@ program_interrupt: | |||
994 | } | 995 | } |
995 | case BOOK3S_INTERRUPT_ALIGNMENT: | 996 | case BOOK3S_INTERRUPT_ALIGNMENT: |
996 | if (kvmppc_read_inst(vcpu) == EMULATE_DONE) { | 997 | if (kvmppc_read_inst(vcpu) == EMULATE_DONE) { |
997 | to_book3s(vcpu)->dsisr = kvmppc_alignment_dsisr(vcpu, | 998 | vcpu->arch.shared->dsisr = kvmppc_alignment_dsisr(vcpu, |
998 | kvmppc_get_last_inst(vcpu)); | 999 | kvmppc_get_last_inst(vcpu)); |
999 | vcpu->arch.dear = kvmppc_alignment_dar(vcpu, | 1000 | vcpu->arch.dear = kvmppc_alignment_dar(vcpu, |
1000 | kvmppc_get_last_inst(vcpu)); | 1001 | kvmppc_get_last_inst(vcpu)); |