diff options
Diffstat (limited to 'arch/powerpc/kvm/booke.c')
-rw-r--r-- | arch/powerpc/kvm/booke.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 1020119226db..1a1b51189773 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c | |||
@@ -673,7 +673,6 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) | |||
673 | ret = s; | 673 | ret = s; |
674 | goto out; | 674 | goto out; |
675 | } | 675 | } |
676 | kvmppc_lazy_ee_enable(); | ||
677 | 676 | ||
678 | kvm_guest_enter(); | 677 | kvm_guest_enter(); |
679 | 678 | ||
@@ -699,6 +698,8 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) | |||
699 | kvmppc_load_guest_fp(vcpu); | 698 | kvmppc_load_guest_fp(vcpu); |
700 | #endif | 699 | #endif |
701 | 700 | ||
701 | kvmppc_lazy_ee_enable(); | ||
702 | |||
702 | ret = __kvmppc_vcpu_run(kvm_run, vcpu); | 703 | ret = __kvmppc_vcpu_run(kvm_run, vcpu); |
703 | 704 | ||
704 | /* No need for kvm_guest_exit. It's done in handle_exit. | 705 | /* No need for kvm_guest_exit. It's done in handle_exit. |
@@ -832,6 +833,18 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
832 | { | 833 | { |
833 | int r = RESUME_HOST; | 834 | int r = RESUME_HOST; |
834 | int s; | 835 | int s; |
836 | int idx; | ||
837 | |||
838 | #ifdef CONFIG_PPC64 | ||
839 | WARN_ON(local_paca->irq_happened != 0); | ||
840 | #endif | ||
841 | |||
842 | /* | ||
843 | * We enter with interrupts disabled in hardware, but | ||
844 | * we need to call hard_irq_disable anyway to ensure that | ||
845 | * the software state is kept in sync. | ||
846 | */ | ||
847 | hard_irq_disable(); | ||
835 | 848 | ||
836 | /* update before a new last_exit_type is rewritten */ | 849 | /* update before a new last_exit_type is rewritten */ |
837 | kvmppc_update_timing_stats(vcpu); | 850 | kvmppc_update_timing_stats(vcpu); |
@@ -1053,6 +1066,8 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
1053 | break; | 1066 | break; |
1054 | } | 1067 | } |
1055 | 1068 | ||
1069 | idx = srcu_read_lock(&vcpu->kvm->srcu); | ||
1070 | |||
1056 | gpaddr = kvmppc_mmu_xlate(vcpu, gtlb_index, eaddr); | 1071 | gpaddr = kvmppc_mmu_xlate(vcpu, gtlb_index, eaddr); |
1057 | gfn = gpaddr >> PAGE_SHIFT; | 1072 | gfn = gpaddr >> PAGE_SHIFT; |
1058 | 1073 | ||
@@ -1075,6 +1090,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
1075 | kvmppc_account_exit(vcpu, MMIO_EXITS); | 1090 | kvmppc_account_exit(vcpu, MMIO_EXITS); |
1076 | } | 1091 | } |
1077 | 1092 | ||
1093 | srcu_read_unlock(&vcpu->kvm->srcu, idx); | ||
1078 | break; | 1094 | break; |
1079 | } | 1095 | } |
1080 | 1096 | ||
@@ -1098,6 +1114,8 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
1098 | 1114 | ||
1099 | kvmppc_account_exit(vcpu, ITLB_VIRT_MISS_EXITS); | 1115 | kvmppc_account_exit(vcpu, ITLB_VIRT_MISS_EXITS); |
1100 | 1116 | ||
1117 | idx = srcu_read_lock(&vcpu->kvm->srcu); | ||
1118 | |||
1101 | gpaddr = kvmppc_mmu_xlate(vcpu, gtlb_index, eaddr); | 1119 | gpaddr = kvmppc_mmu_xlate(vcpu, gtlb_index, eaddr); |
1102 | gfn = gpaddr >> PAGE_SHIFT; | 1120 | gfn = gpaddr >> PAGE_SHIFT; |
1103 | 1121 | ||
@@ -1114,6 +1132,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
1114 | kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_MACHINE_CHECK); | 1132 | kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_MACHINE_CHECK); |
1115 | } | 1133 | } |
1116 | 1134 | ||
1135 | srcu_read_unlock(&vcpu->kvm->srcu, idx); | ||
1117 | break; | 1136 | break; |
1118 | } | 1137 | } |
1119 | 1138 | ||