You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kvm: avoid mmio exits when Sentry faults on unmapped memory
Currently, we generate page tables for the entire sentry address space.
Consequently, when the Sentry faults on unmapped memory - meaning a memory
region not yet mapped into the VM - an MMIO exit is triggered. The issue is
that because the current instruction is emulated (instead of executed
natively), it becomes impossible to trigger a "normal" memory fault.
To solve this, we must set up page tables only for the regions that are
explicitly mapped into the VM. This, however, is more challenging than it
sounds for several reasons:
We map memory regions into the VM from a signal handler, where memory
allocation is prohibited. This means all necessary page table entries must be
allocated during platform initialization.
Our memory regions are not aligned to huge page boundaries. Therefore, when
mapping a memory slot, we often need to split huge pages and allocate new page
table entries.
We run into the nosplit stack limit, requiring us to introduce a PTE.Get method
to safely avoid accessing splice entries via indices, which could
trigger a panic and so requires a lot of extra stack.
PiperOrigin-RevId: 827726897
0 commit comments