diff options
-rw-r--r-- | arch/powerpc/include/asm/kvm_host.h | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/asm-offsets.c | 1 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s.c | 13 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s_64_interrupts.S | 2 |
4 files changed, 10 insertions, 7 deletions
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index c30a70c6b931..715aa6baf6f0 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h | |||
@@ -198,6 +198,7 @@ struct kvm_vcpu_arch { | |||
198 | ulong msr; | 198 | ulong msr; |
199 | #ifdef CONFIG_PPC64 | 199 | #ifdef CONFIG_PPC64 |
200 | ulong shadow_msr; | 200 | ulong shadow_msr; |
201 | ulong shadow_srr1; | ||
201 | ulong hflags; | 202 | ulong hflags; |
202 | ulong guest_owned_ext; | 203 | ulong guest_owned_ext; |
203 | #endif | 204 | #endif |
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index ee9935442f0e..957ceb7059c5 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
@@ -433,6 +433,7 @@ int main(void) | |||
433 | DEFINE(VCPU_HOST_R2, offsetof(struct kvm_vcpu, arch.host_r2)); | 433 | DEFINE(VCPU_HOST_R2, offsetof(struct kvm_vcpu, arch.host_r2)); |
434 | DEFINE(VCPU_HOST_MSR, offsetof(struct kvm_vcpu, arch.host_msr)); | 434 | DEFINE(VCPU_HOST_MSR, offsetof(struct kvm_vcpu, arch.host_msr)); |
435 | DEFINE(VCPU_SHADOW_MSR, offsetof(struct kvm_vcpu, arch.shadow_msr)); | 435 | DEFINE(VCPU_SHADOW_MSR, offsetof(struct kvm_vcpu, arch.shadow_msr)); |
436 | DEFINE(VCPU_SHADOW_SRR1, offsetof(struct kvm_vcpu, arch.shadow_srr1)); | ||
436 | DEFINE(VCPU_TRAMPOLINE_LOWMEM, offsetof(struct kvm_vcpu, arch.trampoline_lowmem)); | 437 | DEFINE(VCPU_TRAMPOLINE_LOWMEM, offsetof(struct kvm_vcpu, arch.trampoline_lowmem)); |
437 | DEFINE(VCPU_TRAMPOLINE_ENTER, offsetof(struct kvm_vcpu, arch.trampoline_enter)); | 438 | DEFINE(VCPU_TRAMPOLINE_ENTER, offsetof(struct kvm_vcpu, arch.trampoline_enter)); |
438 | DEFINE(VCPU_HIGHMEM_HANDLER, offsetof(struct kvm_vcpu, arch.highmem_handler)); | 439 | DEFINE(VCPU_HIGHMEM_HANDLER, offsetof(struct kvm_vcpu, arch.highmem_handler)); |
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index 2cb181396f82..58f5200fc09b 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c | |||
@@ -524,14 +524,14 @@ int kvmppc_handle_pagefault(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
524 | /* Page not found in guest PTE entries */ | 524 | /* Page not found in guest PTE entries */ |
525 | vcpu->arch.dear = vcpu->arch.fault_dear; | 525 | vcpu->arch.dear = vcpu->arch.fault_dear; |
526 | to_book3s(vcpu)->dsisr = vcpu->arch.fault_dsisr; | 526 | to_book3s(vcpu)->dsisr = vcpu->arch.fault_dsisr; |
527 | vcpu->arch.msr |= (vcpu->arch.shadow_msr & 0x00000000f8000000ULL); | 527 | vcpu->arch.msr |= (vcpu->arch.shadow_srr1 & 0x00000000f8000000ULL); |
528 | kvmppc_book3s_queue_irqprio(vcpu, vec); | 528 | kvmppc_book3s_queue_irqprio(vcpu, vec); |
529 | } else if (page_found == -EPERM) { | 529 | } else if (page_found == -EPERM) { |
530 | /* Storage protection */ | 530 | /* Storage protection */ |
531 | vcpu->arch.dear = vcpu->arch.fault_dear; | 531 | vcpu->arch.dear = vcpu->arch.fault_dear; |
532 | to_book3s(vcpu)->dsisr = vcpu->arch.fault_dsisr & ~DSISR_NOHPTE; | 532 | to_book3s(vcpu)->dsisr = vcpu->arch.fault_dsisr & ~DSISR_NOHPTE; |
533 | to_book3s(vcpu)->dsisr |= DSISR_PROTFAULT; | 533 | to_book3s(vcpu)->dsisr |= DSISR_PROTFAULT; |
534 | vcpu->arch.msr |= (vcpu->arch.shadow_msr & 0x00000000f8000000ULL); | 534 | vcpu->arch.msr |= (vcpu->arch.shadow_srr1 & 0x00000000f8000000ULL); |
535 | kvmppc_book3s_queue_irqprio(vcpu, vec); | 535 | kvmppc_book3s_queue_irqprio(vcpu, vec); |
536 | } else if (page_found == -EINVAL) { | 536 | } else if (page_found == -EINVAL) { |
537 | /* Page not found in guest SLB */ | 537 | /* Page not found in guest SLB */ |
@@ -693,7 +693,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
693 | case BOOK3S_INTERRUPT_INST_STORAGE: | 693 | case BOOK3S_INTERRUPT_INST_STORAGE: |
694 | vcpu->stat.pf_instruc++; | 694 | vcpu->stat.pf_instruc++; |
695 | /* only care about PTEG not found errors, but leave NX alone */ | 695 | /* only care about PTEG not found errors, but leave NX alone */ |
696 | if (vcpu->arch.shadow_msr & 0x40000000) { | 696 | if (vcpu->arch.shadow_srr1 & 0x40000000) { |
697 | r = kvmppc_handle_pagefault(run, vcpu, vcpu->arch.pc, exit_nr); | 697 | r = kvmppc_handle_pagefault(run, vcpu, vcpu->arch.pc, exit_nr); |
698 | vcpu->stat.sp_instruc++; | 698 | vcpu->stat.sp_instruc++; |
699 | } else if (vcpu->arch.mmu.is_dcbz32(vcpu) && | 699 | } else if (vcpu->arch.mmu.is_dcbz32(vcpu) && |
@@ -705,7 +705,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
705 | */ | 705 | */ |
706 | kvmppc_mmu_pte_flush(vcpu, vcpu->arch.pc, ~0xFFFULL); | 706 | kvmppc_mmu_pte_flush(vcpu, vcpu->arch.pc, ~0xFFFULL); |
707 | } else { | 707 | } else { |
708 | vcpu->arch.msr |= (vcpu->arch.shadow_msr & 0x58000000); | 708 | vcpu->arch.msr |= vcpu->arch.shadow_srr1 & 0x58000000; |
709 | kvmppc_book3s_queue_irqprio(vcpu, exit_nr); | 709 | kvmppc_book3s_queue_irqprio(vcpu, exit_nr); |
710 | kvmppc_mmu_pte_flush(vcpu, vcpu->arch.pc, ~0xFFFULL); | 710 | kvmppc_mmu_pte_flush(vcpu, vcpu->arch.pc, ~0xFFFULL); |
711 | r = RESUME_GUEST; | 711 | r = RESUME_GUEST; |
@@ -753,7 +753,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
753 | enum emulation_result er; | 753 | enum emulation_result er; |
754 | ulong flags; | 754 | ulong flags; |
755 | 755 | ||
756 | flags = (vcpu->arch.shadow_msr & 0x1f0000ull); | 756 | flags = vcpu->arch.shadow_srr1 & 0x1f0000ull; |
757 | 757 | ||
758 | if (vcpu->arch.msr & MSR_PR) { | 758 | if (vcpu->arch.msr & MSR_PR) { |
759 | #ifdef EXIT_DEBUG | 759 | #ifdef EXIT_DEBUG |
@@ -808,7 +808,8 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
808 | break; | 808 | break; |
809 | default: | 809 | default: |
810 | /* Ugh - bork here! What did we get? */ | 810 | /* Ugh - bork here! What did we get? */ |
811 | printk(KERN_EMERG "exit_nr=0x%x | pc=0x%lx | msr=0x%lx\n", exit_nr, vcpu->arch.pc, vcpu->arch.shadow_msr); | 811 | printk(KERN_EMERG "exit_nr=0x%x | pc=0x%lx | msr=0x%lx\n", |
812 | exit_nr, vcpu->arch.pc, vcpu->arch.shadow_srr1); | ||
812 | r = RESUME_HOST; | 813 | r = RESUME_HOST; |
813 | BUG(); | 814 | BUG(); |
814 | break; | 815 | break; |
diff --git a/arch/powerpc/kvm/book3s_64_interrupts.S b/arch/powerpc/kvm/book3s_64_interrupts.S index 2ff0b2137e6f..c1584d0cbce8 100644 --- a/arch/powerpc/kvm/book3s_64_interrupts.S +++ b/arch/powerpc/kvm/book3s_64_interrupts.S | |||
@@ -169,7 +169,7 @@ kvmppc_handler_highmem: | |||
169 | stw r0, VCPU_LAST_INST(r7) | 169 | stw r0, VCPU_LAST_INST(r7) |
170 | 170 | ||
171 | std r3, VCPU_PC(r7) | 171 | std r3, VCPU_PC(r7) |
172 | std r4, VCPU_SHADOW_MSR(r7) | 172 | std r4, VCPU_SHADOW_SRR1(r7) |
173 | std r5, VCPU_FAULT_DEAR(r7) | 173 | std r5, VCPU_FAULT_DEAR(r7) |
174 | std r6, VCPU_FAULT_DSISR(r7) | 174 | std r6, VCPU_FAULT_DSISR(r7) |
175 | 175 | ||