diff options
| -rw-r--r-- | arch/x86/kvm/vmx.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index fa29585c63ff..d1a4f42f6c97 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
| @@ -10272,15 +10272,6 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) | |||
| 10272 | nested_ept_init_mmu_context(vcpu); | 10272 | nested_ept_init_mmu_context(vcpu); |
| 10273 | } | 10273 | } |
| 10274 | 10274 | ||
| 10275 | if (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_EFER) | ||
| 10276 | vcpu->arch.efer = vmcs12->guest_ia32_efer; | ||
| 10277 | else if (vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) | ||
| 10278 | vcpu->arch.efer |= (EFER_LMA | EFER_LME); | ||
| 10279 | else | ||
| 10280 | vcpu->arch.efer &= ~(EFER_LMA | EFER_LME); | ||
| 10281 | /* Note: modifies VM_ENTRY/EXIT_CONTROLS and GUEST/HOST_IA32_EFER */ | ||
| 10282 | vmx_set_efer(vcpu, vcpu->arch.efer); | ||
| 10283 | |||
| 10284 | /* | 10275 | /* |
| 10285 | * This sets GUEST_CR0 to vmcs12->guest_cr0, with possibly a modified | 10276 | * This sets GUEST_CR0 to vmcs12->guest_cr0, with possibly a modified |
| 10286 | * TS bit (for lazy fpu) and bits which we consider mandatory enabled. | 10277 | * TS bit (for lazy fpu) and bits which we consider mandatory enabled. |
| @@ -10295,6 +10286,15 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) | |||
| 10295 | vmx_set_cr4(vcpu, vmcs12->guest_cr4); | 10286 | vmx_set_cr4(vcpu, vmcs12->guest_cr4); |
| 10296 | vmcs_writel(CR4_READ_SHADOW, nested_read_cr4(vmcs12)); | 10287 | vmcs_writel(CR4_READ_SHADOW, nested_read_cr4(vmcs12)); |
| 10297 | 10288 | ||
| 10289 | if (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_IA32_EFER) | ||
| 10290 | vcpu->arch.efer = vmcs12->guest_ia32_efer; | ||
| 10291 | else if (vmcs12->vm_entry_controls & VM_ENTRY_IA32E_MODE) | ||
| 10292 | vcpu->arch.efer |= (EFER_LMA | EFER_LME); | ||
| 10293 | else | ||
| 10294 | vcpu->arch.efer &= ~(EFER_LMA | EFER_LME); | ||
| 10295 | /* Note: modifies VM_ENTRY/EXIT_CONTROLS and GUEST/HOST_IA32_EFER */ | ||
| 10296 | vmx_set_efer(vcpu, vcpu->arch.efer); | ||
| 10297 | |||
| 10298 | /* shadow page tables on either EPT or shadow page tables */ | 10298 | /* shadow page tables on either EPT or shadow page tables */ |
| 10299 | kvm_set_cr3(vcpu, vmcs12->guest_cr3); | 10299 | kvm_set_cr3(vcpu, vmcs12->guest_cr3); |
| 10300 | kvm_mmu_reset_context(vcpu); | 10300 | kvm_mmu_reset_context(vcpu); |
