From: "Alex Bennée" <alex.bennee@linaro.org>
To: Gautam Bhat <mindentropy@gmail.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Richard Henderson <richard.henderson@linaro.org>
Subject: Re: How does "rsi" get set in x86 prologue?
Date: Fri, 31 Jan 2025 12:58:52 +0000 [thread overview]
Message-ID: <87wmeb16nn.fsf@draig.linaro.org> (raw)
In-Reply-To: <CAM2a4ux=SH+=qemf+kcf=GBJ_-R5Zj4t9hxTCwvqYhwqmDpQ5w@mail.gmail.com> (Gautam Bhat's message of "Thu, 30 Jan 2025 21:04:56 +0530")
Gautam Bhat <mindentropy@gmail.com> writes:
> On Thu, Jan 2, 2025 at 3:45 PM Alex Bennée <alex.bennee@linaro.org> wrote:
> <SNIP>
>> The call into the prologue comes from:
>>
>> ret = tcg_qemu_tb_exec(cpu_env(cpu), tb_ptr);
>>
>> in cpu_tb_exec. With env in RDI and tb_ptr (the code address) being in
>> RSI.
>>
>>
>> --
>> Alex Bennée
>> Virtualisation Tech Lead @ Linaro
>
> Thanks Alex. So this would be regular function calling conventions. I
> thought there would be some inline assembly to the jump to the disas
> rather
> then a call to tcg_qemu_tb_exec(..)
No it is just regular calling conventions - as it is when the generated
code calls out to the helper functions.
As TB's chain execution we just maintain the TCG_AREG0 (cpu_env) and
TCG_REG_CALL_STACK (stack) until the point they exit and come out back
through the epilogue code. I think for *-user we sometimes reserve a
register for guest_base as well.
>
> I verified all of this in the gdb disas of the function.
>
> -Gautam.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
prev parent reply other threads:[~2025-01-31 13:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-01 19:26 How does "rsi" get set in x86 prologue? Gautam Bhat
2025-01-02 10:15 ` Alex Bennée
2025-01-30 15:34 ` Gautam Bhat
2025-01-31 12:58 ` Alex Bennée [this message]
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=87wmeb16nn.fsf@draig.linaro.org \
--to=alex.bennee@linaro.org \
--cc=mindentropy@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.