File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,8 @@ pub enum VcpuExit<'a> {
184
184
/// size
185
185
size : u64 ,
186
186
} ,
187
+ /// Corresponds to KVM_EXIT_RISCV_SBI
188
+ RiscvSbi ( & ' a mut kvm_run__bindgen_ty_1__bindgen_ty_24 ) ,
187
189
/// Corresponds to an exit reason that is unknown from the current version
188
190
/// of the kvm-ioctls crate. Let the consumer decide about what to do with
189
191
/// it.
@@ -1641,6 +1643,13 @@ impl VcpuFd {
1641
1643
Ok ( VcpuExit :: IoapicEoi ( eoi. vector ) )
1642
1644
}
1643
1645
KVM_EXIT_HYPERV => Ok ( VcpuExit :: Hyperv ) ,
1646
+ #[ cfg( target_arch = "riscv64" ) ]
1647
+ KVM_EXIT_RISCV_SBI => {
1648
+ // SAFETY: Safe because the exit_reason (which comes from the kernel) told us
1649
+ // which union field to use.
1650
+ let riscv_sbi = unsafe { & mut run. __bindgen_anon_1 . riscv_sbi } ;
1651
+ Ok ( VcpuExit :: RiscvSbi ( riscv_sbi) )
1652
+ }
1644
1653
r => Ok ( VcpuExit :: Unsupported ( r) ) ,
1645
1654
}
1646
1655
} else {
@@ -2645,7 +2654,7 @@ mod tests {
2645
2654
. map ( |page| page. count_ones ( ) )
2646
2655
. sum ( ) ;
2647
2656
assert_eq ! ( dirty_pages, 1 ) ;
2648
- break ;
2657
+ break ;
2649
2658
}
2650
2659
r => panic ! ( "unexpected exit reason: {:?}" , r) ,
2651
2660
}
You can’t perform that action at this time.
0 commit comments