From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3tbh-0000Yg-An for qemu-devel@nongnu.org; Tue, 01 Dec 2015 17:41:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3tbf-0001BR-6N for qemu-devel@nongnu.org; Tue, 01 Dec 2015 17:41:09 -0500 Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]:33447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3tbf-0001BF-1v for qemu-devel@nongnu.org; Tue, 01 Dec 2015 17:41:07 -0500 Received: by qkas77 with SMTP id s77so9426557qka.0 for ; Tue, 01 Dec 2015 14:41:06 -0800 (PST) Sender: Richard Henderson From: Richard Henderson Date: Tue, 1 Dec 2015 14:40:33 -0800 Message-Id: <1449009633-17053-2-git-send-email-rth@twiddle.net> In-Reply-To: <1449009633-17053-1-git-send-email-rth@twiddle.net> References: <1449009633-17053-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PULL] tcg: Increase the highwater reservation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org If there are a lot of guest memory ops in the TB, the amount of code generated by tcg_out_tb_finalize could be well more than 1k. In the short term, increase the reservation larger than any TB seen in practice. Reported-by: Aurelien Jarno Reviewed-by: Aurelien Jarno Tested-by: Aurelien Jarno Signed-off-by: Richard Henderson --- tcg/tcg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index b20ed19..a163541 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -388,7 +388,11 @@ void tcg_prologue_init(TCGContext *s) /* Compute a high-water mark, at which we voluntarily flush the buffer and start over. The size here is arbitrary, significantly larger than we expect the code generation for any one opcode to require. */ - s->code_gen_highwater = s->code_gen_buffer + (total_size - 1024); + /* ??? We currently have no good estimate for, or checks in, + tcg_out_tb_finalize. If there are quite a lot of guest memory ops, + the number of out-of-line fragments could be quite high. In the + short-term, increase the highwater buffer. */ + s->code_gen_highwater = s->code_gen_buffer + (total_size - 64*1024); tcg_register_jit(s->code_gen_buffer, total_size); -- 2.5.0