diff options
Diffstat (limited to 'arch/powerpc/kvm/book3s_pr.c')
| -rw-r--r-- | arch/powerpc/kvm/book3s_pr.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index 48558f6176e9..6e3488b09519 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c | |||
| @@ -153,6 +153,7 @@ void kvmppc_set_pvr(struct kvm_vcpu *vcpu, u32 pvr) | |||
| 153 | if (!to_book3s(vcpu)->hior_sregs) | 153 | if (!to_book3s(vcpu)->hior_sregs) |
| 154 | to_book3s(vcpu)->hior = 0xfff00000; | 154 | to_book3s(vcpu)->hior = 0xfff00000; |
| 155 | to_book3s(vcpu)->msr_mask = 0xffffffffffffffffULL; | 155 | to_book3s(vcpu)->msr_mask = 0xffffffffffffffffULL; |
| 156 | vcpu->arch.cpu_type = KVM_CPU_3S_64; | ||
| 156 | } else | 157 | } else |
| 157 | #endif | 158 | #endif |
| 158 | { | 159 | { |
| @@ -160,8 +161,11 @@ void kvmppc_set_pvr(struct kvm_vcpu *vcpu, u32 pvr) | |||
| 160 | if (!to_book3s(vcpu)->hior_sregs) | 161 | if (!to_book3s(vcpu)->hior_sregs) |
| 161 | to_book3s(vcpu)->hior = 0; | 162 | to_book3s(vcpu)->hior = 0; |
| 162 | to_book3s(vcpu)->msr_mask = 0xffffffffULL; | 163 | to_book3s(vcpu)->msr_mask = 0xffffffffULL; |
| 164 | vcpu->arch.cpu_type = KVM_CPU_3S_32; | ||
| 163 | } | 165 | } |
| 164 | 166 | ||
| 167 | kvmppc_sanity_check(vcpu); | ||
| 168 | |||
| 165 | /* If we are in hypervisor level on 970, we can tell the CPU to | 169 | /* If we are in hypervisor level on 970, we can tell the CPU to |
| 166 | * treat DCBZ as 32 bytes store */ | 170 | * treat DCBZ as 32 bytes store */ |
| 167 | vcpu->arch.hflags &= ~BOOK3S_HFLAG_DCBZ32; | 171 | vcpu->arch.hflags &= ~BOOK3S_HFLAG_DCBZ32; |
| @@ -938,6 +942,12 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) | |||
| 938 | #endif | 942 | #endif |
| 939 | ulong ext_msr; | 943 | ulong ext_msr; |
| 940 | 944 | ||
| 945 | /* Check if we can run the vcpu at all */ | ||
| 946 | if (!vcpu->arch.sane) { | ||
| 947 | kvm_run->exit_reason = KVM_EXIT_INTERNAL_ERROR; | ||
| 948 | return -EINVAL; | ||
| 949 | } | ||
| 950 | |||
| 941 | /* No need to go into the guest when all we do is going out */ | 951 | /* No need to go into the guest when all we do is going out */ |
| 942 | if (signal_pending(current)) { | 952 | if (signal_pending(current)) { |
| 943 | kvm_run->exit_reason = KVM_EXIT_INTR; | 953 | kvm_run->exit_reason = KVM_EXIT_INTR; |
