From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMjJz-0000ls-43 for qemu-devel@nongnu.org; Wed, 18 May 2011 12:10:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMjJy-0005oP-70 for qemu-devel@nongnu.org; Wed, 18 May 2011 12:10:03 -0400 Received: from mail-yi0-f45.google.com ([209.85.218.45]:52695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMjJy-0005oE-1s for qemu-devel@nongnu.org; Wed, 18 May 2011 12:10:02 -0400 Received: by yib19 with SMTP id 19so682557yib.4 for ; Wed, 18 May 2011 09:10:01 -0700 (PDT) Sender: Richard Henderson Message-ID: <4DD3EF29.8060004@twiddle.net> Date: Wed, 18 May 2011 09:09:13 -0700 From: Richard Henderson MIME-Version: 1.0 References: <20110517184636.GW30615@hall.aurel32.net> In-Reply-To: <20110517184636.GW30615@hall.aurel32.net> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 06/11] TCG/x86: use stack for TCG temps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: Blue Swirl , qemu-devel 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~