hypervisor: Remove useless check when saving Arm SystemRegs

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
Henry Wang 2021-08-24 07:30:59 -04:00 committed by Sebastien Boeuf
parent 4e5cbd27bb
commit d74a219add

View File

@ -1273,19 +1273,12 @@ impl cpu::Vcpu for KvmVcpu {
// call KVM_GET_ONE_REG on each id in order to save all of them. We carve out from the list
// the core registers which are represented in the kernel by kvm_regs structure and for which
// we can calculate the id based on the offset in the structure.
reg_list.retain(|regid| *regid != 0);
reg_list.as_slice().to_vec().sort_unstable();
reg_list.retain(|regid| is_system_register(*regid));
// Now, for the rest of the registers left in the previously fetched register list, we are
// simply calling KVM_GET_ONE_REG.
let indices = reg_list.as_slice();
for (_pos, index) in indices.iter().enumerate() {
if _pos > 230 {
break;
}
for index in indices.iter() {
state.push(kvm_bindings::kvm_one_reg {
id: *index,
addr: self