qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kohei Tokunaga <ktokunaga.mail@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Stefan Weil" <sw@weilnetz.de>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	ktokunaga.mail@gmail.com
Subject: [PATCH 5/5] tci: use tcg_target_ulong when retrieving the pool data
Date: Fri, 23 May 2025 00:17:30 +0900	[thread overview]
Message-ID: <3ec0f9bd69a42965f55e079739045ef10f4d4d82.1747922170.git.ktokunaga.mail@gmail.com> (raw)
In-Reply-To: <cover.1747922170.git.ktokunaga.mail@gmail.com>

TCI's tcg_out_call stores "func" and "cif" as tcg_target_ulong in the TB
using the pool feature. On non-wasm hosts, tcg_target_ulong matches the
pointer size so this commit preserves the original behaviour. On the wasm
host, tcg_target_ulong differs from the pointer size so this change ensures
TCI retrieves the data using the correct type consistent with how it was
stored using the pool feature.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
---
 tcg/tci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tcg/tci.c b/tcg/tci.c
index 700e672616..cee65bceea 100644
--- a/tcg/tci.c
+++ b/tcg/tci.c
@@ -367,10 +367,12 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env,
                 ffi_cif *cif;
                 void *func;
                 unsigned i, s, n;
+                tcg_target_ulong *data;
 
                 tci_args_nl(insn, tb_ptr, &len, &ptr);
-                func = ((void **)ptr)[0];
-                cif = ((void **)ptr)[1];
+                data = ptr;
+                func = (void *)data[0];
+                cif = (void *)data[1];
 
                 n = cif->nargs;
                 for (i = s = 0; i < n; ++i) {
-- 
2.43.0



  parent reply	other threads:[~2025-05-22 15:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-22 15:17 [PATCH 0/5] Enable QEMU TCI to run 64bit guests on browsers Kohei Tokunaga
2025-05-22 15:17 ` [PATCH 1/5] meson.build: add TCG_VADDR_BITS for defining the vaddr size Kohei Tokunaga
2025-05-22 15:17 ` [PATCH 2/5] include: define vaddr based on TCG_VADDR_BITS Kohei Tokunaga
2025-05-22 15:17 ` [PATCH 3/5] tlb: specify address field size " Kohei Tokunaga
2025-05-22 15:17 ` [PATCH 4/5] tci: define TCG_TARGET_REG_BITS " Kohei Tokunaga
2025-05-22 15:17 ` Kohei Tokunaga [this message]
2025-06-03  2:41 ` [PATCH 0/5] Enable QEMU TCI to run 64bit guests on browsers Kohei Tokunaga

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=3ec0f9bd69a42965f55e079739045ef10f4d4d82.1747922170.git.ktokunaga.mail@gmail.com \
    --to=ktokunaga.mail@gmail.com \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@redhat.com \
    --cc=sw@weilnetz.de \
    /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).