From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HWvCm-0001NI-Pj for qemu-devel@nongnu.org; Thu, 29 Mar 2007 10:02:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HWvCl-0001LH-It for qemu-devel@nongnu.org; Thu, 29 Mar 2007 10:02:20 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HWvCk-0001Kb-0h for qemu-devel@nongnu.org; Thu, 29 Mar 2007 09:02:18 -0500 Received: from mtaout02-winn.ispmail.ntl.com ([81.103.221.48]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HWvA8-0007YQ-TC for qemu-devel@nongnu.org; Thu, 29 Mar 2007 09:59:37 -0400 Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com with ESMTP id <20070329135932.NIAV3103.mtaout02-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Thu, 29 Mar 2007 14:59:32 +0100 Received: from miranda.arrow ([213.107.21.212]) by aamtaout02-winn.ispmail.ntl.com with ESMTP id <20070329135932.NAMM17393.aamtaout02-winn.ispmail.ntl.com@miranda.arrow> for ; Thu, 29 Mar 2007 14:59:32 +0100 Received: from sdb by miranda.arrow with local (Exim 4.50) id 1HWvA2-0001gM-Cv for qemu-devel@nongnu.org; Thu, 29 Mar 2007 14:59:30 +0100 Date: Thu, 29 Mar 2007 14:59:30 +0100 From: Stuart Brady Subject: Re: [Qemu-devel] Qemu memory management Message-ID: <20070329135930.GA6398@miranda.arrow> References: <000001c771e8$cff5c3d0$14b2a8c0@michael5ee790a> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000001c771e8$cff5c3d0$14b2a8c0@michael5ee790a> 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 On Thu, Mar 29, 2007 at 11:58:33AM +0200, Michael Neubauer wrote: > "To avoid flushing the translated code each time the MMU mappings change, > QEMU uses a physically indexed translation cache. It means that each TB is > indexed with its physical address." > > Why does a cache like that prevent the translated code from being flushed? > If a translated code is relocated in physical memory (e. g. after a paging > swap operation) that would render the cache useless in my opinion. My impression is that "each time the MMU mappings change" basically means "when there's a context switch" and not "when swapping occurs". If code is swapped out, then yes, it would have to be translated again. If you wanted to avoid that, you'd need a virtually indexed cache, and I believe that would require co-operation from the OS, as it would be very difficult for QEMU to keep track of processes/threads and paging itself. You'd also have to deal with cache aliases to avoid translating code for each process or thread that uses it. -- Stuart Brady