qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Bill Paul <wpaul@windriver.com>, qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] Possible bug in target-i386/helper.c:do_cpu_init()?
Date: Wed, 30 Sep 2015 19:05:44 +0200	[thread overview]
Message-ID: <560C1668.3080200@redhat.com> (raw)
In-Reply-To: <201509241626.33410.wpaul@windriver.com>



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

      parent reply	other threads:[~2015-09-30 17:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 23:26 [Qemu-devel] Possible bug in target-i386/helper.c:do_cpu_init()? Bill Paul
2015-09-30 16:54 ` Bill Paul
2015-09-30 17:05 ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560C1668.3080200@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=wpaul@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).