From: Ian Campbell Date: Wed, 17 Jul 2013 11:18:51 +0000 (+0100) Subject: xen: arm: clear the exclusive monitor on exception return X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6612 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c57c50c1de759583d5de629fec205254280da4f0;p=xen.git xen: arm: clear the exclusive monitor on exception return Otherwise context switching between two vcpus which are contending the same lock can result in a spurious success. Our spinlock and atomics code (which we get from Linux) rely on this behaviour because they use non-exclusive stores for single instruction operations (e.g. spin_unlock or atomic_set). This is not required on ARMv8 since eret implicitly clears the monitor. Signed-off-by: Ian Campbell Acked-by: Stefano Stabellini Acked-by: Tim Deegan --- diff --git a/xen/arch/arm/arm32/entry.S b/xen/arch/arm/arm32/entry.S index 76814dd5eb..1c26835474 100644 --- a/xen/arch/arm/arm32/entry.S +++ b/xen/arch/arm/arm32/entry.S @@ -117,6 +117,7 @@ ENTRY(return_to_hypervisor) msr SPSR_hyp, r11 pop {r0-r12} add sp, #(UREGS_SP_usr - UREGS_sp); /* SP, LR, SPSR, PC */ + clrex eret /*