aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c4d451ed1573..19047eafa38d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6016,7 +6016,9 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
6016 int r; 6016 int r;
6017 6017
6018 vcpu->arch.mtrr_state.have_fixed = 1; 6018 vcpu->arch.mtrr_state.have_fixed = 1;
6019 vcpu_load(vcpu); 6019 r = vcpu_load(vcpu);
6020 if (r)
6021 return r;
6020 r = kvm_arch_vcpu_reset(vcpu); 6022 r = kvm_arch_vcpu_reset(vcpu);
6021 if (r == 0) 6023 if (r == 0)
6022 r = kvm_mmu_setup(vcpu); 6024 r = kvm_mmu_setup(vcpu);
@@ -6027,9 +6029,11 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
6027 6029
6028void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) 6030void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
6029{ 6031{
6032 int r;
6030 vcpu->arch.apf.msr_val = 0; 6033 vcpu->arch.apf.msr_val = 0;
6031 6034
6032 vcpu_load(vcpu); 6035 r = vcpu_load(vcpu);
6036 BUG_ON(r);
6033 kvm_mmu_unload(vcpu); 6037 kvm_mmu_unload(vcpu);
6034 vcpu_put(vcpu); 6038 vcpu_put(vcpu);
6035 6039
@@ -6275,7 +6279,9 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
6275 6279
6276static void kvm_unload_vcpu_mmu(struct kvm_vcpu *vcpu) 6280static void kvm_unload_vcpu_mmu(struct kvm_vcpu *vcpu)
6277{ 6281{
6278 vcpu_load(vcpu); 6282 int r;
6283 r = vcpu_load(vcpu);
6284 BUG_ON(r);
6279 kvm_mmu_unload(vcpu); 6285 kvm_mmu_unload(vcpu);
6280 vcpu_put(vcpu); 6286 vcpu_put(vcpu);
6281} 6287}