On Wed, 14 Jul 2021 at 13:12, <c...@etri.re.kr> 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 
> register.

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.

thanks
-- PMM

Reply via email to