linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/3] ARM: KVM: clear exclusive monitor on all exception returns
Date: Fri, 21 Jun 2013 13:08:48 +0100	[thread overview]
Message-ID: <1371816528-25078-4-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1371816528-25078-1-git-send-email-marc.zyngier@arm.com>

Make sure we clear the exclusive movitor on all exception returns,
which otherwise could lead to lock corruptions.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/kvm/interrupts.S | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
index 20e03d9..16cd4ba 100644
--- a/arch/arm/kvm/interrupts.S
+++ b/arch/arm/kvm/interrupts.S
@@ -292,6 +292,7 @@ THUMB(	orr	r2, r2, #PSR_T_BIT	)
 	ldr	r2, =BSYM(panic)
 	msr	ELR_hyp, r2
 	ldr	r0, =\panic_str
+	clrex				@ Clear exclusive monitor
 	eret
 .endm
 
@@ -441,6 +442,7 @@ guest_trap:
 
 4:	pop	{r0, r1}		@ Failed translation, return to guest
 	mcrr	p15, 0, r0, r1, c7	@ PAR
+	clrex
 	pop	{r0, r1, r2}
 	eret
 
@@ -467,6 +469,7 @@ switch_to_guest_vfp:
 
 	pop	{r3-r7}
 	pop	{r0-r2}
+	clrex
 	eret
 #endif
 
-- 
1.8.2.3

  parent reply	other threads:[~2013-06-21 12:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-21 12:08 [PATCH v2 0/3] A handful of KVM/ARM fixes Marc Zyngier
2013-06-21 12:08 ` [PATCH v2 1/3] ARM: KVM: perform save/restore of PAR Marc Zyngier
2013-06-21 18:47   ` Christoffer Dall
2013-06-22 12:26     ` Marc Zyngier
2013-06-21 12:08 ` [PATCH v2 2/3] ARM: KVM: add missing dsb before invalidating Stage-2 TLBs Marc Zyngier
2013-06-21 12:08 ` Marc Zyngier [this message]
2013-06-21 13:55   ` [PATCH v2 3/3] ARM: KVM: clear exclusive monitor on all exception returns Sergei Shtylyov
2013-06-21 18:48     ` Christoffer Dall
2013-06-21 18:49 ` [PATCH v2 0/3] A handful of KVM/ARM fixes Christoffer Dall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371816528-25078-4-git-send-email-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).