Skip to content

Commit 662f681

Browse files
committed
KVM: VMX: Rename XSAVES control to follow KVM's preferred "ENABLE_XYZ"
Rename the XSAVES secondary execution control to follow KVM's preferred style so that XSAVES related logic can use common macros that depend on KVM's preferred style. No functional change intended. Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com> Link: https://lore.kernel.org/r/20230815203653.519297-6-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 0497d2a commit 662f681

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

arch/x86/include/asm/vmx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
#define SECONDARY_EXEC_RDSEED_EXITING VMCS_CONTROL_BIT(RDSEED_EXITING)
7272
#define SECONDARY_EXEC_ENABLE_PML VMCS_CONTROL_BIT(PAGE_MOD_LOGGING)
7373
#define SECONDARY_EXEC_PT_CONCEAL_VMX VMCS_CONTROL_BIT(PT_CONCEAL_VMX)
74-
#define SECONDARY_EXEC_XSAVES VMCS_CONTROL_BIT(XSAVES)
74+
#define SECONDARY_EXEC_ENABLE_XSAVES VMCS_CONTROL_BIT(XSAVES)
7575
#define SECONDARY_EXEC_MODE_BASED_EPT_EXEC VMCS_CONTROL_BIT(MODE_BASED_EPT_EXEC)
7676
#define SECONDARY_EXEC_PT_USE_GPA VMCS_CONTROL_BIT(PT_USE_GPA)
7777
#define SECONDARY_EXEC_TSC_SCALING VMCS_CONTROL_BIT(TSC_SCALING)

arch/x86/kvm/vmx/capabilities.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static inline bool cpu_has_vmx_pml(void)
252252
static inline bool cpu_has_vmx_xsaves(void)
253253
{
254254
return vmcs_config.cpu_based_2nd_exec_ctrl &
255-
SECONDARY_EXEC_XSAVES;
255+
SECONDARY_EXEC_ENABLE_XSAVES;
256256
}
257257

258258
static inline bool cpu_has_vmx_waitpkg(void)

arch/x86/kvm/vmx/hyperv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
SECONDARY_EXEC_DESC | \
7979
SECONDARY_EXEC_ENABLE_RDTSCP | \
8080
SECONDARY_EXEC_ENABLE_INVPCID | \
81-
SECONDARY_EXEC_XSAVES | \
81+
SECONDARY_EXEC_ENABLE_XSAVES | \
8282
SECONDARY_EXEC_RDSEED_EXITING | \
8383
SECONDARY_EXEC_RDRAND_EXITING | \
8484
SECONDARY_EXEC_TSC_SCALING | \

arch/x86/kvm/vmx/nested.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,7 +2307,7 @@ static void prepare_vmcs02_early(struct vcpu_vmx *vmx, struct loaded_vmcs *vmcs0
23072307
SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
23082308
SECONDARY_EXEC_ENABLE_INVPCID |
23092309
SECONDARY_EXEC_ENABLE_RDTSCP |
2310-
SECONDARY_EXEC_XSAVES |
2310+
SECONDARY_EXEC_ENABLE_XSAVES |
23112311
SECONDARY_EXEC_ENABLE_USR_WAIT_PAUSE |
23122312
SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY |
23132313
SECONDARY_EXEC_APIC_REGISTER_VIRT |
@@ -6331,7 +6331,7 @@ static bool nested_vmx_l1_wants_exit(struct kvm_vcpu *vcpu,
63316331
* If if it were, XSS would have to be checked against
63326332
* the XSS exit bitmap in vmcs12.
63336333
*/
6334-
return nested_cpu_has2(vmcs12, SECONDARY_EXEC_XSAVES);
6334+
return nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_XSAVES);
63356335
case EXIT_REASON_UMWAIT:
63366336
case EXIT_REASON_TPAUSE:
63376337
return nested_cpu_has2(vmcs12,
@@ -6874,7 +6874,7 @@ static void nested_vmx_setup_secondary_ctls(u32 ept_caps,
68746874
SECONDARY_EXEC_ENABLE_INVPCID |
68756875
SECONDARY_EXEC_ENABLE_VMFUNC |
68766876
SECONDARY_EXEC_RDSEED_EXITING |
6877-
SECONDARY_EXEC_XSAVES |
6877+
SECONDARY_EXEC_ENABLE_XSAVES |
68786878
SECONDARY_EXEC_TSC_SCALING |
68796879
SECONDARY_EXEC_ENABLE_USR_WAIT_PAUSE;
68806880

arch/x86/kvm/vmx/nested.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static inline int nested_cpu_has_ept(struct vmcs12 *vmcs12)
168168

169169
static inline bool nested_cpu_has_xsaves(struct vmcs12 *vmcs12)
170170
{
171-
return nested_cpu_has2(vmcs12, SECONDARY_EXEC_XSAVES);
171+
return nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_XSAVES);
172172
}
173173

174174
static inline bool nested_cpu_has_pml(struct vmcs12 *vmcs12)

arch/x86/kvm/vmx/vmx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4614,7 +4614,7 @@ static u32 vmx_secondary_exec_control(struct vcpu_vmx *vmx)
46144614

46154615
if (cpu_has_vmx_xsaves())
46164616
vmx_adjust_secondary_exec_control(vmx, &exec_control,
4617-
SECONDARY_EXEC_XSAVES,
4617+
SECONDARY_EXEC_ENABLE_XSAVES,
46184618
vcpu->arch.xsaves_enabled, false);
46194619

46204620
/*

arch/x86/kvm/vmx/vmx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ static inline u8 vmx_get_rvi(void)
562562
SECONDARY_EXEC_APIC_REGISTER_VIRT | \
563563
SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY | \
564564
SECONDARY_EXEC_SHADOW_VMCS | \
565-
SECONDARY_EXEC_XSAVES | \
565+
SECONDARY_EXEC_ENABLE_XSAVES | \
566566
SECONDARY_EXEC_RDSEED_EXITING | \
567567
SECONDARY_EXEC_RDRAND_EXITING | \
568568
SECONDARY_EXEC_ENABLE_PML | \

0 commit comments

Comments
 (0)