From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ylbkb-000446-OE for qemu-devel@nongnu.org; Fri, 24 Apr 2015 07:26:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlbkZ-0003Ww-2R for qemu-devel@nongnu.org; Fri, 24 Apr 2015 07:26:29 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:38090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlbkY-0003Wp-RN for qemu-devel@nongnu.org; Fri, 24 Apr 2015 07:26:27 -0400 Received: by wiun10 with SMTP id n10so16593993wiu.1 for ; Fri, 24 Apr 2015 04:26:26 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <553A285E.9050406@redhat.com> Date: Fri, 24 Apr 2015 13:26:22 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] About address mapping between host and guest in QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenjie Liu , Peter Maydell Cc: Stefan Hajnoczi , QEMU Developers , =?UTF-8?B?TGx1w61zIFZpbGFub3Zh?= On 24/04/2015 04:10, Wenjie Liu wrote: > The thing I am trying to achieve is to get the data and guest physical > address of every guest memory access, so I need to known which API can > be used to do the address transform. The short answer is that is difficult, because most guest memory accesses do not call any C function. QEMU has a virtual TLB; if you have a TLB hit, the code generated by the JIT compiler does the conversion. A C function is called only if you have a TLB miss, or if the guest is accessing a device. These C functions are defined in softmmu_template.h. The header is included multiple from cputlb.c. Paolo