From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: wei.liu@kernel.org
Subject: Re: [PATCH 2/4] target/i386/emulate: stop overloading decode->op[N].ptr
Date: Mon, 5 May 2025 11:43:23 +0200 [thread overview]
Message-ID: <5d461945-155b-40e8-bab4-502e57d94b03@linaro.org> (raw)
In-Reply-To: <20250502214841.242584-3-pbonzini@redhat.com>
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 <pbonzini@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;
next prev parent reply other threads:[~2025-05-05 9:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-02 21:48 [CFT PATCH 0/4] target/i386/emulate: cleanups Paolo Bonzini
2025-05-02 21:48 ` [PATCH 1/4] target/i386/emulate: fix target_ulong format strings Paolo Bonzini
2025-05-02 21:48 ` [PATCH 2/4] target/i386/emulate: stop overloading decode->op[N].ptr Paolo Bonzini
2025-05-03 10:46 ` BALATON Zoltan
2025-05-05 9:43 ` Philippe Mathieu-Daudé [this message]
2025-05-05 10:00 ` Paolo Bonzini
2025-05-05 10:54 ` Philippe Mathieu-Daudé
2025-05-05 12:59 ` Paolo Bonzini
2025-05-05 18:11 ` Pierrick Bouvier
2025-05-05 19:33 ` Richard Henderson
2025-05-02 21:48 ` [PATCH 3/4] target/i386/emulate: mostly rewrite flags handling Paolo Bonzini
2025-05-02 21:48 ` [PATCH 4/4] target/i386: remove lflags Paolo Bonzini
2025-05-03 5:38 ` [CFT PATCH 0/4] target/i386/emulate: cleanups Wei Liu
2025-05-03 7:01 ` Paolo Bonzini
2025-05-05 18:33 ` Wei Liu
2025-05-05 18:34 ` Wei Liu
2025-05-09 12:56 ` Magnus Kulke
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=5d461945-155b-40e8-bab4-502e57d94b03@linaro.org \
--to=philmd@linaro.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wei.liu@kernel.org \
/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).