mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-01 11:05:46 +00:00
hypervisor: Remove useless check when saving Arm SystemRegs
Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
parent
4e5cbd27bb
commit
d74a219add
@ -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
|
// 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
|
// 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.
|
// 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));
|
reg_list.retain(|regid| is_system_register(*regid));
|
||||||
|
|
||||||
// Now, for the rest of the registers left in the previously fetched register list, we are
|
// Now, for the rest of the registers left in the previously fetched register list, we are
|
||||||
// simply calling KVM_GET_ONE_REG.
|
// simply calling KVM_GET_ONE_REG.
|
||||||
let indices = reg_list.as_slice();
|
let indices = reg_list.as_slice();
|
||||||
for (_pos, index) in indices.iter().enumerate() {
|
for index in indices.iter() {
|
||||||
if _pos > 230 {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
state.push(kvm_bindings::kvm_one_reg {
|
state.push(kvm_bindings::kvm_one_reg {
|
||||||
id: *index,
|
id: *index,
|
||||||
addr: self
|
addr: self
|
||||||
|
Loading…
Reference in New Issue
Block a user