qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Roman Bolshakov <r.bolshakov@yadro.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Cameron Esfahani <dirty@apple.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH 06/13] i386: hvf: Use IP from CPUX86State
Date: Thu, 4 Jun 2020 08:47:59 +0200	[thread overview]
Message-ID: <a2911f10-b199-5c9b-c704-4e5457afd1bb@redhat.com> (raw)
In-Reply-To: <20200528193758.51454-7-r.bolshakov@yadro.com>

On 5/28/20 9:37 PM, Roman Bolshakov wrote:
> Drop and replace rip field from HVFX86EmulatorState in favor of eip from
> common CPUX86State.
> 
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
>  target/i386/hvf/hvf.c        |  6 +--
>  target/i386/hvf/x86.h        |  3 --
>  target/i386/hvf/x86_decode.c |  6 +--
>  target/i386/hvf/x86_emu.c    | 86 ++++++++++++++++++------------------
>  target/i386/hvf/x86_task.c   |  4 +-
>  5 files changed, 51 insertions(+), 54 deletions(-)
> 
[...]
> diff --git a/target/i386/hvf/x86.h b/target/i386/hvf/x86.h
> index 56fcde13c6..e3ab7c5137 100644
> --- a/target/i386/hvf/x86.h
> +++ b/target/i386/hvf/x86.h
> @@ -294,7 +294,6 @@ typedef struct lazy_flags {
>  /* Definition of hvf_x86_state is here */
>  struct HVFX86EmulatorState {
>      uint64_t fetch_rip;
> -    uint64_t rip;
>      struct x86_register regs[16];
>      struct x86_reg_flags   rflags;
>      struct lazy_flags   lflags;
> @@ -302,8 +301,6 @@ struct HVFX86EmulatorState {
>  };
>  
>  /* useful register access  macros */
> -#define RIP(cpu)    (cpu->hvf_emul->rip)
> -#define EIP(cpu)    ((uint32_t)cpu->hvf_emul->rip)
>  #define RFLAGS(cpu) (cpu->hvf_emul->rflags.rflags)
>  #define EFLAGS(cpu) (cpu->hvf_emul->rflags.eflags)
>  
[...]
> diff --git a/target/i386/hvf/x86_task.c b/target/i386/hvf/x86_task.c
> index 1daac6cc2b..834baec3ea 100644
> --- a/target/i386/hvf/x86_task.c
> +++ b/target/i386/hvf/x86_task.c
> @@ -38,7 +38,7 @@ static void save_state_to_tss32(CPUState *cpu, struct x86_tss_segment32 *tss)
>      CPUX86State *env = &x86_cpu->env;
>  
>      /* CR3 and ldt selector are not saved intentionally */
> -    tss->eip = EIP(env);
> +    tss->eip = (uint32_t)env->eip;
>      tss->eflags = EFLAGS(env);
>      tss->eax = EAX(env);
>      tss->ecx = ECX(env);
> @@ -64,7 +64,7 @@ static void load_state_from_tss32(CPUState *cpu, struct x86_tss_segment32 *tss)
>  
>      wvmcs(cpu->hvf_fd, VMCS_GUEST_CR3, tss->cr3);
>  
> -    RIP(env) = tss->eip;
> +    env->eip = tss->eip;
>      EFLAGS(env) = tss->eflags | 2;
>  
>      /* General purpose registers */
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



  reply	other threads:[~2020-06-04  6:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 19:37 [PATCH 00/13] i386: hvf: Remove HVFX86EmulatorState Roman Bolshakov
2020-05-28 19:37 ` [PATCH 01/13] i386: hvf: Move HVFState definition into hvf Roman Bolshakov
2020-06-05 14:19   ` Claudio Fontana
2020-05-28 19:37 ` [PATCH 02/13] i386: hvf: Drop useless declarations in sysemu Roman Bolshakov
2020-06-04  6:35   ` Philippe Mathieu-Daudé
2020-06-04  9:53   ` Claudio Fontana
2020-06-05 16:30     ` Roman Bolshakov
2020-05-28 19:37 ` [PATCH 03/13] i386: hvf: Clean stray includes " Roman Bolshakov
2020-06-05 14:20   ` Claudio Fontana
2020-05-28 19:37 ` [PATCH 04/13] i386: hvf: Drop unused variable Roman Bolshakov
2020-06-04  6:35   ` Philippe Mathieu-Daudé
2020-05-28 19:37 ` [PATCH 05/13] i386: hvf: Use ins_len to advance IP Roman Bolshakov
2020-06-04  6:39   ` Philippe Mathieu-Daudé
2020-06-04 18:15     ` Paolo Bonzini
2020-06-05 14:29       ` Philippe Mathieu-Daudé
2020-05-28 19:37 ` [PATCH 06/13] i386: hvf: Use IP from CPUX86State Roman Bolshakov
2020-06-04  6:47   ` Philippe Mathieu-Daudé [this message]
2020-06-04  9:06   ` Claudio Fontana
2020-05-28 19:37 ` [PATCH 07/13] i386: hvf: Drop fetch_rip from HVFX86EmulatorState Roman Bolshakov
2020-05-28 19:37 ` [PATCH 08/13] i386: hvf: Drop rflags " Roman Bolshakov
2020-05-28 19:37 ` [PATCH 09/13] i386: hvf: Drop copy of RFLAGS defines Roman Bolshakov
2020-05-28 19:37 ` [PATCH 10/13] i386: hvf: Drop regs in HVFX86EmulatorState Roman Bolshakov
2020-05-28 19:37 ` [PATCH 11/13] i386: hvf: Move lazy_flags into CPUX86State Roman Bolshakov
2020-06-04  6:43   ` Philippe Mathieu-Daudé
2020-05-28 19:37 ` [PATCH 12/13] i386: hvf: Move mmio_buf " Roman Bolshakov
2020-06-04 18:27   ` Paolo Bonzini
2020-06-05 17:24     ` Roman Bolshakov
2020-06-11 13:24     ` Claudio Fontana
2020-06-11 15:02       ` Roman Bolshakov
2020-05-28 19:37 ` [PATCH 13/13] i386: hvf: Drop HVFX86EmulatorState Roman Bolshakov
2020-05-29  2:57 ` [PATCH 00/13] i386: hvf: Remove HVFX86EmulatorState no-reply
2020-06-04  1:53 ` Cameron Esfahani

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=a2911f10-b199-5c9b-c704-4e5457afd1bb@redhat.com \
    --to=philmd@redhat.com \
    --cc=dirty@apple.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=r.bolshakov@yadro.com \
    --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).