mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
target-i386: preserve FPU and MSR state on INIT
Most MSRs, plus the FPU, MMX, MXCSR, XMM and YMM registers should not be zeroed on INIT (Table 9-1 in the Intel SDM). Copy them out of CPUX86State and back in, instead of special casing env->pat. The relevant fields are already consecutive except PAT and SMBASE. However: - KVM and Hyper-V MSRs should be reset because they include memory locations written by the hypervisor. These MSRs are moved together at the end of the preserved area. - SVM state can be moved out of the way since it is written by VMRUN. Cc: Andreas Faerber <afaerber@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
05e7e819d7
commit
43175fa96a
3 changed files with 35 additions and 20 deletions
|
@ -2418,8 +2418,7 @@ static void x86_cpu_reset(CPUState *s)
|
|||
|
||||
xcc->parent_reset(s);
|
||||
|
||||
|
||||
memset(env, 0, offsetof(CPUX86State, pat));
|
||||
memset(env, 0, offsetof(CPUX86State, cpuid_level));
|
||||
|
||||
tlb_flush(s, 1);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue