qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] How does cpu_ldx_data translate virtual->physical?
@ 2013-11-16 10:12 Martin T
  2013-11-17 22:08 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Martin T @ 2013-11-16 10:12 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 975 bytes --]

Hello

I'm new to the list and I'm looking to do some qemu hacking... so I'm
reading through the sources. I've noticed that when e.g. helper functions
for instructions need to read from the memory of the guest address space
(for instance, based on an address passed in an operand) they use macros of
the form cpu_ldx_data (for instance cpu_ldq_data to read a qword). So I was
looking to use this as a starting point for understanding address
translation in qmu. However, I'm a bit confused because the macro seems to
be defined just by:

#define cpu_ldq_data(env, addr) ldq_raw(addr)

I.e. throwing the env argument away - and ldq_raw() seems to just read
straight from this address in qemu's own address space (not even the
'emulated' address space).

So I'm thinking there must be some other place where cpu_ldq_data() gets
defined which does something else, however, I haven't been able to find it
searching through the sources.

Can anyone help on this? Thanks!

- Morty

[-- Attachment #2: Type: text/html, Size: 3093 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] How does cpu_ldx_data translate virtual->physical?
  2013-11-16 10:12 [Qemu-devel] How does cpu_ldx_data translate virtual->physical? Martin T
@ 2013-11-17 22:08 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2013-11-17 22:08 UTC (permalink / raw)
  To: Martin T, qemu-devel

On 11/16/2013 08:12 PM, Martin T wrote:
> So I'm thinking there must be some other place where cpu_ldq_data() gets
> defined which does something else, however, I haven't been able to find it
> searching through the sources.

It's constructed via macro glue.  See include/exec/softmmu_exec.h.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-17 22:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-16 10:12 [Qemu-devel] How does cpu_ldx_data translate virtual->physical? Martin T
2013-11-17 22:08 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).