]> git.proxmox.com Git - mirror_qemu.git/commit - target/i386/cpu.c
target-i386: xsave: Calculate enabled components only once
authorEduardo Habkost <ehabkost@redhat.com>
Thu, 22 Sep 2016 17:33:01 +0000 (14:33 -0300)
committerEduardo Habkost <ehabkost@redhat.com>
Tue, 27 Sep 2016 19:17:17 +0000 (16:17 -0300)
commit4928cd6de6b4211a79f98c8dc39115be1e815c2b
tree3950bca3f48341e384a1a20c847f3fb9736a74dc
parent9646f4927faf68e8690588c2fd6dc9834c440b58
target-i386: xsave: Calculate enabled components only once

Instead of checking both env->features and ena_mask at two
different places in the CPUID code, initialize ena_mask based on
the features that are enabled for the CPU, and then clear
unsupported bits based on kvm_arch_get_supported_cpuid().

The results should be exactly the same, but it will make it
easier to move the mask calculation elsewhare, and reuse
x86_cpu_filter_features() for the kvm_arch_get_supported_cpuid()
check.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
target-i386/cpu.c