[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there a good method to convert guest machine's user virtual addre
Re: Is there a good method to convert guest machine's user virtual address to qemu host's virtual address?
Wed, 14 Jul 2021 14:10:19 +0100
On Wed, 14 Jul 2021 at 13:12, <firstname.lastname@example.org> wrote:
> On second thought, I guess the application should convert the virtual address
> to physical address (by reading the page table) and write the value to the
Yes. Generally models that emulate real devices will always operate
on physical addresses, because in hardware they are separate from
the CPU and don't have access to the virtual-to-physical translation
that the CPU does. It is possible to design purely virtual hardware
that wants to take a virtual address, but this is a bad idea:
a buffer that's a contiguous lump of virtual memory could be
non-contiguous in physical memory if it spans multiple pages; and
QEMU's APIs are not designed to make it easy to do virtual-to-physical
lookups from a device model.