Hi, Tianhao,
I see there is one page HYPERCALL_MMIO_BASE is mapped in physical
address space. But I see the memory range is not allocated in the
kvm_userspace_memory_region.
So is this by intention?
Thanks,
Yulin
On Sun May 19, 2024 at 11:41 PM CEST, Yulin Sun wrote:
> I see there is one page HYPERCALL_MMIO_BASE is mapped in physical
> address space. But I see the memory range is not allocated in the
> kvm_userspace_memory_region.
>
> So is this by intention?
this is intentional. This page is mapped, but not backed by any host
memory. When this (one page) memory is accessed, it will trigger a
KVM_EXIT with MMIO read or write. You have to map it in guest pagetable
otherwise it would be a pagefault exception instead of a MMIO.
The Hypercall ID is calculated from addr - HYPERCALL_MMIO_BASE.
wth.