[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] i386: EFER vs 32-bit CPU
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] i386: EFER vs 32-bit CPU |
Date: |
Wed, 29 May 2019 12:30:46 +0100 |
User-agent: |
Mutt/1.11.4 (2019-03-13) |
* Pavel Dovgalyuk (address@hidden) wrote:
> Hello!
>
>
>
> I found this while debugging the inconsistent saved/restored state of the
> virtual machine.
>
>
>
> i386 (32 bit) emulation uses this register (in wrmsr and in MMU fault
> processing).
>
> But it does not included in VMState, because "efer" field is disabled with
> #ifdef TARGET_X86_64
>
>
>
> I think that efer should be saved for i386 too, but how it should be made to
> preserve the backward
> compatibility?
>
> Should we add a section for i386, which duplicates efer, or just version_id
> of the main VMSD should
> be updated?
You could do:
#ifdef TARGET_X86_64
VMSTATE_UINT64(env.efer, X86CPU),
VMSTATE_UINT64(env.star, X86CPU),
...
to become:
VMSTATE_UINT64_TEST(env.efer, X86CPU, efer_needed)
#ifdef TARGET_X86_64
VMSTATE_UINT64(env.star, X86CPU),
and then make efer_needed a function that returns true if
TARGET_X86_64 or it's a new machine type that knows about whatever
you're going to do with it.
Dave
>
>
> Pavel Dovgalyuk
>
>
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
Re: [Qemu-devel] i386: EFER vs 32-bit CPU, Peter Xu, 2019/05/29
Re: [Qemu-devel] i386: EFER vs 32-bit CPU, TeLeMan, 2019/05/30