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 <[email protected]>
  • Loading branch information
roypat authored and ShadowCurse committed Nov 4, 2024
1 parent dded6ad commit d7cfcad
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
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
1 change: 0 additions & 1 deletion src/kvm_ioctls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ ioctl_io_nr!(KVM_SET_TSS_ADDR, KVMIO, 0x47);
/* Available with KVM_CAP_SET_IDENTITY_MAP_ADDR */
#[cfg(target_arch = "x86_64")]
ioctl_iow_nr!(KVM_SET_IDENTITY_MAP_ADDR, KVMIO, 0x48, u64);
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
ioctl_iowr_nr!(KVM_CREATE_GUEST_MEMFD, KVMIO, 0xd4, kvm_create_guest_memfd);
/* Available with KVM_CAP_IRQCHIP */
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "s390x"))]
Expand Down

0 comments on commit d7cfcad

Please sign in to comment.