[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Possible bug in target-i386/helper.c:do_cpu_init()?
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] Possible bug in target-i386/helper.c:do_cpu_init()? |
Date: |
Wed, 30 Sep 2015 19:05:44 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 25/09/2015 01:26, Bill Paul wrote:
> The result of this is that if the CPU was in long mode and you do an INIT
> IPI,
> the CPU still has the EFER.LMA and EFER.LME bits set, even though it's not
> actually running in long mode anymore. It doesn't seem possible for the guest
> to get the CPU out of this state, and one nasty side-effect is that trying to
> set the CR0 to enable paging never succeeds.
>
> I added the following code at line 1240 above as a workaround:
>
> #ifdef TARGET_X86_64
> /*
> * The initial state of the CPU is not 64-bit mode. This being
> * the case, don't leave the EFER.LME or EFER.LME bits set.
> */
>
> cpu_load_efer(env, 0);
> #endif
>
> This seemed to fix the problem I was having, however I'm not certain this is
> the correct fix.
I think a better fix is to move the "uint64_t efer;" field to some place
before the dummy "struct {} start_init_save;" marker in
target-i386/cpu.h. Can you test it and send a patch if it works?
Thanks,
Paolo