Skip to content

Commit a95f794

Browse files
committed
fix: drop cfg(target_arch) from create_guest_memfd
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>
1 parent 551911a commit a95f794

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

src/ioctls/vm.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,6 @@ impl VmFd {
14741474
///
14751475
/// let guest_memfd = vm.create_guest_memfd(gmem).unwrap();
14761476
/// ```
1477-
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
14781477
pub fn create_guest_memfd(&self, gmem: kvm_create_guest_memfd) -> Result<RawFd> {
14791478
// SAFETY: Safe because we know that our file is a VM fd, we know the kernel will only
14801479
// read the correct amount of memory from our pointer, and we verify the return result.

src/kvm_ioctls.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ ioctl_io_nr!(KVM_SET_TSS_ADDR, KVMIO, 0x47);
5050
/* Available with KVM_CAP_SET_IDENTITY_MAP_ADDR */
5151
#[cfg(target_arch = "x86_64")]
5252
ioctl_iow_nr!(KVM_SET_IDENTITY_MAP_ADDR, KVMIO, 0x48, u64);
53-
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
5453
ioctl_iowr_nr!(KVM_CREATE_GUEST_MEMFD, KVMIO, 0xd4, kvm_create_guest_memfd);
5554
/* Available with KVM_CAP_IRQCHIP */
5655
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64", target_arch = "s390x"))]

0 commit comments

Comments
 (0)