qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Tao Wu <lepton@google.com>, qemu-devel@nongnu.org
Cc: rth@twiddle.net, ehabkost@redhat.com
Subject: Re: [Qemu-devel] [PATCH] target/i386: hax: Move hax_setup_qemu_emulator.
Date: Wed, 10 Jan 2018 14:27:39 +0100	[thread overview]
Message-ID: <ec848ee7-85e7-de79-bb58-60ad12d33256@redhat.com> (raw)
In-Reply-To: <20180110064706.49777-1-lepton@google.com>

On 10/01/2018 07:47, Tao Wu wrote:
> hax_setup_qemu_emulator reference env->efer which is updated in
> hax_get_msrs, so it has to be called after hax_get_msrs. This fix
> the bug that sometimes dump_state show 32 bits regs even in 64 bits
> mode.
> 
> Signed-off-by: Tao Wu <lepton@google.com>
> ---
>  target/i386/hax-all.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c
> index 3ce6950296..a933bd462d 100644
> --- a/target/i386/hax-all.c
> +++ b/target/i386/hax-all.c
> @@ -887,9 +887,6 @@ static int hax_sync_vcpu_register(CPUArchState *env, int set)
>              return -1;
>          }
>      }
> -    if (!set) {
> -        hax_setup_qemu_emulator(env);
> -    }
>      return 0;
>  }
>  
> @@ -1070,6 +1067,7 @@ static int hax_arch_get_registers(CPUArchState *env)
>          return ret;
>      }
>  
> +    hax_setup_qemu_emulator(env);
>      return 0;
>  }
>  
> 

Queued, thanks.

Please look into sharing the similar code in target/i386/kvm.c
(kvm_get_sregs), since the HAX code has some bugs (for example,
HF_CPL_MASK should be SS.DPL, not CS.DPL).

Paolo

  reply	other threads:[~2018-01-10 13:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10  6:47 [Qemu-devel] [PATCH] target/i386: hax: Move hax_setup_qemu_emulator Tao Wu
2018-01-10 13:27 ` Paolo Bonzini [this message]
2018-01-10 18:05   ` Tao Wu(吴涛@Eng)
2018-01-10 19:50 ` [Qemu-devel] [PATCH v2 1/3] target/i386: move hflags update code to a function Tao Wu
2018-01-10 19:50   ` [Qemu-devel] [PATCH v2 2/3] target/i386: hax: change to use x86_update_hflags Tao Wu
2018-01-10 19:50   ` [Qemu-devel] [PATCH v2 3/3] target/i386: hax: Move x86_update_hflags Tao Wu
2018-01-11 13:16   ` [Qemu-devel] [PATCH v2 1/3] target/i386: move hflags update code to a function Paolo Bonzini

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=ec848ee7-85e7-de79-bb58-60ad12d33256@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=lepton@google.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).