diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2020-03-02 15:56:21 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-03-16 17:58:07 +0100 |
commit | 0eee8f9d9d3b2838fdd383328129df524cea4ba7 (patch) | |
tree | 615e82221e2aabd843b3547aea1fff268955e8af /arch/x86/kvm | |
parent | 695538aa21c057578a0c70e1aa22fd97fd407930 (diff) |
KVM: x86: Use common loop iterator when handling CPUID 0xD.N
Use __do_cpuid_func()'s common loop iterator, "i", when enumerating the
sub-leafs for CPUID 0xD now that the CPUID 0xD loop doesn't need to
manual maintain separate counts for the entries index and CPUID index.
No functional changed intended.
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/cpuid.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 4bf4f7d7741e..85f292088d91 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -634,7 +634,6 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) } break; case 0xd: { - int idx; u64 supported = kvm_supported_xcr0(); entry->eax &= supported; @@ -658,11 +657,11 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) entry->ecx = 0; entry->edx = 0; - for (idx = 2; idx < 64; ++idx) { - if (!(supported & BIT_ULL(idx))) + for (i = 2; i < 64; ++i) { + if (!(supported & BIT_ULL(i))) continue; - entry = do_host_cpuid(array, function, idx); + entry = do_host_cpuid(array, function, i); if (!entry) goto out; |