From 341420292d6cd67eb128be6c8b64613b03c8dca2 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Tue, 15 Sep 2026 04:17:12 -0700 Subject: [PATCH] iommufd-ioctls: Extend AttachHwpt with detach_hwpt Extend the existing trait to allow page table to be detached for the associated device. Assisted-by: Claude:Opus-5 Signed-off-by: Sebastien Boeuf --- iommufd-ioctls/CHANGELOG.md | 10 ++++++++++ iommufd-ioctls/Cargo.toml | 2 +- iommufd-ioctls/src/iommufd_ioctls.rs | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/iommufd-ioctls/CHANGELOG.md b/iommufd-ioctls/CHANGELOG.md index d1f8efc..cd2384e 100644 --- a/iommufd-ioctls/CHANGELOG.md +++ b/iommufd-ioctls/CHANGELOG.md @@ -6,6 +6,16 @@ ## Fixed +# [v0.3.1] + +## Changed + +- Extended `AttachHwpt` trait with method `detach_hwpt()` to allow the page table to be detached from the associated device. + +## Added + +## Fixed + # [v0.3.0] ## Changed diff --git a/iommufd-ioctls/Cargo.toml b/iommufd-ioctls/Cargo.toml index 9bc6141..5718043 100644 --- a/iommufd-ioctls/Cargo.toml +++ b/iommufd-ioctls/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iommufd-ioctls" -version = "0.3.0" +version = "0.3.1" authors = ["The Cloud Hypervisor Authors"] license = "Apache-2.0" description = "Safe wrappers over IOMMUFD uAPIs" diff --git a/iommufd-ioctls/src/iommufd_ioctls.rs b/iommufd-ioctls/src/iommufd_ioctls.rs index 4d6a28c..5a1fa02 100644 --- a/iommufd-ioctls/src/iommufd_ioctls.rs +++ b/iommufd-ioctls/src/iommufd_ioctls.rs @@ -601,6 +601,8 @@ pub enum IommufdHwptData { pub trait AttachHwpt: Send + Sync { /// Attach the device to the HW page table. fn attach_hwpt(&self, pt_id: u32) -> std::io::Result<()>; + /// Detach the device from the HW page table. + fn detach_hwpt(&self) -> std::io::Result<()>; } pub struct IommufdVDevice {