Skip to content

Commit 983d7da

Browse files
author
BillXiang
committed
riscv64: Add unsafe comment for KVM_EXIT_RISCV_SBI
Signed-off-by: BillXiang <[email protected]>
1 parent 38b6133 commit 983d7da

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kvm-ioctls/src/ioctls/vcpu.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,8 @@ impl VcpuFd {
16941694
KVM_EXIT_HYPERV => Ok(VcpuExit::Hyperv),
16951695
#[cfg(target_arch = "riscv64")]
16961696
KVM_EXIT_RISCV_SBI => {
1697+
// SAFETY: Safe because the exit_reason (which comes from the kernel) told us
1698+
// which union field to use and the type of extension_id is 'enum sbi_ext_id'.
16971699
match unsafe {run.__bindgen_anon_1.riscv_sbi.extension_id} as u32 {
16981700
SBI_EXT_0_1_CONSOLE_PUTCHAR => {
16991701
let ch = unsafe { run.__bindgen_anon_1.riscv_sbi.args[0] };

0 commit comments

Comments
 (0)