Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-25 Thread Peter Maydell
On 25 April 2015 at 02:51, Wenjie Liu wrote: > Hi Peter, > Does the equation which is mentioned in > http://vm-kernel.org/blog/2009/07/10/qemu-internal-part-2-softmmu/ means > something? > host_virtual_address = phys_ram_base(qemu variable) + guest_physical_address > – guest_physical_address_base(

Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-24 Thread Wenjie Liu
Hi Peter, Does the equation which is mentioned in http://vm-kernel.org/blog/2009/07/10/qemu-internal-part-2-softmmu/ means something? host_virtual_address = phys_ram_base(qemu variable) + guest_physical_address – guest_physical_address_base(0 in MIPS) Currently I have the guest physical address and

Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-24 Thread Christopher Covington
Hi Brendan, On 04/24/2015 03:50 PM, Brendan Dolan-Gavitt wrote: > One possible option that has come up in the past is disabling the TLB > for your testing. It is slower, though, and would only work on TCG, > not KVM. > > The way I'm currently doing this is by changing the conditional jump > here

Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-24 Thread Brendan Dolan-Gavitt
One possible option that has come up in the past is disabling the TLB for your testing. It is slower, though, and would only work on TCG, not KVM. The way I'm currently doing this is by changing the conditional jump here to an absolute one inside of the TCG code generator for i386 (and of course y

Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-24 Thread Christopher Covington
On 04/24/2015 08:46 AM, Peter Maydell wrote: > On 24 April 2015 at 12:26, Paolo Bonzini wrote: >> 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

Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-24 Thread Peter Maydell
On 24 April 2015 at 12:26, Paolo Bonzini wrote: > 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

Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-24 Thread Paolo Bonzini
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 accesse

Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-23 Thread Wenjie Liu
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. Thanks a lot. 2015-04-23 22:03 GMT+08:00 Peter Maydell : > On 23 April 2015 at 14:56, Wenjie Liu wrote: > > Can anyb

Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-23 Thread Peter Maydell
On 23 April 2015 at 14:56, Wenjie Liu wrote: > Can anybody take a few minutes to answer my question? It might help if you explained at a higher level what you're trying to achieve. Usually you don't need to manually try to do this conversion from guest to host address because there is an API whic

Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-23 Thread Wenjie Liu
Can anybody take a few minutes to answer my question? 2015-04-22 23:26 GMT+08:00 Wenjie Liu : > In http://vm-kernel.org/blog/2009/07/10/qemu-internal-part-2-softmmu/, > the following equation is mentioned. > host_virtual_address = phys_ram_base(qemu variable) + > guest_physical_address – guest_ph

Re: [Qemu-devel] About address mapping between host and guest in QEMU

2015-04-22 Thread Wenjie Liu
In http://vm-kernel.org/blog/2009/07/10/qemu-internal-part-2-softmmu/, the following equation is mentioned. host_virtual_address = phys_ram_base(qemu variable) + guest_physical_address – guest_physical_address_base(0 in MIPS) I think I have got the phys_ram_base and guest_physical_address, but can

[Qemu-devel] About address mapping between host and guest in QEMU

2015-04-22 Thread Wenjie Liu
Hi all, I have a little problem about the address mapping between host and guest in QEMU. I have got the guest physical address and the host virtual base address of guest's memory space which by check the ramblocks list. So, can I access to the guest's memory content by simply add the guest physi