ARM: KVM: fix unbalanced get_cpu() in access_dcsw
PATCH 1/1 ARM: KVM: fix unbalanced get_cpu() in access_dcsw
In the very unlikely event where a guest would be foolish enough to *read* from a write-only cache maintainance register, we end up with preemption disabled, due to a misplaced get_cpu().
Just move the "is_write" test outside of the critical section.
--- arch/arm/kvm/coproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/kvm/coproc.c +2 -2
@@ -79,11 +79,11 @@ static bool access_dcsw(struct kvm_vcpu *vcpu,unsigned long val;int cpu; - cpu =get_cpu (); -if (!p->is_write)return read_from_write_only (vcpu, p); + cpu =get_cpu (); +cpumask_setall (&vcpu->arch.require_dcache_flush);cpumask_clear_cpu (cpu, &vcpu->arch.require_dcache_flush);
Signature · 1 line
1.8.1.4
PATCH 1/1 ARM: KVM: fix unbalanced get_cpu() in access_dcsw
Quoted 7 lines · Marc Zyngier
In the very unlikely event where a guest would be foolish enough to *read* from a write-only cache maintainance register, we end up with preemption disabled, due to a misplaced
get_cpu().Just move the "
is_write" test outside of the critical section.Signed-off-by Marc Zyngier <[email protected]>
I found it second time around!
Will
PATCH 1/1 ARM: KVM: fix unbalanced get_cpu() in access_dcsw
Quoted 5 lines · Will Deacon
Quoted 4 lines · Marc Zyngier
In the very unlikely event where a guest would be foolish enough to *read* from a write-only cache maintainance register, we end up with preemption disabled, due to a misplaced
get_cpu().
Quoted 7 lines
Quoted 3 lines
Just move the "
is_write" test outside of the critical section.Signed-off-by Marc Zyngier <[email protected]>I found it second time around!
Reported-by Will Deacon <[email protected]>
Indeed you did! :-)
I'll add that to the commit, and on a couple of other as well...
M.
Signature · 1 line
Fast, cheap, reliable. Pick two.
Christoffer Dall
AppliedPATCH 1/1 ARM: KVM: fix unbalanced get_cpu() in access_dcsw
Quoted 11 lines · Marc Zyngier
Quoted 9 lines · Will Deacon
Quoted 7 lines · Marc Zyngier
In the very unlikely event where a guest would be foolish enough to *read* from a write-only cache maintainance register, we end up with preemption disabled, due to a misplaced
get_cpu().Just move the "
is_write" test outside of the critical section.Signed-off-by Marc Zyngier <[email protected]>
Quoted 7 lines
Quoted 3 lines
I found it second time around!
Reported-by Will Deacon <[email protected]>Indeed you did! :-)
I'll add that to the commit, and on a couple of other as well...
I applied the patch and added the tag, thanks.
-Christoffer