From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8XhO-0000F2-N4 for qemu-devel@nongnu.org; Tue, 27 Sep 2011 09:27:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8XhK-0006c8-Fs for qemu-devel@nongnu.org; Tue, 27 Sep 2011 09:27:50 -0400 Received: from mail-iy0-f173.google.com ([209.85.210.173]:63177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8XhK-0006bH-CV for qemu-devel@nongnu.org; Tue, 27 Sep 2011 09:27:46 -0400 Received: by iagf6 with SMTP id f6so6790462iag.4 for ; Tue, 27 Sep 2011 06:27:44 -0700 (PDT) Message-ID: <4E81CF4B.9040207@landley.net> Date: Tue, 27 Sep 2011 08:27:39 -0500 From: Rob Landley MIME-Version: 1.0 References: <20110818063338.GA69924@cs.nctu.edu.tw> <4E501EF2.6050406@landley.net> <20110927031353.GA72316@cs.nctu.edu.tw> In-Reply-To: <20110927031353.GA72316@cs.nctu.edu.tw> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] The reason behind block linking constraint? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?6Zmz6Z+L5Lu7?= Cc: Max Filippov , qemu-devel@nongnu.org On 09/26/2011 10:13 PM, 陳韋任 wrote: > Hi, Rob > >>>> Is it just because we cannot optimize block linking which crosses page >>>> boundary, or there are some correctness/safety issues should be considered? >>> >>> 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. >>> >>> 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. >> >> 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 page. > > 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? The constraints you're talking about are on the translated code, dynamic linking happens on the target code. Changes to the target code require regenerating the translated code, which happens with page granularity. Rob