mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-23 23:35:14 +00:00
target-i386: Add a marker to end of the region zeroed on reset
Instead of using cpuid_level, use an empty struct as a marker (like we already did with {start,end}_init_save). This will avoid accidentaly resetting the wrong fields if we change the field ordering on CPUX86State. Backports commit 5e992a8e337e710ea2d02f35668ac55a80e15f99 from qemu
This commit is contained in:
parent
c78d24b93c
commit
6861fe80cf
|
@ -2806,7 +2806,7 @@ static void x86_cpu_reset(CPUState *s)
|
|||
|
||||
xcc->parent_reset(s);
|
||||
|
||||
memset(env, 0, offsetof(CPUX86State, cpuid_level));
|
||||
memset(env, 0, offsetof(CPUX86State, end_reset_fields));
|
||||
|
||||
tlb_flush(s, 1);
|
||||
|
||||
|
|
|
@ -1101,6 +1101,7 @@ typedef struct CPUX86State {
|
|||
CPU_COMMON
|
||||
|
||||
/* Fields from here on are preserved across CPU reset. */
|
||||
struct {} end_reset_fields;
|
||||
|
||||
/* processor features (e.g. for CPUID insn) */
|
||||
uint32_t cpuid_level;
|
||||
|
|
Loading…
Reference in a new issue