diff options
-rw-r--r-- | arch/x86/kvm/vmx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 2b7e7bd190fd..1ee811cef236 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -1642,7 +1642,6 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0, | |||
1642 | CPU_BASED_CR3_STORE_EXITING)); | 1642 | CPU_BASED_CR3_STORE_EXITING)); |
1643 | vcpu->arch.cr0 = cr0; | 1643 | vcpu->arch.cr0 = cr0; |
1644 | vmx_set_cr4(vcpu, vcpu->arch.cr4); | 1644 | vmx_set_cr4(vcpu, vcpu->arch.cr4); |
1645 | *hw_cr0 &= ~X86_CR0_WP; | ||
1646 | } else if (!is_paging(vcpu)) { | 1645 | } else if (!is_paging(vcpu)) { |
1647 | /* From nonpaging to paging */ | 1646 | /* From nonpaging to paging */ |
1648 | vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, | 1647 | vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, |
@@ -1651,9 +1650,10 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0, | |||
1651 | CPU_BASED_CR3_STORE_EXITING)); | 1650 | CPU_BASED_CR3_STORE_EXITING)); |
1652 | vcpu->arch.cr0 = cr0; | 1651 | vcpu->arch.cr0 = cr0; |
1653 | vmx_set_cr4(vcpu, vcpu->arch.cr4); | 1652 | vmx_set_cr4(vcpu, vcpu->arch.cr4); |
1654 | if (!(vcpu->arch.cr0 & X86_CR0_WP)) | ||
1655 | *hw_cr0 &= ~X86_CR0_WP; | ||
1656 | } | 1653 | } |
1654 | |||
1655 | if (!(cr0 & X86_CR0_WP)) | ||
1656 | *hw_cr0 &= ~X86_CR0_WP; | ||
1657 | } | 1657 | } |
1658 | 1658 | ||
1659 | static void ept_update_paging_mode_cr4(unsigned long *hw_cr4, | 1659 | static void ept_update_paging_mode_cr4(unsigned long *hw_cr4, |