提交 736fdf72 编写于 作者: D David Hildenbrand 提交者: Paolo Bonzini

KVM: VMX: rename RDSEED and RDRAND vmx ctrls to reflect exiting

Let's just name these according to the SDM. This should make it clearer
that the are used to enable exiting and not the feature itself.
Signed-off-by: NDavid Hildenbrand <david@redhat.com>
Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
上级 1af1ac91
...@@ -70,11 +70,11 @@ ...@@ -70,11 +70,11 @@
#define SECONDARY_EXEC_APIC_REGISTER_VIRT 0x00000100 #define SECONDARY_EXEC_APIC_REGISTER_VIRT 0x00000100
#define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY 0x00000200 #define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY 0x00000200
#define SECONDARY_EXEC_PAUSE_LOOP_EXITING 0x00000400 #define SECONDARY_EXEC_PAUSE_LOOP_EXITING 0x00000400
#define SECONDARY_EXEC_RDRAND 0x00000800 #define SECONDARY_EXEC_RDRAND_EXITING 0x00000800
#define SECONDARY_EXEC_ENABLE_INVPCID 0x00001000 #define SECONDARY_EXEC_ENABLE_INVPCID 0x00001000
#define SECONDARY_EXEC_ENABLE_VMFUNC 0x00002000 #define SECONDARY_EXEC_ENABLE_VMFUNC 0x00002000
#define SECONDARY_EXEC_SHADOW_VMCS 0x00004000 #define SECONDARY_EXEC_SHADOW_VMCS 0x00004000
#define SECONDARY_EXEC_RDSEED 0x00010000 #define SECONDARY_EXEC_RDSEED_EXITING 0x00010000
#define SECONDARY_EXEC_ENABLE_PML 0x00020000 #define SECONDARY_EXEC_ENABLE_PML 0x00020000
#define SECONDARY_EXEC_XSAVES 0x00100000 #define SECONDARY_EXEC_XSAVES 0x00100000
#define SECONDARY_EXEC_TSC_SCALING 0x02000000 #define SECONDARY_EXEC_TSC_SCALING 0x02000000
......
...@@ -3650,8 +3650,8 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf) ...@@ -3650,8 +3650,8 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY | SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
SECONDARY_EXEC_SHADOW_VMCS | SECONDARY_EXEC_SHADOW_VMCS |
SECONDARY_EXEC_XSAVES | SECONDARY_EXEC_XSAVES |
SECONDARY_EXEC_RDSEED | SECONDARY_EXEC_RDSEED_EXITING |
SECONDARY_EXEC_RDRAND | SECONDARY_EXEC_RDRAND_EXITING |
SECONDARY_EXEC_ENABLE_PML | SECONDARY_EXEC_ENABLE_PML |
SECONDARY_EXEC_TSC_SCALING | SECONDARY_EXEC_TSC_SCALING |
SECONDARY_EXEC_ENABLE_VMFUNC; SECONDARY_EXEC_ENABLE_VMFUNC;
...@@ -5261,13 +5261,13 @@ static u32 vmx_exec_control(struct vcpu_vmx *vmx) ...@@ -5261,13 +5261,13 @@ static u32 vmx_exec_control(struct vcpu_vmx *vmx)
static bool vmx_rdrand_supported(void) static bool vmx_rdrand_supported(void)
{ {
return vmcs_config.cpu_based_2nd_exec_ctrl & return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_RDRAND; SECONDARY_EXEC_RDRAND_EXITING;
} }
static bool vmx_rdseed_supported(void) static bool vmx_rdseed_supported(void)
{ {
return vmcs_config.cpu_based_2nd_exec_ctrl & return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_RDSEED; SECONDARY_EXEC_RDSEED_EXITING;
} }
static void vmx_compute_secondary_exec_control(struct vcpu_vmx *vmx) static void vmx_compute_secondary_exec_control(struct vcpu_vmx *vmx)
...@@ -5361,30 +5361,30 @@ static void vmx_compute_secondary_exec_control(struct vcpu_vmx *vmx) ...@@ -5361,30 +5361,30 @@ static void vmx_compute_secondary_exec_control(struct vcpu_vmx *vmx)
if (vmx_rdrand_supported()) { if (vmx_rdrand_supported()) {
bool rdrand_enabled = guest_cpuid_has(vcpu, X86_FEATURE_RDRAND); bool rdrand_enabled = guest_cpuid_has(vcpu, X86_FEATURE_RDRAND);
if (rdrand_enabled) if (rdrand_enabled)
exec_control &= ~SECONDARY_EXEC_RDRAND; exec_control &= ~SECONDARY_EXEC_RDRAND_EXITING;
if (nested) { if (nested) {
if (rdrand_enabled) if (rdrand_enabled)
vmx->nested.nested_vmx_secondary_ctls_high |= vmx->nested.nested_vmx_secondary_ctls_high |=
SECONDARY_EXEC_RDRAND; SECONDARY_EXEC_RDRAND_EXITING;
else else
vmx->nested.nested_vmx_secondary_ctls_high &= vmx->nested.nested_vmx_secondary_ctls_high &=
~SECONDARY_EXEC_RDRAND; ~SECONDARY_EXEC_RDRAND_EXITING;
} }
} }
if (vmx_rdseed_supported()) { if (vmx_rdseed_supported()) {
bool rdseed_enabled = guest_cpuid_has(vcpu, X86_FEATURE_RDSEED); bool rdseed_enabled = guest_cpuid_has(vcpu, X86_FEATURE_RDSEED);
if (rdseed_enabled) if (rdseed_enabled)
exec_control &= ~SECONDARY_EXEC_RDSEED; exec_control &= ~SECONDARY_EXEC_RDSEED_EXITING;
if (nested) { if (nested) {
if (rdseed_enabled) if (rdseed_enabled)
vmx->nested.nested_vmx_secondary_ctls_high |= vmx->nested.nested_vmx_secondary_ctls_high |=
SECONDARY_EXEC_RDSEED; SECONDARY_EXEC_RDSEED_EXITING;
else else
vmx->nested.nested_vmx_secondary_ctls_high &= vmx->nested.nested_vmx_secondary_ctls_high &=
~SECONDARY_EXEC_RDSEED; ~SECONDARY_EXEC_RDSEED_EXITING;
} }
} }
...@@ -8401,9 +8401,9 @@ static bool nested_vmx_exit_reflected(struct kvm_vcpu *vcpu, u32 exit_reason) ...@@ -8401,9 +8401,9 @@ static bool nested_vmx_exit_reflected(struct kvm_vcpu *vcpu, u32 exit_reason)
case EXIT_REASON_RDPMC: case EXIT_REASON_RDPMC:
return nested_cpu_has(vmcs12, CPU_BASED_RDPMC_EXITING); return nested_cpu_has(vmcs12, CPU_BASED_RDPMC_EXITING);
case EXIT_REASON_RDRAND: case EXIT_REASON_RDRAND:
return nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDRAND); return nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDRAND_EXITING);
case EXIT_REASON_RDSEED: case EXIT_REASON_RDSEED:
return nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDSEED); return nested_cpu_has2(vmcs12, SECONDARY_EXEC_RDSEED_EXITING);
case EXIT_REASON_RDTSC: case EXIT_REASON_RDTSCP: case EXIT_REASON_RDTSC: case EXIT_REASON_RDTSCP:
return nested_cpu_has(vmcs12, CPU_BASED_RDTSC_EXITING); return nested_cpu_has(vmcs12, CPU_BASED_RDTSC_EXITING);
case EXIT_REASON_VMCALL: case EXIT_REASON_VMCLEAR: case EXIT_REASON_VMCALL: case EXIT_REASON_VMCLEAR:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册