From c44661b4d904f8be227faef8f84ddb22934a01e8 Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 23 Aug 2022 19:58:51 +0000 Subject: deploy: c94950f9dca80387aab264c7aa4044feff76625c --- src/kvm_rs/kvm_sys.rs.html | 351 ++++++++++++++++++++++++++++++++------------- 1 file changed, 249 insertions(+), 102 deletions(-) (limited to 'src/kvm_rs/kvm_sys.rs.html') diff --git a/src/kvm_rs/kvm_sys.rs.html b/src/kvm_rs/kvm_sys.rs.html index ee527a3..0557e54 100644 --- a/src/kvm_rs/kvm_sys.rs.html +++ b/src/kvm_rs/kvm_sys.rs.html @@ -1,107 +1,108 @@ -kvm_sys.rs - source -
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
 100
 101
 102
@@ -200,6 +201,79 @@
 195
 196
 197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
 
//! Definitions of the system header [`<linux/kvm.h>`][kvm-h].
 //!
 //! [kvm-h]: https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/kvm.h
@@ -293,6 +367,32 @@
     pub userspace_addr: u64,
 }
 
+#[cfg(target_arch = "x86_64")]
+#[repr(C)]
+#[derive(Default, Debug)]
+pub struct kvm_debugregs {
+    pub db: [u64; 4],
+    pub dr6: u64,
+    pub dr7: u64,
+    pub flags: u64,
+    pub reserved: [u64; 9],
+}
+
+#[repr(C)]
+#[derive(Default, Debug)]
+pub(crate) struct kvm_guest_debug {
+    pub control: u32,
+    pad: u32,
+    pub arch: kvm_guest_debug_arch,
+}
+
+#[cfg(target_arch = "x86_64")]
+#[repr(C)]
+#[derive(Default, Debug)]
+pub(crate) struct kvm_guest_debug_arch {
+    pub debugreg: [u64; 8],
+}
+
 #[repr(C)]
 pub(crate) struct kvm_run {
     request_interrupt_window: u8,
@@ -329,11 +429,23 @@
     pub is_write: u8,
 }
 
+#[cfg(target_arch = "x86_64")]
+#[repr(C)]
+#[derive(Copy, Clone, Debug)]
+pub(crate) struct kvm_run_debug {
+    pub exception: u32,
+    pad: u32,
+    pub pc: u64,
+    pub dr6: u64,
+    pub dr7: u64,
+}
+
 // Only add the union fields used here.
 #[repr(C)]
 pub(crate) union kvm_run_union {
     pub io: kvm_run_io,
     pub mmio: kvm_run_mmio,
+    pub debug: kvm_run_debug,
     padding: [u8; 256],
 }
 
@@ -396,7 +508,42 @@
         assert_eq!(mem::size_of::<kvm_run_mmio>(), TEST_KVM_RUN_MMIO_SIZE);
         assert_eq!(mem::size_of::<kvm_run_union_s>(), TEST_KVM_RUN_UNION_S_SIZE);
     }
+
+    #[cfg(target_arch = "x86_64")]
+    #[test]
+    fn check_kvm_run_x86() {
+        assert_eq!(mem::size_of::<kvm_run_debug>(), TEST_KVM_RUN_DEBUG_SIZE);
+    }
+
+    #[cfg(target_arch = "x86_64")]
+    #[test]
+    fn check_kvm_debugregs() {
+        assert_eq!(mem::size_of::<kvm_debugregs>(), TEST_KVM_DEBUGREGS_SIZE);
+        assert_eq!(mem::align_of::<kvm_debugregs>(), TEST_KVM_DEBUGREGS_ALIGN);
+    }
+
+    #[test]
+    fn check_kvm_guest_dbg() {
+        assert_eq!(mem::size_of::<kvm_guest_debug>(), TEST_KVM_GUEST_DEBUG_SIZE);
+        assert_eq!(
+            mem::align_of::<kvm_guest_debug>(),
+            TEST_KVM_GUEST_DEBUG_ALIGN
+        );
+    }
+
+    #[cfg(target_arch = "x86_64")]
+    #[test]
+    fn check_kvm_guest_dbg_arch() {
+        assert_eq!(
+            mem::size_of::<kvm_guest_debug_arch>(),
+            TEST_KVM_GUEST_DEBUG_ARCH_SIZE
+        );
+        assert_eq!(
+            mem::align_of::<kvm_guest_debug_arch>(),
+            TEST_KVM_GUEST_DEBUG_ARCH_ALIGN
+        );
+    }
 }
 
-
+
\ No newline at end of file -- cgit v1.2.3