Received: from eggs.gnu.org ([140.186.70.92]:42394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8O7O-0001Db-Q6 for qemu-devel@nongnu.org; Mon, 26 Sep 2011 23:14:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8O7N-0001Ac-KS for qemu-devel@nongnu.org; Mon, 26 Sep 2011 23:14:02 -0400 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:41036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8O7N-00019W-1m for qemu-devel@nongnu.org; Mon, 26 Sep 2011 23:14:01 -0400 Date: Tue, 27 Sep 2011 11:13:53 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7?= Message-ID: <20110927031353.GA72316@cs.nctu.edu.tw> References: <20110818063338.GA69924@cs.nctu.edu.tw> <4E501EF2.6050406@landley.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4E501EF2.6050406@landley.net> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] The reason behind block linking constraint? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rob Landley Cc: Max Filippov , qemu-devel@nongnu.org, =?utf-8?B?6Zmz6Z+L5Lu7?= Hi, Rob > >> Is it just because we cannot optimize block linking which crosses p= age > >> boundary, or there are some correctness/safety issues should be cons= idered? > >=20 > > If we link a TB with another TB from the different page, then the > > second TB may disappear when the memory mapping changes and the > > subsequent direct jump from the first TB will crash qemu. > >=20 > > I guess that this usually does not happen in usermode, because the > > guest would not modify executable code memory mapping. However I > > suppose that this is also possible. >=20 > Dynamic linking modifies guest code, requiring the page to be > retranslated. With lazy binding this can happen at any time, and > without PIE executables this can happen to just about any executable pa= ge. Max and I have some discussion about the page boundary constraint of block linking. Maybe it's not worth to track cross-page block linking, for latter possible block unchaining. So there is a page boundary constraint. You said dynamic linking requires the page to be retranslated. Does that imply if there is NO page boundary constraint, user mode might crash? If so, does it occur frequently? Maybe small program just works fine without such constraint, I have to run something big to make QEMU crash? 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