[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get host virtual address from guest physical address?
From: |
Peter Maydell |
Subject: |
Re: How to get host virtual address from guest physical address? |
Date: |
Fri, 28 May 2021 15:36:55 +0100 |
On Fri, 28 May 2021 at 03:50, <ckim@etri.re.kr> wrote:
> In my baremetal test on aarch64, I pass the guest physical address of an
> array of a structure to the qemu peripheral code using peripherals register.
>
> I soon realized the adderss is from another world and to access this address
> in qemu, I need the host virtual address.
>
> I tried reading the document (and will read more) but it shows the load and
> store APIs, and not the address translation API.
>
> I need that address because I have to pass the “address” to a function in a
> dynamic library ( a .so file). I don’t myself load or store using that
> address.
>
> What is the function for this “guest physical address to host virtual
> address” translation?
There is address_space_map(), but watch out for the
caveats documented in its doc comment in memory.h.
thanks
-- PMM