From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6YEu-0006UT-TL for qemu-devel@nongnu.org; Wed, 21 Sep 2011 21:38:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6YEt-0004r4-MY for qemu-devel@nongnu.org; Wed, 21 Sep 2011 21:38:12 -0400 Received: from e28smtp05.in.ibm.com ([122.248.162.5]:48944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6YEt-0004qX-1I for qemu-devel@nongnu.org; Wed, 21 Sep 2011 21:38:11 -0400 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by e28smtp05.in.ibm.com (8.14.4/8.13.1) with ESMTP id p8M1c7U1018587 for ; Thu, 22 Sep 2011 07:08:07 +0530 Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8M1c6Iq1417402 for ; Thu, 22 Sep 2011 07:08:07 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8M1c6qk013823 for ; Thu, 22 Sep 2011 11:38:06 +1000 Message-ID: <4E7A9153.9030905@linux.vnet.ibm.com> Date: Thu, 22 Sep 2011 09:37:23 +0800 From: Lei Li MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] TB chaining List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xin Tong Cc: qemu-devel On 09/22/2011 07:05 AM, Xin Tong wrote: > I am new to QEMU, can anyone please tell me where the TB chaining code is in QEMU ? Actually, TB chaining was implemented via TB list. You might want to look at Exec.c In struct TranslationBlock, the following data are used to directly call another TB from the code of this one. uint16_t tb_next_offset[2]; /* offset of original jump target */ #ifdef USE_DIRECT_JUMP uint16_t tb_jmp_offset[2]; /* offset of jump instruction */ #else unsigned long tb_next[2]; /* address of jump generated code */ #endif /* list of TBs jumping to this one. This is a circular list using the two least significant bits of the pointers to tell what is the next pointer: 0 = jmp_next[0], 1 = jmp_next[1], 2 = jmp_first */ struct TranslationBlock *jmp_next[2]; struct TranslationBlock *jmp_first; are used to directly call another TB from the code of this one > Thanks > Xin -- Lei