From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KILyN-0004H3-H5 for qemu-devel@nongnu.org; Mon, 14 Jul 2008 07:12:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KILyM-0004FL-5t for qemu-devel@nongnu.org; Mon, 14 Jul 2008 07:12:02 -0400 Received: from [199.232.76.173] (port=42543 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KILyK-0004F7-8r for qemu-devel@nongnu.org; Mon, 14 Jul 2008 07:12:00 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:59312) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KILyI-0008Uj-Ku for qemu-devel@nongnu.org; Mon, 14 Jul 2008 07:11:59 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [RFC][PATCH] x86: Optional segment type and limit checks - v2 Date: Mon, 14 Jul 2008 12:11:49 +0100 References: <4874AB47.9090208@siemens.com> <487B2BC8.9050804@siemens.com> <20080714105531.GB2381@shareable.org> In-Reply-To: <20080714105531.GB2381@shareable.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807141211.49825.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 > Some 32-bit guests effectively disable segment range calculations > checks by setting the maximum limit and zero offset. Apparently, this > is faster on some real CPUs too. > > Could type checking be done at translation time, including the segment > types in the translation cache key? Maybe. If we have a spare hflags bit you could probably use that to indicate whether segment limit checks are needed. > For guests like older Linux, with zero base and non-maximum limit in > user mode, could limit checking be done by the MMU TLB instead? Not really. The only resonable way to do this would be to use a very large virtual address space, with the high bits being the segment descriptor. This might work for 32-bit targets on 64-bit hosts, but even then it's liable to be more pain than it's worth. Paul