summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm64/kvm/hyp/vgic-v3-sr.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/arm64/kvm/hyp/vgic-v3-sr.c b/arch/arm64/kvm/hyp/vgic-v3-sr.c
index 81349479e17c..fff7cd42b3a3 100644
--- a/arch/arm64/kvm/hyp/vgic-v3-sr.c
+++ b/arch/arm64/kvm/hyp/vgic-v3-sr.c
@@ -196,6 +196,7 @@ void __hyp_text __vgic_v3_save_state(struct kvm_vcpu *vcpu)
}
cpu_if->vgic_lr[i] = __gic_v3_get_lr(i);
+ __gic_v3_set_lr(0, i);
}
switch (nr_pri_bits) {
@@ -293,12 +294,10 @@ void __hyp_text __vgic_v3_restore_state(struct kvm_vcpu *vcpu)
}
for (i = 0; i <= max_lr_idx; i++) {
- val = 0;
-
- if (live_lrs & (1 << i))
- val = cpu_if->vgic_lr[i];
+ if (!(live_lrs & (1 << i)))
+ continue;
- __gic_v3_set_lr(val, i);
+ __gic_v3_set_lr(cpu_if->vgic_lr[i], i);
}
}