[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 06/11] TCG/x86: use stack for TCG temps
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 06/11] TCG/x86: use stack for TCG temps |
Date: |
Wed, 18 May 2011 09:09:13 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10 |
On 05/17/2011 11:46 AM, Aurelien Jarno wrote:
>> - tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf),
>> - CPU_TEMP_BUF_NLONGS * sizeof(long));
>> }
>
> Note that this patch is likely to break calls to helpers which need
> parameters on the stack, by judging at the current code (I haven't
> tested it in practice):
>
> | if (allocate_args) {
> | tcg_out_addi(s, TCG_REG_CALL_STACK, -STACK_DIR(call_stack_size));
> | }
>
> The stack register (esp) is decreased.
I don't think this ever happens in practice, given that we've already
allocated TCG_STATIC_CALL_ARGS_SIZE worth of stack for calls. For
i386, that's 32 int-sized arguments, well more than any helper needs.
This code in tcg.c is way too simplistic to actually work on targets
with non-trivial stack allocation policies, e.g. ppc64. The fact
that the target works at present is testament to the fact that this
code doesn't actually trigger. I would be just as happy to remove
this dynamic stack allocation code and replace it with an assert.
r~