Skip to content

Commit 7c1b761

Browse files
calmisibonzini
authored andcommitted
KVM: x86: Rename cpuid_update() callback to vcpu_after_set_cpuid()
The name of callback cpuid_update() is misleading that it's not about updating CPUID settings of vcpu but updating the configurations of vcpu based on the CPUIDs. So rename it to vcpu_after_set_cpuid(). Signed-off-by: Xiaoyao Li <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 346ce35 commit 7c1b761

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

arch/x86/include/asm/kvm_host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ struct kvm_x86_ops {
10521052
void (*hardware_unsetup)(void);
10531053
bool (*cpu_has_accelerated_tpr)(void);
10541054
bool (*has_emulated_msr)(u32 index);
1055-
void (*cpuid_update)(struct kvm_vcpu *vcpu);
1055+
void (*vcpu_after_set_cpuid)(struct kvm_vcpu *vcpu);
10561056

10571057
unsigned int vm_size;
10581058
int (*vm_init)(struct kvm *kvm);

arch/x86/kvm/cpuid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ int kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu *vcpu,
228228
}
229229

230230
cpuid_fix_nx_cap(vcpu);
231-
kvm_x86_ops.cpuid_update(vcpu);
231+
kvm_x86_ops.vcpu_after_set_cpuid(vcpu);
232232
kvm_update_cpuid_runtime(vcpu);
233233
kvm_vcpu_after_set_cpuid(vcpu);
234234

@@ -257,7 +257,7 @@ int kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu *vcpu,
257257
goto out;
258258
}
259259

260-
kvm_x86_ops.cpuid_update(vcpu);
260+
kvm_x86_ops.vcpu_after_set_cpuid(vcpu);
261261
kvm_update_cpuid_runtime(vcpu);
262262
kvm_vcpu_after_set_cpuid(vcpu);
263263
out:

arch/x86/kvm/svm/svm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3550,7 +3550,7 @@ static u64 svm_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio)
35503550
return 0;
35513551
}
35523552

3553-
static void svm_cpuid_update(struct kvm_vcpu *vcpu)
3553+
static void svm_vcpu_after_set_cpuid(struct kvm_vcpu *vcpu)
35543554
{
35553555
struct vcpu_svm *svm = to_svm(vcpu);
35563556

@@ -4050,7 +4050,7 @@ static struct kvm_x86_ops svm_x86_ops __initdata = {
40504050

40514051
.get_exit_info = svm_get_exit_info,
40524052

4053-
.cpuid_update = svm_cpuid_update,
4053+
.vcpu_after_set_cpuid = svm_vcpu_after_set_cpuid,
40544054

40554055
.has_wbinvd_exit = svm_has_wbinvd_exit,
40564056

arch/x86/kvm/vmx/nested.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6354,7 +6354,8 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps)
63546354

63556355
/*
63566356
* secondary cpu-based controls. Do not include those that
6357-
* depend on CPUID bits, they are added later by vmx_cpuid_update.
6357+
* depend on CPUID bits, they are added later by
6358+
* vmx_vcpu_after_set_cpuid.
63586359
*/
63596360
if (msrs->procbased_ctls_high & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)
63606361
rdmsr(MSR_IA32_VMX_PROCBASED_CTLS2,

arch/x86/kvm/vmx/vmx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7236,7 +7236,7 @@ static void update_intel_pt_cfg(struct kvm_vcpu *vcpu)
72367236
vmx->pt_desc.ctl_bitmask &= ~(0xfULL << (32 + i * 4));
72377237
}
72387238

7239-
static void vmx_cpuid_update(struct kvm_vcpu *vcpu)
7239+
static void vmx_vcpu_after_set_cpuid(struct kvm_vcpu *vcpu)
72407240
{
72417241
struct vcpu_vmx *vmx = to_vmx(vcpu);
72427242

@@ -7894,7 +7894,7 @@ static struct kvm_x86_ops vmx_x86_ops __initdata = {
78947894

78957895
.get_exit_info = vmx_get_exit_info,
78967896

7897-
.cpuid_update = vmx_cpuid_update,
7897+
.vcpu_after_set_cpuid = vmx_vcpu_after_set_cpuid,
78987898

78997899
.has_wbinvd_exit = cpu_has_vmx_wbinvd_exit,
79007900

0 commit comments

Comments
 (0)