Skip to content

Commit 346d725

Browse files
bonziniSomasundaram Krishnasamy
authored andcommitted
KVM: nVMX: include conditional controls in /dev/kvm KVM_GET_MSRS
Some secondary controls are automatically enabled/disabled based on the CPUID values that are set for the guest. However, they are still available at a global level and therefore should be present when KVM_GET_MSRS is sent to /dev/kvm. Fixes: 1389309 ("KVM: nVMX: expose VMX capabilities for nested hypervisors to userspace", 2018-02-26) Reviewed-by: Liran Alon <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> (cherry picked from commit 6defc59) Orabug: 31699256 Conflicts: arch/x86/kvm/vmx/nested.c This file was split out later from arch/x86/kvm/vmx.c. Signed-off-by: Maciej S. Szmigiero <[email protected]> Reviewed-by: David Edmondson <[email protected]> Reviewed-by: Mihai Carabas <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent cfb1edb commit 346d725

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arch/x86/kvm/vmx.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3658,10 +3658,15 @@ static void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, bool apicv)
36583658
msrs->secondary_ctls_low = 0;
36593659
msrs->secondary_ctls_high &=
36603660
SECONDARY_EXEC_DESC |
3661+
SECONDARY_EXEC_RDTSCP |
36613662
SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
3663+
SECONDARY_EXEC_WBINVD_EXITING |
36623664
SECONDARY_EXEC_APIC_REGISTER_VIRT |
36633665
SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
3664-
SECONDARY_EXEC_WBINVD_EXITING;
3666+
SECONDARY_EXEC_RDRAND_EXITING |
3667+
SECONDARY_EXEC_ENABLE_INVPCID |
3668+
SECONDARY_EXEC_RDSEED_EXITING |
3669+
SECONDARY_EXEC_XSAVES;
36653670

36663671
/*
36673672
* We can emulate "VMCS shadowing," even if the hardware

0 commit comments

Comments
 (0)