On 04/22/2013 01:00 PM, Eduardo Habkost wrote: > Instead of open-coding the filtering code for each feature word, change > the existing code to use the feature_word_info array, that have exactly > the same CPUID eax/ecx/register values for each feature word. > > Signed-off-by: Eduardo Habkost <[email protected]> > --- > target-i386/cpu.c | 24 +++++++----------------- > 1 file changed, 7 insertions(+), 17 deletions(-) >
> + for (w = 0; w < FEATURE_WORDS; w++) {
> + FeatureWordInfo *wi = &feature_word_info[w];
> + env->features[w] &= kvm_arch_get_supported_cpuid(s, wi->cpuid_eax,
> + wi->cpuid_ecx,
> + wi->cpuid_reg);
Indentation is unusual, but the resulting alignment is nicer than having
'wi->' flush under 's'. I would have written the call in four lines
instead of 3, but that's not essential.
Reviewed-by: Eric Blake <[email protected]>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
