qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, 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 12:00:01 +0200	[thread overview]
Message-ID: <674de496-b0fb-486b-b74e-f4f856e6d9bc@redhat.com> (raw)
In-Reply-To: <5d461945-155b-40e8-bab4-502e57d94b03@linaro.org>

On 5/5/25 11:43, Philippe Mathieu-Daudé wrote:
> 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".
That would be a semantic change which I really want to avoid in this series.

I don't think target_long/target_ulong is a big blocker towards 
single-binary anyway.  The trick is to confine it to target/, making it 
essentially a #define.  That is, let target/* include one of two new 
headers target_long_32.h and target_long_64.h.  See 
lore.kernel.org/r/68b6c799-6407-43cc-aebc-a0ef6b8b64fa@redhat.com as well.

For the same reason I think target_long_bits() is a step in the wrong 
direction.

Paolo



  reply	other threads:[~2025-05-05 10:00 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é
2025-05-05 10:00     ` Paolo Bonzini [this message]
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=674de496-b0fb-486b-b74e-f4f856e6d9bc@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --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).