Received: from eggs.gnu.org ([140.186.70.92]:59965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5b4h-0002RJ-07 for qemu-devel@nongnu.org; Mon, 19 Sep 2011 06:27:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5b4b-0005rk-C1 for qemu-devel@nongnu.org; Mon, 19 Sep 2011 06:27:42 -0400 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:48708) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5b4a-0005gC-Mc for qemu-devel@nongnu.org; Mon, 19 Sep 2011 06:27:37 -0400 Received: from csmailer.cs.nctu.edu.tw (localhost [127.0.0.1]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id B73C9273 for ; Mon, 19 Sep 2011 18:26:24 +0800 (CST) Received: from alumni.cs.nctu.edu.tw (alumni.cs.nctu.edu.tw [140.113.235.116]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id AD646272 for ; Mon, 19 Sep 2011 18:26:24 +0800 (CST) Received: (from chenwj@localhost) by alumni.cs.nctu.edu.tw (8.14.4/8.14.4/Submit) id p8JARQa2029291 for qemu-devel@nongnu.org; Mon, 19 Sep 2011 18:27:26 +0800 (CST) (envelope-from chenwj) Date: Mon, 19 Sep 2011 18:27:26 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7?= Message-ID: <20110919102726.GA28379@cs.nctu.edu.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Question on block chaining List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, all I am tracing how block linking is done in QEMU. I find there is a comment in struct TranslationBlock says, /* 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 =3D jmp_next[0], 1 =3D jmp_next[1], 2 =3D jmp_first */ struct TranslationBlock *jmp_next[2]; struct TranslationBlock *jmp_first; But after tracing the code, I think the comment might be wrong. For example, if we want to link tb1 to tb2, i.e., tb1 -> tb2. Then roughly speaking, tb1->jmp_next[n] should be tb2, and tb2->jmp_first should be tb1. So the comment "list of TBs jumping to this one" looks weird to me. Do I misunderstand how the block chaining is done? Thanks! Regards, chenwj --=20 Wei-Ren Chen (=E9=99=B3=E9=9F=8B=E4=BB=BB) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667