From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I1LeO-0000xy-7u for qemu-devel@nongnu.org; Thu, 21 Jun 2007 08:20:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I1LeM-0000x8-Db for qemu-devel@nongnu.org; Thu, 21 Jun 2007 08:20:35 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I1LeL-0000we-Tu for qemu-devel@nongnu.org; Thu, 21 Jun 2007 08:20:33 -0400 Received: from wx-out-0506.google.com ([66.249.82.228]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I1LeL-0006vi-GE for qemu-devel@nongnu.org; Thu, 21 Jun 2007 08:20:33 -0400 Received: by wx-out-0506.google.com with SMTP id t15so492535wxc for ; Thu, 21 Jun 2007 05:20:31 -0700 (PDT) Date: Thu, 21 Jun 2007 20:22:07 +0800 From: amateur Subject: Re: [Qemu-devel] MMU and Physical<->Virtual address conversion Message-ID: <20070621122206.GA7612@163.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: Reply-To: amateur , 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, Jun 21, 2007 at 12:10:38AM -0700, Shane Hummer-Smith wrote: > Hello, >=20 > I am trying to experiment with the memory management unit in QEMU, but I > don't seem to be able to wrap my head around the source code. Can somebody > help me figure out how the physical to virtual address translation and > vice-versa is implemented in QEMU? Any pointer would be appreciated. Than= ks > much! ------------------------- The address translation things in full system mode is handled by the so called SoftMMU, which translate gVA->hEA. gEA->gVA is known as address calculation and handled in insn translation. gVA->gPA is handled by SoftMMU using Guest Page Table, gPA->hEA is handled by SoftMMU using two-level-table of PhyPageDesc structures. There is again TLB which translate gVA->hEA directly. SoftMMU code is mainly in softmmu_header.h, softmmu_template.h, things related to PhyPageDesc... --=20 =1B[32m=E3=80=8A=E4=B8=9C=E9=83=8A=E3=80=8B=1B[m =1B[33m=E4=BD=9C=E8=80=85=EF=BC=9A=E9=9F=A6=E5=BA=94=E7=89=A9=1B[m =E5=90=8F=E8=88=8D=E5=B1=80=E7=BB=88=E5=B9=B4=EF=BC=8C=E5=87=BA=E9=83=8A=E6= =97=B7=E6=B8=85=E6=9B=99=E3=80=82 =E6=9D=A8=E6=9F=B3=E6=95=A3=E5=92=8C=E9=A3=8E=EF=BC=8C=E9=9D=92=E5=B1=B1=E6= =BE=B9=E5=90=BE=E8=99=91=E3=80=82 =E4=BE=9D=E4=B8=9B=E9=80=82=E8=87=AA=E6=86=A9=EF=BC=8C=E7=BC=98=E6=B6=A7=E8= =BF=98=E5=A4=8D=E5=8E=BB=E3=80=82 =E5=BE=AE=E9=9B=A8=E9=9C=AD=E8=8A=B3=E5=8E=9F=EF=BC=8C=E6=98=A5=E9=B8=A0=E9= =B8=A3=E4=BD=95=E5=A4=84=E3=80=82 =E4=B9=90=E5=B9=BD=E5=BF=83=E5=B1=A1=E6=AD=A2=EF=BC=8C=E9=81=B5=E4=BA=8B=E8= =BF=B9=E7=8A=B9=E9=81=BD=E3=80=82 =E7=BB=88=E7=BD=A2=E6=96=AF=E7=BB=93=E5=BA=90=EF=BC=8C=E6=85=95=E9=99=B6=E7= =9C=9F=E5=8F=AF=E5=BA=B6=E3=80=82