Skip to content

Commit 3d000de

Browse files
committed
kvm-ioctls: foundation for KVM Nested State ioctls
More info: https://docs.kernel.org/virt/kvm/api.html#capabilities-that-can-be-enabled-on-vcpus Signed-off-by: Philipp Schuster <[email protected]> On-behalf-of: SAP [email protected]
1 parent e3373b1 commit 3d000de

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

kvm-ioctls/src/cap.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,6 @@ pub enum Cap {
165165
UserMemory2 = KVM_CAP_USER_MEMORY2,
166166
GuestMemfd = KVM_CAP_GUEST_MEMFD,
167167
MemoryAttributes = KVM_CAP_MEMORY_ATTRIBUTES,
168+
#[cfg(target_arch = "x86_64")]
169+
NestedState = KVM_CAP_NESTED_STATE,
168170
}

kvm-ioctls/src/kvm_ioctls.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@ ioctl_iow_nr!(
262262
kvm_memory_attributes
263263
);
264264

265+
#[cfg(target_arch = "x86_64")]
266+
ioctl_iowr_nr!(KVM_GET_NESTED_STATE, KVMIO, 0xbe, kvm_nested_state);
267+
268+
#[cfg(target_arch = "x86_64")]
269+
ioctl_iow_nr!(KVM_SET_NESTED_STATE, KVMIO, 0xbf, kvm_nested_state);
270+
265271
// Device ioctls.
266272

267273
/* Available with KVM_CAP_DEVICE_CTRL */

0 commit comments

Comments
 (0)