Re: [PATCH] KVM: x86: nVMX: allow RSM to restore VMXE CR4 flag

2019-03-27 Thread Vitaly Kuznetsov
Liran Alon writes: >> On 26 Mar 2019, at 15:48, Vitaly Kuznetsov wrote: >> >> Liran Alon writes: >> On 26 Mar 2019, at 15:07, Vitaly Kuznetsov wrote: - Instread of putting the temporary HF_SMM_MASK drop to rsm_enter_protected_mode() (as was suggested by Liran), move it to

Re: [PATCH] KVM: x86: nVMX: allow RSM to restore VMXE CR4 flag

2019-03-26 Thread Liran Alon
> On 26 Mar 2019, at 15:48, Vitaly Kuznetsov wrote: > > Liran Alon writes: > >>> On 26 Mar 2019, at 15:07, Vitaly Kuznetsov wrote: >>> - Instread of putting the temporary HF_SMM_MASK drop to >>> rsm_enter_protected_mode() (as was suggested by Liran), move it to >>> emulator_set_cr()

Re: [PATCH] KVM: x86: nVMX: allow RSM to restore VMXE CR4 flag

2019-03-26 Thread Vitaly Kuznetsov
Liran Alon writes: >> On 26 Mar 2019, at 15:07, Vitaly Kuznetsov wrote: >> >> Commit 5bea5123cbf0 ("KVM: VMX: check nested state and CR4.VMXE against >> SMM") introduced a check to vmx_set_cr4() forbidding to set VMXE from SMM. >> The check is correct, however, there is a special case when RSM

Re: [PATCH] KVM: x86: nVMX: allow RSM to restore VMXE CR4 flag

2019-03-26 Thread Liran Alon
> On 26 Mar 2019, at 15:07, Vitaly Kuznetsov wrote: > > Commit 5bea5123cbf0 ("KVM: VMX: check nested state and CR4.VMXE against > SMM") introduced a check to vmx_set_cr4() forbidding to set VMXE from SMM. > The check is correct, however, there is a special case when RSM is called > to leave

[PATCH] KVM: x86: nVMX: allow RSM to restore VMXE CR4 flag

2019-03-26 Thread Vitaly Kuznetsov
Commit 5bea5123cbf0 ("KVM: VMX: check nested state and CR4.VMXE against SMM") introduced a check to vmx_set_cr4() forbidding to set VMXE from SMM. The check is correct, however, there is a special case when RSM is called to leave SMM: rsm_enter_protected_mode() is called with HF_SMM_MASK still set