From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CRtOO-0001vg-Hk for qemu-devel@nongnu.org; Wed, 10 Nov 2004 09:24:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CRtON-0001uo-2p for qemu-devel@nongnu.org; Wed, 10 Nov 2004 09:24:11 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CRtOM-0001ul-UG for qemu-devel@nongnu.org; Wed, 10 Nov 2004 09:24:11 -0500 Received: from [193.49.184.8] (helo=mailx.u-picardie.fr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CRtFn-00009g-RF for qemu-devel@nongnu.org; Wed, 10 Nov 2004 09:15:20 -0500 Message-ID: <1100096107.4192226b7613f@webmail.u-picardie.fr> Date: Wed, 10 Nov 2004 15:15:07 +0100 From: olivier cozette Subject: Re:Another related question Re: [Qemu-devel] Question about softmmu MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 Hello Ye, >So EIP is just the offset of current instruction. Yes >When address mapping changes, >the CS segment register also changes. No. The virtual adress is CS+EIP (CS.Base+EIP), this virtual address is trans= lated to the physical address with the page mapping. In pseudo code, the real a= ddress is PAGE_MAPPING(CS+EIP). So, if the page mapping change the CS stay the s= ame. >That's why QEMU does not need to flush >the code. Am I right? >The reason I'm thinking about this is because I'm implementing QEMU's >translation method in my ARM simulator which needs to simulate the whole= system >running Linux. In ARM, since PC is just r15, you can access it as a norm= al >register and it is the absolute virtual address. So I wonder if I have t= o flush >code cache every time page table changes. I don't know well ARM processor, but i know Alpha, and it's different fro= m the x86. With x86, the data stored in the data/code cache are stored with the phys= ical address (page mapping is done between processor and cache), and so the ca= che don't need to be flushed when page mapping change (CR3 change). With alpha (and probably arm), the address stored in cache are the virtua= l address (page mapping is done between cache and memory). But, i presume this difference have no impact with Qemu cache, and it wil= l be better to don't flush qemu cache. Olivier Thanks, Ye