diff --git a/kvm-ioctls/CHANGELOG.md b/kvm-ioctls/CHANGELOG.md index e0fd7430..42956c48 100644 --- a/kvm-ioctls/CHANGELOG.md +++ b/kvm-ioctls/CHANGELOG.md @@ -2,6 +2,15 @@ ## Upcoming Release +### Changed + +- [[#382]](https://github.com/rust-vmm/kvm/pull/382) `VmFd::enable_cap` and the + `KVM_ENABLE_CAP` ioctl definition are now available on all architectures + instead of only x86_64, s390x and powerpc. aarch64 needs them to enable + `KVM_CAP_ARM_WRITABLE_IMP_ID_REGS` (Linux 6.15), without which writes to the + implementation ID registers (for example `MIDR_EL1` through a VMM CPU + template) fail with EINVAL. + ## v0.25.0 ### Added diff --git a/kvm-ioctls/src/ioctls/vm.rs b/kvm-ioctls/src/ioctls/vm.rs index 466dd8ff..3e5f7b99 100644 --- a/kvm-ioctls/src/ioctls/vm.rs +++ b/kvm-ioctls/src/ioctls/vm.rs @@ -1521,9 +1521,9 @@ impl VmFd { /// // Because an IOAPIC supports 24 pins, that's the reason why this test /// // picked this number as reference. /// cap.args[0] = 24; + /// #[cfg(target_arch = "x86_64")] /// vm.enable_cap(&cap).unwrap(); /// ``` - #[cfg(any(target_arch = "x86_64", target_arch = "s390x", target_arch = "powerpc"))] pub fn enable_cap(&self, cap: &kvm_enable_cap) -> Result<()> { // SAFETY: The ioctl is safe because we allocated the struct and we know the // kernel will write exactly the size of the struct. diff --git a/kvm-ioctls/src/kvm_ioctls.rs b/kvm-ioctls/src/kvm_ioctls.rs index b294c57e..af802307 100644 --- a/kvm-ioctls/src/kvm_ioctls.rs +++ b/kvm-ioctls/src/kvm_ioctls.rs @@ -226,7 +226,6 @@ ioctl_io_nr!(KVM_SET_TSC_KHZ, KVMIO, 0xa2); ioctl_io_nr!(KVM_GET_TSC_KHZ, KVMIO, 0xa3); /* Available with KVM_CAP_ENABLE_CAP */ -#[cfg(not(any(target_arch = "aarch64", target_arch = "riscv64")))] ioctl_iow_nr!(KVM_ENABLE_CAP, KVMIO, 0xa3, kvm_enable_cap); /* Available with KVM_CAP_SIGNAL_MSI */ #[cfg(any(