arm: read/write rank->vcpu atomically
authorStefano Stabellini <sstabellini@kernel.org>
Sat, 11 Feb 2017 02:05:22 +0000 (18:05 -0800)
committerStefano Stabellini <sstabellini@kernel.org>
Thu, 16 Feb 2017 19:57:36 +0000 (11:57 -0800)
commit378384399ed661bed711221a5d8dbdac66b8e851
tree970c32c2a8f90dbf4094226c371fb3dcc5002798
parent79903e50dba9e7442c9b7ca424661bb020e9dbf2
arm: read/write rank->vcpu atomically

We don't need a lock in vgic_get_target_vcpu anymore, solving the
following lock inversion bug: the rank lock should be taken first, then
the vgic lock. However, gic_update_one_lr is called with the vgic lock
held, and it calls vgic_get_target_vcpu, which tries to obtain the rank
lock.

Coverity-ID: 1381855
Coverity-ID: 1381853

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/vgic-v2.c
xen/arch/arm/vgic-v3.c
xen/arch/arm/vgic.c
xen/include/asm-arm/vgic.h