Patch "nVMX x86: Check VMX-preemption timer controls on vmentry of L2 guests" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    nVMX x86: Check VMX-preemption timer controls on vmentry of L2 guests

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nvmx-x86-check-vmx-preemption-timer-controls-on-vmen.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit aefe920482dc9da233499ff56187e9feabb136e0
Author: Krish Sadhukhan <krish.sadhukhan@xxxxxxxxxx>
Date:   Thu Nov 1 01:21:58 2018 -0400

    nVMX x86: Check VMX-preemption timer controls on vmentry of L2 guests
    
    [ Upstream commit 14aa61d0a9eb3ddad06c3a0033f88b5fa7f05613 ]
    
    According to section "Checks on VMX Controls" in Intel SDM vol 3C, the
    following check needs to be enforced on vmentry of L2 guests:
    
        If the "activate VMX-preemption timer" VM-execution control is 0, the
        the "save VMX-preemption timer value" VM-exit control must also be 0.
    
    Signed-off-by: Krish Sadhukhan <krish.sadhukhan@xxxxxxxxxx>
    Reviewed-by: Mihai Carabas <mihai.carabas@xxxxxxxxxx>
    Reviewed-by: Liran Alon <liran.alon@xxxxxxxxxx>
    Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
    Stable-dep-of: a44b331614e6 ("KVM: x86/vmx: Do not skip segment attributes if unusable bit is set")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 9bb696d7300c..f8ad29968e85 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2062,6 +2062,12 @@ static inline bool nested_cpu_has_shadow_vmcs(struct vmcs12 *vmcs12)
 	return nested_cpu_has2(vmcs12, SECONDARY_EXEC_SHADOW_VMCS);
 }
 
+static inline bool nested_cpu_has_save_preemption_timer(struct vmcs12 *vmcs12)
+{
+	return vmcs12->vm_exit_controls &
+	    VM_EXIT_SAVE_VMX_PREEMPTION_TIMER;
+}
+
 static inline bool is_nmi(u32 intr_info)
 {
 	return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VALID_MASK))
@@ -12609,6 +12615,10 @@ static int check_vmentry_prereqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
 	if (nested_vmx_check_msr_switch_controls(vcpu, vmcs12))
 		return VMXERR_ENTRY_INVALID_CONTROL_FIELD;
 
+	if (!nested_cpu_has_preemption_timer(vmcs12) &&
+	    nested_cpu_has_save_preemption_timer(vmcs12))
+		return VMXERR_ENTRY_INVALID_CONTROL_FIELD;
+
 	if (nested_vmx_check_pml_controls(vcpu, vmcs12))
 		return VMXERR_ENTRY_INVALID_CONTROL_FIELD;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux