From: Sean Christopherson Date: Mon, 5 Mar 2018 20:04:38 +0000 (-0800) Subject: KVM: VMX: remove CR0.WP from ..._ALWAYS_ON_UNRESTRICTED_GUEST X-Git-Tag: v4.19~1176^2~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1706bd0c023f1c7b677119ed132c7ab0b37268b4;p=platform%2Fkernel%2Flinux-rpi.git KVM: VMX: remove CR0.WP from ..._ALWAYS_ON_UNRESTRICTED_GUEST Unrestricted guest can only be enabled when EPT is enabled, and when EPT is enabled, ept_update_paging_mode_cr0() will clear hardware CR0.WP based on the guest's CR0.WP, i.e. CR0.WP always follows the guest's value when unrestricted guest is enabled. Signed-off-by: Sean Christopherson Signed-off-by: Radim Krčmář --- diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 39216ae..8e7f209 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -131,9 +131,10 @@ module_param_named(preemption_timer, enable_preemption_timer, bool, S_IRUGO); #endif #define KVM_GUEST_CR0_MASK (X86_CR0_NW | X86_CR0_CD) -#define KVM_VM_CR0_ALWAYS_ON_UNRESTRICTED_GUEST (X86_CR0_WP | X86_CR0_NE) -#define KVM_VM_CR0_ALWAYS_ON \ - (KVM_VM_CR0_ALWAYS_ON_UNRESTRICTED_GUEST | X86_CR0_PG | X86_CR0_PE) +#define KVM_VM_CR0_ALWAYS_ON_UNRESTRICTED_GUEST X86_CR0_NE +#define KVM_VM_CR0_ALWAYS_ON \ + (KVM_VM_CR0_ALWAYS_ON_UNRESTRICTED_GUEST | \ + X86_CR0_WP | X86_CR0_PG | X86_CR0_PE) #define KVM_CR4_GUEST_OWNED_BITS \ (X86_CR4_PVI | X86_CR4_DE | X86_CR4_PCE | X86_CR4_OSFXSR \ | X86_CR4_OSXMMEXCPT | X86_CR4_LA57 | X86_CR4_TSD)