aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2016-02-09 12:09:49 -0500
committerMarc Zyngier <marc.zyngier@arm.com>2016-03-08 23:24:07 -0500
commit84e8b9c88d5fe9c9a59ed24ae44d7ac0983df92b (patch)
tree84a22a8961fd7f97b4df927712565ce2148dc336
parentb4344545cf85d2a6ad546ec21dab5f76487e020e (diff)
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>
-rw-r--r--arch/arm64/kvm/hyp/vgic-v3-sr.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm64/kvm/hyp/vgic-v3-sr.c b/arch/arm64/kvm/hyp/vgic-v3-sr.c
index 61a5e46b4335..0db426e6c13e 100644
--- a/arch/arm64/kvm/hyp/vgic-v3-sr.c
+++ b/arch/arm64/kvm/hyp/vgic-v3-sr.c
@@ -187,8 +187,15 @@ void __hyp_text __vgic_v3_save_state(struct kvm_vcpu *vcpu)
187 save_maint_int_state(vcpu, max_lr_idx + 1); 187 save_maint_int_state(vcpu, max_lr_idx + 1);
188 188
189 for (i = 0; i <= max_lr_idx; i++) { 189 for (i = 0; i <= max_lr_idx; i++) {
190 if (vcpu->arch.vgic_cpu.live_lrs & (1UL << i)) 190 if (!(vcpu->arch.vgic_cpu.live_lrs & (1UL << i)))
191 cpu_if->vgic_lr[i] = __gic_v3_get_lr(i); 191 continue;
192
193 if (cpu_if->vgic_elrsr & (1 << i)) {
194 cpu_if->vgic_lr[i] &= ~ICH_LR_STATE;
195 continue;
196 }
197
198 cpu_if->vgic_lr[i] = __gic_v3_get_lr(i);
192 } 199 }
193 200
194 switch (nr_pri_bits) { 201 switch (nr_pri_bits) {