-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
The function vfio_dma_map
takes a u64
and passes it to a kernel function that treats it as a pointer and accesses the virtual address space it points to. Such a function must be unsafe
, but this function currently is safe.
I'm not sure how to provide an unopinionated safe wrapper for this API. An opinionated option would be to have a type that allocates the memory with mmap
, exposes an API to call vfio_dma_map
initialization, and (if the memory had been mapped) calls vfio_dma_unmap
in its Drop::drop
. I'm not sure if this is sufficient for Cloud Hypervisor, though.
Metadata
Metadata
Assignees
Labels
No labels