From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z02gE-0007AC-Mq for qemu-devel@nongnu.org; Wed, 03 Jun 2015 03:01:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z02g9-0000jN-OK for qemu-devel@nongnu.org; Wed, 03 Jun 2015 03:01:38 -0400 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:33850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z02g9-0000iJ-Hg for qemu-devel@nongnu.org; Wed, 03 Jun 2015 03:01:33 -0400 Received: by wibut5 with SMTP id ut5so91765197wib.1 for ; Wed, 03 Jun 2015 00:01:32 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <556EA649.3010805@redhat.com> Date: Wed, 03 Jun 2015 09:01:29 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] On x86 MMU modes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sandhya Kumar , qemu-devel@nongnu.org On 03/06/2015 08:51, Sandhya Kumar wrote: > As per my understanding (which matches versions prior to this commit), > we generally maintain only two TLBs [one for kernel and one for user] in > x86 ISA for caching address translations. With this commit we seem to > have three modes of MMU, although only two will be actually used (either > KSMAP or KNOSMAP). This is not accurate. If AC=0, data accesses from the kernel use KNOSMAP, but implicit accesses (e.g. reads of the IDT) use KSMAP. > Is my claim valid ? Why cannot those two original > modes serve the purpose and why is the separation (of KNOMAP and KSMAP) > needed? Because the QEMU TLB just has a single bit for "is this page readable". In supervisor mode and with SMAP enabled, this changes depending on the value of the AC bit. Without separate TLBs for KNOSMAP/KSMAP, you would have to flush the TLB on every CLAC or STAC instruction. Paolo