From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4kVe-0001ET-Lm for qemu-devel@nongnu.org; Thu, 23 Aug 2012 23:24:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4kVd-0000sT-48 for qemu-devel@nongnu.org; Thu, 23 Aug 2012 23:24:34 -0400 Received: from mail-vc0-f173.google.com ([209.85.220.173]:39215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4kVd-0000sL-0D for qemu-devel@nongnu.org; Thu, 23 Aug 2012 23:24:33 -0400 Received: by vcbgb23 with SMTP id gb23so1600826vcb.4 for ; Thu, 23 Aug 2012 20:24:32 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20120824025721.GA62179@cs.nctu.edu.tw> References: <20120823031446.GB27969@cs.nctu.edu.tw> <20120823101129.GA40283@cs.nctu.edu.tw> <20120824025721.GA62179@cs.nctu.edu.tw> Date: Thu, 23 Aug 2012 20:24:32 -0700 Message-ID: From: Xin Tong Content-Type: text/plain; charset=Big5 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] passing translated address out in QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?6Zmz6Z+L5Lu7IChXZWktUmVuIENoZW4p?= Cc: Peter Maydell , qemu-devel On Thu, Aug 23, 2012 at 7:57 PM, =B3=AF=AD=B3=A5=F4 (Wei-Ren Chen) wrote: >> even that. is it possible to pass host virtual out. the fast path add >> the addend to get host virtual ? so it must be in a register, most >> likely eax in i386. what do you think would be the best way to get >> that out ? > > Take a look on comment on tcg_out_tlb_load (tcg/i386/tcg-target.c). > > First argument register is loaded with the low part of the address. > In the TLB hit case, it has been adjusted as indicated by the TLB > and so is a host address. In the TLB miss case, it continues to > hold a guest address. > > So I guess you can take "tcg_target_call_iarg_regs[0]" as host virtual > address if software tlb hit. > > /* TLB Hit. */ > tcg_out_qemu_ld_direct(s, data_reg, data_reg2, > tcg_target_call_iarg_regs[0], 0, opc); > > As for how do you get host virtual address out, I think you can write > a helper function logging those host virtual address into a file or > something else, then insert a helper function call at the point of > TLB hit. > > HTH, > chenwj > > -- > Wei-Ren Chen (=B3=AF=AD=B3=A5=F4) > Computer Systems Lab, Institute of Information Science, > Academia Sinica, Taiwan (R.O.C.) > Tel:886-2-2788-3799 #1667 > Homepage: http://people.cs.nctu.edu.tw/~chenwj That might be difficult. what i did was that i disabled inlined translated and push the virt/phys address into 2 new fields in the cpu structure in the call out lookup. because in the callout lookup we have a handle to the cpu env. not too sure how much impact inlined lookup has on the performance. since i disabled it, next step i would just get rid of that piece of generated assembly, as it is no good for icache ( generated for every memory operation). Xin