Hi Paolo,
On 2/5/25 23:48, Paolo Bonzini wrote:
decode->op[N].ptr can contain either a host pointer (!) in CPUState
or a guest virtual address. Pass the whole struct to read_val_ext
and write_val_ext, so that it can decide the contents based on the
operand type.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
target/i386/emulate/x86_decode.h | 9 ++-
target/i386/emulate/x86_emu.h | 8 +--
target/i386/emulate/x86_decode.c | 74 +++++++++----------
target/i386/emulate/x86_emu.c | 119 ++++++++++++++++---------------
4 files changed, 109 insertions(+), 101 deletions(-)
diff --git a/target/i386/emulate/x86_decode.h b/target/i386/emulate/x86_decode.h
index 87cc728598d..497cbdef9c7 100644
--- a/target/i386/emulate/x86_decode.h
+++ b/target/i386/emulate/x86_decode.h
@@ -266,7 +266,10 @@ typedef struct x86_decode_op {
int reg;
target_ulong val;
- target_ulong ptr;
+ union {
+ target_ulong addr;
Prefer 'vaddr' type for "guest virtual address".
+ void *regptr;
+ };
} x86_decode_op;