i386: wire up MSR_IA32_MISC_ENABLE

It's needed for its default value - bit 0 specifies that "rep movs" is
good enough for memcpy, and Linux may use a slower memcpu if it is not set,
depending on cpu family/model.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
Avi Kivity 2011-10-04 16:26:35 +02:00 committed by Marcelo Tosatti
parent aa82ba549a
commit 21e87c4625
5 changed files with 48 additions and 0 deletions

View file

@ -328,6 +328,24 @@ static const VMStateDescription vmstate_msr_tscdeadline = {
}
};
static bool misc_enable_needed(void *opaque)
{
CPUState *env = opaque;
return env->msr_ia32_misc_enable != MSR_IA32_MISC_ENABLE_DEFAULT;
}
static const VMStateDescription vmstate_msr_ia32_misc_enable = {
.name = "cpu/msr_ia32_misc_enable",
.version_id = 1,
.minimum_version_id = 1,
.minimum_version_id_old = 1,
.fields = (VMStateField []) {
VMSTATE_UINT64(msr_ia32_misc_enable, CPUState),
VMSTATE_END_OF_LIST()
}
};
static const VMStateDescription vmstate_cpu = {
.name = "cpu",
.version_id = CPU_SAVE_VERSION,
@ -441,6 +459,9 @@ static const VMStateDescription vmstate_cpu = {
}, {
.vmsd = &vmstate_msr_tscdeadline,
.needed = tscdeadline_needed,
}, {
.vmsd = &vmstate_msr_ia32_misc_enable,
.needed = misc_enable_needed,
} , {
/* empty */
}