Re: [Qemu-devel] passing translated address out in QEMU

2012-08-24 Thread Wei-Ren Chen
> >> 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). > > > > You can run a benchmark inside your guest.

Re: [Qemu-devel] passing translated address out in QEMU

2012-08-23 Thread Xin Tong
On Thu, Aug 23, 2012 at 9:06 PM, 陳韋任 (Wei-Ren Chen) wrote: >> 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

Re: [Qemu-devel] passing translated address out in QEMU

2012-08-23 Thread Wei-Ren Chen
> 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. What you mean by "disabled inlined translated"? You mean

Re: [Qemu-devel] passing translated address out in QEMU

2012-08-23 Thread Xin Tong
On Thu, Aug 23, 2012 at 7:57 PM, 陳韋任 (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

Re: [Qemu-devel] passing translated address out in QEMU

2012-08-23 Thread Wei-Ren Chen
> 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). F

Re: [Qemu-devel] passing translated address out in QEMU

2012-08-23 Thread Steven
Hi, Xin, Try Max's patch http://lists.gnu.org/archive/html/qemu-devel/2012-08/msg03226.html I used it to get all the guest virtual address because this patch disable the fast mmu path. Steven On Thu, Aug 23, 2012 at 12:18 PM, Xin Tong wrote: > On Thu, Aug 23, 2012 at 8:52 AM, Peter Maydell >

Re: [Qemu-devel] passing translated address out in QEMU

2012-08-23 Thread Xin Tong
On Thu, Aug 23, 2012 at 8:52 AM, Peter Maydell wrote: > On 23 August 2012 16:34, Xin Tong wrote: >> I am emulating arm on x86. i want to track the virt and physical >> address of last memory operation. so i put 2 fields in the CPUState >> and make tcg_global_mem_new_i32 on them Therefore, before

Re: [Qemu-devel] passing translated address out in QEMU

2012-08-23 Thread Peter Maydell
On 23 August 2012 16:34, Xin Tong wrote: > I am emulating arm on x86. i want to track the virt and physical > address of last memory operation. so i put 2 fields in the CPUState > and make tcg_global_mem_new_i32 on them Therefore, before every > translation i generate code to save the virtual addr

Re: [Qemu-devel] passing translated address out in QEMU

2012-08-23 Thread Xin Tong
I am emulating arm on x86. i want to track the virt and physical address of last memory operation. so i put 2 fields in the CPUState and make tcg_global_mem_new_i32 on them Therefore, before every translation i generate code to save the virtual address as follow: static inline void gen_st32(TCGv v

Re: [Qemu-devel] passing translated address out in QEMU

2012-08-23 Thread Wei-Ren Chen
> subtracting host virtual with a fixed offset for ram. but the thing i > do not know how to do is how to pass the guest physical back, can i > store the guest physical in the TCGv from the guest virtual. Maybe you can store it on a host unused register, perhaps xmm0? ;) Regards, chenwj -- We

Re: [Qemu-devel] passing translated address out in QEMU

2012-08-23 Thread Wei-Ren Chen
On Wed, Aug 22, 2012 at 09:38:17PM -0700, Xin Tong wrote: > On Wed, Aug 22, 2012 at 8:14 PM, 陳韋任 (Wei-Ren Chen) > wrote: > >> In tcg_gen_qemu_ld8s(tmp, addr, index); a TCGv addr is passed to the > >> INDEX_op_qemu_ld8s as param and the loaded value is passed back in > >> tmp. i want to get the tra

Re: [Qemu-devel] passing translated address out in QEMU

2012-08-22 Thread Xin Tong
On Wed, Aug 22, 2012 at 8:14 PM, 陳韋任 (Wei-Ren Chen) wrote: >> In tcg_gen_qemu_ld8s(tmp, addr, index); a TCGv addr is passed to the >> INDEX_op_qemu_ld8s as param and the loaded value is passed back in >> tmp. i want to get the translated value as well. how can i do that ? > > IIUC, qemu_ld take

Re: [Qemu-devel] passing translated address out in QEMU

2012-08-22 Thread Wei-Ren Chen
> In tcg_gen_qemu_ld8s(tmp, addr, index); a TCGv addr is passed to the > INDEX_op_qemu_ld8s as param and the loaded value is passed back in > tmp. i want to get the translated value as well. how can i do that ? IIUC, qemu_ld takes addr as guest virtual address, then loads the value in that addr

[Qemu-devel] passing translated address out in QEMU

2012-08-22 Thread Xin Tong
Hello In tcg_gen_qemu_ld8s(tmp, addr, index); a TCGv addr is passed to the INDEX_op_qemu_ld8s as param and the loaded value is passed back in tmp. i want to get the translated value as well. how can i do that ? one way i can think of right now is to modify the INDEX_op_qemu_ld8s and make it take