From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcGy3-0000yP-FD for qemu-devel@nongnu.org; Tue, 14 May 2013 11:16:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcGxz-0007yR-9P for qemu-devel@nongnu.org; Tue, 14 May 2013 11:16:43 -0400 Received: from mail-gh0-f173.google.com ([209.85.160.173]:47384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcGxz-0007yM-3e for qemu-devel@nongnu.org; Tue, 14 May 2013 11:16:39 -0400 Received: by mail-gh0-f173.google.com with SMTP id g16so110161ghb.4 for ; Tue, 14 May 2013 08:16:38 -0700 (PDT) Sender: Richard Henderson Message-ID: <51925552.9040601@twiddle.net> Date: Tue, 14 May 2013 08:16:34 -0700 From: Richard Henderson MIME-Version: 1.0 References: <5141F36E.10004@huawei.com> <5187A863.7080903@huawei.com> <5187AFC0.3090201@redhat.com> <5190E923.1030200@huawei.com> <5190EBC5.9080901@huawei.com> <519143B8.1030109@twiddle.net> <519244B7.4090207@huawei.com> In-Reply-To: <519244B7.4090207@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] tcg/aarch64: implement new TCG target for aarch64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Claudio Fontana Cc: Paolo Bonzini , qemu-devel@nongnu.org, Peter Maydell On 05/14/2013 07:05 AM, Claudio Fontana wrote: >> Conditional branch range is +-1MB. You'll never see a TB that large. You >> don't need to emit a branch-across-branch. > > Is there maybe a way to do it right even in the corner case where we have > a huge list of hundreds of thousands of instructions without jumps and then a conditional jump? > Are we _guaranteed_ to never see that large a TB with some kind of define, > similarly to MAX_CODE_GEN_BUFFER_SIZE? There are three mechanisms that all limit TB size: (1) OPC_MAX_SIZE, limiting the number of opcodes emitted, (2) CF_COUNT_MASK, limiting the number of instructions translated, (3) Instruction pointer crossing a page boundary, where we end a TB and re-verify the page protection bits of the new page. Nr 1 is probably the most significant, since it most directly relates to the number of output instructions, and thus the resulting TB size. r~