[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/13] i386: hvf: Drop fetch_rip from HVFX86EmulatorState
From: |
Roman Bolshakov |
Subject: |
[PATCH 07/13] i386: hvf: Drop fetch_rip from HVFX86EmulatorState |
Date: |
Thu, 28 May 2020 22:37:52 +0300 |
The field is used to print address of instructions that have no parser
in decode_invalid(). RIP from VMCS is saved into fetch_rip before
decoding starts but it's also saved into env->eip in load_regs().
Therefore env->eip can be used instead of fetch_rip.
While at it, correct address printed in decode_invalid(). It prints an
address before the unknown instruction.
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
target/i386/hvf/hvf.c | 6 ------
target/i386/hvf/x86.h | 1 -
target/i386/hvf/x86_decode.c | 3 +--
3 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index 45ae55dd27..416a6fae7c 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -767,8 +767,6 @@ int hvf_vcpu_exec(CPUState *cpu)
struct x86_decode decode;
load_regs(cpu);
- env->hvf_emul->fetch_rip = rip;
-
decode_instruction(env, &decode);
exec_instruction(env, &decode);
store_regs(cpu);
@@ -809,8 +807,6 @@ int hvf_vcpu_exec(CPUState *cpu)
struct x86_decode decode;
load_regs(cpu);
- env->hvf_emul->fetch_rip = rip;
-
decode_instruction(env, &decode);
assert(ins_len == decode.len);
exec_instruction(env, &decode);
@@ -915,8 +911,6 @@ int hvf_vcpu_exec(CPUState *cpu)
struct x86_decode decode;
load_regs(cpu);
- env->hvf_emul->fetch_rip = rip;
-
decode_instruction(env, &decode);
exec_instruction(env, &decode);
store_regs(cpu);
diff --git a/target/i386/hvf/x86.h b/target/i386/hvf/x86.h
index e3ab7c5137..411e4b6599 100644
--- a/target/i386/hvf/x86.h
+++ b/target/i386/hvf/x86.h
@@ -293,7 +293,6 @@ typedef struct lazy_flags {
/* Definition of hvf_x86_state is here */
struct HVFX86EmulatorState {
- uint64_t fetch_rip;
struct x86_register regs[16];
struct x86_reg_flags rflags;
struct lazy_flags lflags;
diff --git a/target/i386/hvf/x86_decode.c b/target/i386/hvf/x86_decode.c
index a590088f54..d881542181 100644
--- a/target/i386/hvf/x86_decode.c
+++ b/target/i386/hvf/x86_decode.c
@@ -29,8 +29,7 @@
static void decode_invalid(CPUX86State *env, struct x86_decode *decode)
{
- printf("%llx: failed to decode instruction ", env->hvf_emul->fetch_rip -
- decode->len);
+ printf("%llx: failed to decode instruction ", env->eip);
for (int i = 0; i < decode->opcode_len; i++) {
printf("%x ", decode->opcode[i]);
}
--
2.26.1
- [PATCH 00/13] i386: hvf: Remove HVFX86EmulatorState, Roman Bolshakov, 2020/05/28
- [PATCH 03/13] i386: hvf: Clean stray includes in sysemu, Roman Bolshakov, 2020/05/28
- [PATCH 02/13] i386: hvf: Drop useless declarations in sysemu, Roman Bolshakov, 2020/05/28
- [PATCH 01/13] i386: hvf: Move HVFState definition into hvf, Roman Bolshakov, 2020/05/28
- [PATCH 04/13] i386: hvf: Drop unused variable, Roman Bolshakov, 2020/05/28
- [PATCH 06/13] i386: hvf: Use IP from CPUX86State, Roman Bolshakov, 2020/05/28
- [PATCH 08/13] i386: hvf: Drop rflags from HVFX86EmulatorState, Roman Bolshakov, 2020/05/28
- [PATCH 05/13] i386: hvf: Use ins_len to advance IP, Roman Bolshakov, 2020/05/28
- [PATCH 07/13] i386: hvf: Drop fetch_rip from HVFX86EmulatorState,
Roman Bolshakov <=
- [PATCH 10/13] i386: hvf: Drop regs in HVFX86EmulatorState, Roman Bolshakov, 2020/05/28
- [PATCH 11/13] i386: hvf: Move lazy_flags into CPUX86State, Roman Bolshakov, 2020/05/28
- [PATCH 12/13] i386: hvf: Move mmio_buf into CPUX86State, Roman Bolshakov, 2020/05/28
- [PATCH 09/13] i386: hvf: Drop copy of RFLAGS defines, Roman Bolshakov, 2020/05/28
- [PATCH 13/13] i386: hvf: Drop HVFX86EmulatorState, Roman Bolshakov, 2020/05/28
- Re: [PATCH 00/13] i386: hvf: Remove HVFX86EmulatorState, no-reply, 2020/05/28