summaryrefslogtreecommitdiffstats
path: root/virt/kvm/arm/vgic/vgic-v3.c
diff options
context:
space:
mode:
authorJia He <hejianet@gmail.com>2018-08-03 21:57:04 +0800
committerMarc Zyngier <marc.zyngier@arm.com>2018-08-12 12:15:18 +0100
commitd0823cb346bc6f685f230bdbec51910a329e3fe3 (patch)
tree010a8340716260a359b281420e70066a3d4714e5 /virt/kvm/arm/vgic/vgic-v3.c
parentdc961e5395dde279b77e2cdbdcc99560b89bdfd9 (diff)
downloadlinux-d0823cb346bc6f685f230bdbec51910a329e3fe3.tar.bz2
KVM: arm/arm64: vgic: Do not use spin_lock_irqsave/restore with irq disabled
kvm_vgic_sync_hwstate is only called with IRQ being disabled. There is thus no need to call spin_lock_irqsave/restore in vgic_fold_lr_state and vgic_prune_ap_list. This patch replace them with the non irq-safe version. Signed-off-by: Jia He <jia.he@hxt-semitech.com> Acked-by: Christoffer Dall <christoffer.dall@arm.com> [maz: commit message tidy-up] Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'virt/kvm/arm/vgic/vgic-v3.c')
-rw-r--r--virt/kvm/arm/vgic/vgic-v3.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/virt/kvm/arm/vgic/vgic-v3.c b/virt/kvm/arm/vgic/vgic-v3.c
index 530b8491c892..9c0dd234ebe8 100644
--- a/virt/kvm/arm/vgic/vgic-v3.c
+++ b/virt/kvm/arm/vgic/vgic-v3.c
@@ -46,7 +46,8 @@ void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu)
struct vgic_v3_cpu_if *cpuif = &vgic_cpu->vgic_v3;
u32 model = vcpu->kvm->arch.vgic.vgic_model;
int lr;
- unsigned long flags;
+
+ DEBUG_SPINLOCK_BUG_ON(!irqs_disabled());
cpuif->vgic_hcr &= ~ICH_HCR_UIE;
@@ -75,7 +76,7 @@ void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu)
if (!irq) /* An LPI could have been unmapped. */
continue;
- spin_lock_irqsave(&irq->irq_lock, flags);
+ spin_lock(&irq->irq_lock);
/* Always preserve the active bit */
irq->active = !!(val & ICH_LR_ACTIVE_BIT);
@@ -118,7 +119,7 @@ void vgic_v3_fold_lr_state(struct kvm_vcpu *vcpu)
vgic_irq_set_phys_active(irq, false);
}
- spin_unlock_irqrestore(&irq->irq_lock, flags);
+ spin_unlock(&irq->irq_lock);
vgic_put_irq(vcpu->kvm, irq);
}