qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How does "rsi" get set in x86 prologue?


From: Alex Bennée
Subject: Re: How does "rsi" get set in x86 prologue?
Date: Fri, 31 Jan 2025 12:58:52 +0000
User-agent: mu4e 1.12.8; emacs 29.4

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]