mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
arm64: KVM: vgic-v3: Do not save an LR known to be empty
On exit, any empty LR will be signaled in ICH_ELRSR_EL2. Which means that we do not have to save it, and we can just clear its state in the in-memory copy. Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
This commit is contained in:
parent
b4344545cf
commit
84e8b9c88d
1 changed files with 9 additions and 2 deletions
|
@ -187,7 +187,14 @@ void __hyp_text __vgic_v3_save_state(struct kvm_vcpu *vcpu)
|
||||||
save_maint_int_state(vcpu, max_lr_idx + 1);
|
save_maint_int_state(vcpu, max_lr_idx + 1);
|
||||||
|
|
||||||
for (i = 0; i <= max_lr_idx; i++) {
|
for (i = 0; i <= max_lr_idx; i++) {
|
||||||
if (vcpu->arch.vgic_cpu.live_lrs & (1UL << i))
|
if (!(vcpu->arch.vgic_cpu.live_lrs & (1UL << i)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (cpu_if->vgic_elrsr & (1 << i)) {
|
||||||
|
cpu_if->vgic_lr[i] &= ~ICH_LR_STATE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
cpu_if->vgic_lr[i] = __gic_v3_get_lr(i);
|
cpu_if->vgic_lr[i] = __gic_v3_get_lr(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue