Skip to content

Commit 2142ac6

Browse files
committed
KVM: x86: Co-locate initialization of feature MSRs in kvm_arch_vcpu_create()
Bunch all of the feature MSR initialization in kvm_arch_vcpu_create() so that it can be easily quirked in a future patch. No functional change intended. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 0e3b70a commit 2142ac6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kvm/x86.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12313,6 +12313,8 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
1231312313

1231412314
kvm_async_pf_hash_reset(vcpu);
1231512315

12316+
vcpu->arch.arch_capabilities = kvm_get_arch_capabilities();
12317+
vcpu->arch.msr_platform_info = MSR_PLATFORM_INFO_CPUID_FAULT;
1231612318
vcpu->arch.perf_capabilities = kvm_caps.supported_perf_cap;
1231712319
kvm_pmu_init(vcpu);
1231812320

@@ -12327,8 +12329,6 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
1232712329
if (r)
1232812330
goto free_guest_fpu;
1232912331

12330-
vcpu->arch.arch_capabilities = kvm_get_arch_capabilities();
12331-
vcpu->arch.msr_platform_info = MSR_PLATFORM_INFO_CPUID_FAULT;
1233212332
kvm_xen_init_vcpu(vcpu);
1233312333
vcpu_load(vcpu);
1233412334
kvm_set_tsc_khz(vcpu, vcpu->kvm->arch.default_tsc_khz);

0 commit comments

Comments
 (0)