[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 0/4] xen/arm: fix rank/vgic lock inversion bug
Hi all, this patch series fixes a lock inversion bug in Xen on ARM. The locking order is: first rank lock, then vgic lock. The order is respected everywhere, except for gic_update_one_lr. gic_update_one_lr is called with the vgic lock held, but it calls vgic_get_target_vcpu, which tries to obtain the rank lock. This can cause deadlocks. The series fixes the issue by avoiding the rank lock in gic_update_one_lr. It makes it safe by ensuring that the right vgic lock is always taken by vgic_migrate_irq. The first patch is just a fix to a bug I discovered while testing this series. Stefano Stabellini (4): xen/arm: fix GIC_INVALID_LR arm: store vcpu id in struct irq_pending arm,vgic_migrate_irq: take the right vgic lock The locking order is: first rank lock, then vgic lock. The order is respected everywhere, except for gic_update_one_lr. xen/arch/arm/gic.c | 14 ++++++++++-- xen/arch/arm/vgic-v2.c | 12 +++------- xen/arch/arm/vgic-v3.c | 6 +---- xen/arch/arm/vgic.c | 56 +++++++++++++++++++++++++++++++++++++--------- xen/include/asm-arm/vgic.h | 8 +++++-- 5 files changed, 68 insertions(+), 28 deletions(-) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |