Skip to content

Commit

Permalink
fix: drop cfg(target_arch) from create_guest_memfd
Browse files Browse the repository at this point in the history
The KVM docs do not list this ioctls as restricted to any specific
architecture. It is instead discoverable via capabilities, and can
theoretically work on any architecture (provided the architecture has a
VM type that support guest private memory).

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
  • Loading branch information
roypat committed Oct 31, 2024
1 parent 551911a commit 70f0da6
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/ioctls/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,6 @@ impl VmFd {
///
/// let guest_memfd = vm.create_guest_memfd(gmem).unwrap();
/// ```
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
pub fn create_guest_memfd(&self, gmem: kvm_create_guest_memfd) -> Result<RawFd> {
// SAFETY: Safe because we know that our file is a VM fd, we know the kernel will only
// read the correct amount of memory from our pointer, and we verify the return result.
Expand Down

0 comments on commit 70f0da6

Please sign in to comment.