Commit 87849b1c authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini

KVM: x86: Clean up CPUID 0x7 sub-leaf loop

Refactor the sub-leaf loop for CPUID 0x7 to move the main leaf out of
said loop.  The emitted code savings is basically a mirage, as the
handling of the main leaf can easily be split to its own helper to avoid
code bloat.

No functional change intended.
Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 8b2fc445
...@@ -573,16 +573,16 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function, ...@@ -573,16 +573,16 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
case 7: { case 7: {
int i; int i;
for (i = 0; ; ) { do_cpuid_7_mask(entry, 0);
do_cpuid_7_mask(&entry[i], i);
if (i == entry->eax) for (i = 1; i <= entry->eax; i++) {
break;
if (*nent >= maxnent) if (*nent >= maxnent)
goto out; goto out;
++i;
do_host_cpuid(&entry[i], function, i); do_host_cpuid(&entry[i], function, i);
++*nent; ++*nent;
do_cpuid_7_mask(&entry[i], i);
} }
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment