@@ -20,7 +20,7 @@ use vmm_sys_util::ioctl::{ioctl, ioctl_with_mut_ref, ioctl_with_ref};
20
20
use vmm_sys_util:: ioctl:: { ioctl_with_mut_ptr, ioctl_with_ptr, ioctl_with_val} ;
21
21
22
22
/// Helper method to obtain the size of the register through its id
23
- #[ cfg( any( target_arch = "arm" , target_arch = " aarch64", target_arch = "riscv64" ) ) ]
23
+ #[ cfg( any( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
24
24
pub fn reg_size ( reg_id : u64 ) -> usize {
25
25
2_usize . pow ( ( ( reg_id & KVM_REG_SIZE_MASK ) >> KVM_REG_SIZE_SHIFT ) as u32 )
26
26
}
@@ -224,7 +224,7 @@ impl VcpuFd {
224
224
/// let vcpu = vm.create_vcpu(0).unwrap();
225
225
/// let regs = vcpu.get_regs().unwrap();
226
226
/// ```
227
- #[ cfg( not( any( target_arch = "arm" , target_arch = " aarch64", target_arch = "riscv64" ) ) ) ]
227
+ #[ cfg( not( any( target_arch = "aarch64" , target_arch = "riscv64" ) ) ) ]
228
228
pub fn get_regs ( & self ) -> Result < kvm_regs > {
229
229
let mut regs = kvm_regs:: default ( ) ;
230
230
// SAFETY: Safe because we know that our file is a vCPU fd, we know the kernel will only
@@ -340,7 +340,7 @@ impl VcpuFd {
340
340
/// regs.rip = 0x100;
341
341
/// vcpu.set_regs(®s).unwrap();
342
342
/// ```
343
- #[ cfg( not( any( target_arch = "arm" , target_arch = " aarch64", target_arch = "riscv64" ) ) ) ]
343
+ #[ cfg( not( any( target_arch = "aarch64" , target_arch = "riscv64" ) ) ) ]
344
344
pub fn set_regs ( & self , regs : & kvm_regs ) -> Result < ( ) > {
345
345
// SAFETY: Safe because we know that our file is a vCPU fd, we know the kernel will only
346
346
// read the correct amount of memory from our pointer, and we verify the return result.
@@ -788,7 +788,6 @@ impl VcpuFd {
788
788
/// ```
789
789
#[ cfg( any(
790
790
target_arch = "x86_64" ,
791
- target_arch = "arm" ,
792
791
target_arch = "aarch64" ,
793
792
target_arch = "riscv64" ,
794
793
target_arch = "s390x"
@@ -826,7 +825,6 @@ impl VcpuFd {
826
825
/// ```
827
826
#[ cfg( any(
828
827
target_arch = "x86_64" ,
829
- target_arch = "arm" ,
830
828
target_arch = "aarch64" ,
831
829
target_arch = "riscv64" ,
832
830
target_arch = "s390x"
@@ -1045,7 +1043,7 @@ impl VcpuFd {
1045
1043
/// let vcpu_events = vcpu.get_vcpu_events().unwrap();
1046
1044
/// }
1047
1045
/// ```
1048
- #[ cfg( any( target_arch = "x86_64" , target_arch = "arm" , target_arch = " aarch64") ) ]
1046
+ #[ cfg( any( target_arch = "x86_64" , target_arch = "aarch64" ) ) ]
1049
1047
pub fn get_vcpu_events ( & self ) -> Result < kvm_vcpu_events > {
1050
1048
let mut vcpu_events = Default :: default ( ) ;
1051
1049
// SAFETY: Here we trust the kernel not to read past the end of the kvm_vcpu_events struct.
@@ -1079,7 +1077,7 @@ impl VcpuFd {
1079
1077
/// vcpu.set_vcpu_events(&vcpu_events).unwrap();
1080
1078
/// }
1081
1079
/// ```
1082
- #[ cfg( any( target_arch = "x86_64" , target_arch = "arm" , target_arch = " aarch64") ) ]
1080
+ #[ cfg( any( target_arch = "x86_64" , target_arch = "aarch64" ) ) ]
1083
1081
pub fn set_vcpu_events ( & self , vcpu_events : & kvm_vcpu_events ) -> Result < ( ) > {
1084
1082
// SAFETY: Here we trust the kernel not to read past the end of the kvm_vcpu_events struct.
1085
1083
let ret = unsafe { ioctl_with_ref ( self , KVM_SET_VCPU_EVENTS ( ) , vcpu_events) } ;
@@ -1115,7 +1113,7 @@ impl VcpuFd {
1115
1113
/// vm.get_preferred_target(&mut kvi).unwrap();
1116
1114
/// vcpu.vcpu_init(&kvi).unwrap();
1117
1115
/// ```
1118
- #[ cfg( any ( target_arch = "arm" , target_arch = " aarch64") ) ]
1116
+ #[ cfg( target_arch = "aarch64" ) ]
1119
1117
pub fn vcpu_init ( & self , kvi : & kvm_vcpu_init ) -> Result < ( ) > {
1120
1118
// SAFETY: This is safe because we allocated the struct and we know the kernel will read
1121
1119
// exactly the size of the struct.
@@ -1203,7 +1201,7 @@ impl VcpuFd {
1203
1201
/// let vcpu = vm.create_vcpu(0).unwrap();
1204
1202
///
1205
1203
/// // KVM_GET_REG_LIST on Aarch64 demands that the vcpus be initialized.
1206
- /// #[cfg(any( target_arch = "arm", target_arch = " aarch64") )]
1204
+ /// #[cfg(target_arch = "aarch64")]
1207
1205
/// {
1208
1206
/// let mut kvi: kvm_bindings::kvm_vcpu_init = kvm_bindings::kvm_vcpu_init::default();
1209
1207
/// vm.get_preferred_target(&mut kvi).unwrap();
@@ -1214,7 +1212,7 @@ impl VcpuFd {
1214
1212
/// assert!(reg_list.as_fam_struct_ref().n > 0);
1215
1213
/// }
1216
1214
/// ```
1217
- #[ cfg( any( target_arch = "arm" , target_arch = " aarch64", target_arch = "riscv64" ) ) ]
1215
+ #[ cfg( any( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
1218
1216
pub fn get_reg_list ( & self , reg_list : & mut RegList ) -> Result < ( ) > {
1219
1217
let ret =
1220
1218
// SAFETY: This is safe because we allocated the struct and we trust the kernel will read
@@ -1291,7 +1289,7 @@ impl VcpuFd {
1291
1289
///
1292
1290
/// `data` should be equal or bigger then the register size
1293
1291
/// oterwise function will return EINVAL error
1294
- #[ cfg( any( target_arch = "arm" , target_arch = " aarch64", target_arch = "riscv64" ) ) ]
1292
+ #[ cfg( any( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
1295
1293
pub fn set_one_reg ( & self , reg_id : u64 , data : & [ u8 ] ) -> Result < usize > {
1296
1294
let reg_size = reg_size ( reg_id) ;
1297
1295
if data. len ( ) < reg_size {
@@ -1323,7 +1321,7 @@ impl VcpuFd {
1323
1321
///
1324
1322
/// `data` should be equal or bigger then the register size
1325
1323
/// oterwise function will return EINVAL error
1326
- #[ cfg( any( target_arch = "arm" , target_arch = " aarch64", target_arch = "riscv64" ) ) ]
1324
+ #[ cfg( any( target_arch = "aarch64" , target_arch = "riscv64" ) ) ]
1327
1325
pub fn get_one_reg ( & self , reg_id : u64 , data : & mut [ u8 ] ) -> Result < usize > {
1328
1326
let reg_size = reg_size ( reg_id) ;
1329
1327
if data. len ( ) < reg_size {
@@ -1965,7 +1963,7 @@ mod tests {
1965
1963
extern crate byteorder;
1966
1964
1967
1965
use super :: * ;
1968
- #[ cfg( any( target_arch = "x86_64" , target_arch = "arm" , target_arch = " aarch64") ) ]
1966
+ #[ cfg( any( target_arch = "x86_64" , target_arch = "aarch64" ) ) ]
1969
1967
use crate :: cap:: Cap ;
1970
1968
use crate :: ioctls:: system:: Kvm ;
1971
1969
use std:: ptr:: NonNull ;
@@ -2212,7 +2210,6 @@ mod tests {
2212
2210
2213
2211
#[ cfg( any(
2214
2212
target_arch = "x86_64" ,
2215
- target_arch = "arm" ,
2216
2213
target_arch = "aarch64" ,
2217
2214
target_arch = "riscv64" ,
2218
2215
target_arch = "s390x"
@@ -2264,7 +2261,7 @@ mod tests {
2264
2261
assert_eq ! ( debugregs, other_debugregs) ;
2265
2262
}
2266
2263
2267
- #[ cfg( any( target_arch = "x86_64" , target_arch = "arm" , target_arch = " aarch64") ) ]
2264
+ #[ cfg( any( target_arch = "x86_64" , target_arch = "aarch64" ) ) ]
2268
2265
#[ test]
2269
2266
fn vcpu_events_test ( ) {
2270
2267
let kvm = Kvm :: new ( ) . unwrap ( ) ;
@@ -2606,7 +2603,6 @@ mod tests {
2606
2603
#[ test]
2607
2604
#[ cfg( any(
2608
2605
target_arch = "x86_64" ,
2609
- target_arch = "arm" ,
2610
2606
target_arch = "aarch64" ,
2611
2607
target_arch = "riscv64"
2612
2608
) ) ]
@@ -2635,12 +2631,12 @@ mod tests {
2635
2631
. errno( ) ,
2636
2632
badf_errno
2637
2633
) ;
2638
- #[ cfg( any( target_arch = "x86_64" , target_arch = "arm" , target_arch = " aarch64") ) ]
2634
+ #[ cfg( any( target_arch = "x86_64" , target_arch = "aarch64" ) ) ]
2639
2635
assert_eq ! (
2640
2636
faulty_vcpu_fd. get_vcpu_events( ) . unwrap_err( ) . errno( ) ,
2641
2637
badf_errno
2642
2638
) ;
2643
- #[ cfg( any( target_arch = "x86_64" , target_arch = "arm" , target_arch = " aarch64") ) ]
2639
+ #[ cfg( any( target_arch = "x86_64" , target_arch = "aarch64" ) ) ]
2644
2640
assert_eq ! (
2645
2641
faulty_vcpu_fd
2646
2642
. set_vcpu_events( & kvm_vcpu_events:: default ( ) )
@@ -2924,7 +2920,7 @@ mod tests {
2924
2920
}
2925
2921
2926
2922
#[ test]
2927
- #[ cfg( any ( target_arch = "arm" , target_arch = " aarch64") ) ]
2923
+ #[ cfg( target_arch = "aarch64" ) ]
2928
2924
fn test_get_preferred_target ( ) {
2929
2925
let kvm = Kvm :: new ( ) . unwrap ( ) ;
2930
2926
let vm = kvm. create_vm ( ) . unwrap ( ) ;
@@ -2938,7 +2934,7 @@ mod tests {
2938
2934
}
2939
2935
2940
2936
#[ test]
2941
- #[ cfg( any ( target_arch = "arm" , target_arch = " aarch64") ) ]
2937
+ #[ cfg( target_arch = "aarch64" ) ]
2942
2938
fn test_set_one_reg ( ) {
2943
2939
let kvm = Kvm :: new ( ) . unwrap ( ) ;
2944
2940
let vm = kvm. create_vm ( ) . unwrap ( ) ;
@@ -2964,7 +2960,7 @@ mod tests {
2964
2960
}
2965
2961
2966
2962
#[ test]
2967
- #[ cfg( any ( target_arch = "arm" , target_arch = " aarch64") ) ]
2963
+ #[ cfg( target_arch = "aarch64" ) ]
2968
2964
fn test_get_one_reg ( ) {
2969
2965
let kvm = Kvm :: new ( ) . unwrap ( ) ;
2970
2966
let vm = kvm. create_vm ( ) . unwrap ( ) ;
@@ -3000,7 +2996,7 @@ mod tests {
3000
2996
}
3001
2997
3002
2998
#[ test]
3003
- #[ cfg( any ( target_arch = "arm" , target_arch = " aarch64") ) ]
2999
+ #[ cfg( target_arch = "aarch64" ) ]
3004
3000
fn test_get_reg_list ( ) {
3005
3001
let kvm = Kvm :: new ( ) . unwrap ( ) ;
3006
3002
let vm = kvm. create_vm ( ) . unwrap ( ) ;
0 commit comments