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
test(uffd_utils): add handling for FaultRequest in secret freedom
There are two ways a UFFD handler receives a fault notification if
Secret Fredom is enabled (which is inferred from 3 fds sent by
Firecracker instead of 1):
- a VMM- or KVM-triggered fault is delivered via a minor UFFD fault
event. The handler is supposed to respond to it via memcpying the
content of the page (if the page hasn't already been populated)
followed by UFFDIO_CONTINUE call.
- a vCPU-triggered fault is delievered via a FaultRequest message on
the UDS socket. The handler is supposed to reply with a pwrite64
call on the guest_memfd to populate the page followed by a FaultReply
message on the UDS socket.
In both cases, the handler also needs to clear the bit in the userfault
bitmap at the corresponding offset in order to stop fault notifications
for the same page.
UFFD handlers use the userfault bitmap for two purposes:
- communicate to the kernel whether a fault at the corresponding
guest_memfd offset will cause a VM exit
- keep track of pages that have already been populated in order to
avoid overwriting the content of the page that is already
initialised.
Signed-off-by: Nikita Kalyazin <[email protected]>
0 commit comments