Skip to content

Commit 63f2f12

Browse files
MrXinWangandreeaflorescu
authored andcommitted
vcpu: Fix Arm target_arch gate for set_guest_debug
KVM_SET_GUEST_DEBUG supports arm64 architecture, but the correct target_arch gate name in Rust should be aarch64 instead of arm64. This commit does the fix for set_guest_debug() so that other crates that depend on the kvm-ioctls crate can be benefited. Signed-off-by: Henry Wang <[email protected]>
1 parent 9b64903 commit 63f2f12

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/ioctls/vcpu.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,17 +1157,15 @@ impl VcpuFd {
11571157
/// let vm = kvm.create_vm().unwrap();
11581158
/// let vcpu = vm.create_vcpu(0).unwrap();
11591159
///
1160-
/// #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
1160+
/// #[cfg(any(target_arch = "x86", target_arch = "x86_64", target_arch = "aarch64"))]
11611161
/// {
11621162
/// let debug_struct = kvm_guest_debug {
11631163
/// // Configure the vcpu so that a KVM_DEBUG_EXIT would be generated
11641164
/// // when encountering a software breakpoint during execution
11651165
/// control: KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP,
11661166
/// pad: 0,
1167-
/// // Reset all x86-specific debug registers
1168-
/// arch: kvm_guest_debug_arch {
1169-
/// debugreg: [0, 0, 0, 0, 0, 0, 0, 0],
1170-
/// },
1167+
/// // Reset all arch-specific debug registers
1168+
/// arch: Default::default(),
11711169
/// };
11721170
///
11731171
/// vcpu.set_guest_debug(&debug_struct).unwrap();
@@ -1176,7 +1174,7 @@ impl VcpuFd {
11761174
#[cfg(any(
11771175
target_arch = "x86",
11781176
target_arch = "x86_64",
1179-
target_arch = "arm64",
1177+
target_arch = "aarch64",
11801178
target_arch = "s390",
11811179
target_arch = "ppc"
11821180
))]

0 commit comments

Comments
 (0)