From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJXY9-0001da-7V for qemu-devel@nongnu.org; Thu, 17 Jul 2008 13:45:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJXY7-0001cu-9y for qemu-devel@nongnu.org; Thu, 17 Jul 2008 13:45:52 -0400 Received: from [199.232.76.173] (port=37865 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJXY7-0001co-2d for qemu-devel@nongnu.org; Thu, 17 Jul 2008 13:45:51 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:49247) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KJXY5-0006yX-Jk for qemu-devel@nongnu.org; Thu, 17 Jul 2008 13:45:50 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [RFC][PATCH] x86: CS limit checks Date: Thu, 17 Jul 2008 18:45:44 +0100 References: <487F3393.3040609@siemens.com> <200807171437.13717.paul@codesourcery.com> <487F6F0F.4010507@siemens.com> In-Reply-To: <487F6F0F.4010507@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807171845.45005.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jan Kiszka > To me it looks like as if the generator can so far raise a PF > prematurely when it steps on an invalid code address while building a > new TB. This probably has to fix the same way as the limit check is > realized: by injecting an exception (PF or GP) into the generated code > at the correct PC. Hmm, the PF-during-translation issue is probably not > just limited to x86... Alpha, PPC, SPARC, SH and ARM avoid the problem by having fixed length word aligned instructions. Thumb-1 has special handling for the cross-boundary case (Instructions aren't really variable length, we just treat them that way as an optimisation). Thumb-2, m68k, cris and x86 all look like they may incorrectly fetch code from the next page. Paul