linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [GIT PULL] arm/arm64: KVM: Fix unaligned access bug on gicv2 access
Date: Mon, 22 Sep 2014 23:12:30 +0200	[thread overview]
Message-ID: <1411420350-368-2-git-send-email-christoffer.dall@linaro.org> (raw)
In-Reply-To: <1411420350-368-1-git-send-email-christoffer.dall@linaro.org>

We were using an atomic bitop on the vgic_v2.vgic_elrsr field which was
not aligned to the natural size on 64-bit platforms.  This bug showed up
after QEMU correctly identifies the pl011 line as being level-triggered,
and not edge-triggered.

These data structures are protected by a spinlock so simply use a
non-atomic version of the accessor instead.

Tested-by: Joel Schopp <joel.schopp@amd.com>
Reported-by: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
 virt/kvm/arm/vgic-v2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virt/kvm/arm/vgic-v2.c b/virt/kvm/arm/vgic-v2.c
index 01124ef..416baed 100644
--- a/virt/kvm/arm/vgic-v2.c
+++ b/virt/kvm/arm/vgic-v2.c
@@ -71,7 +71,7 @@ static void vgic_v2_sync_lr_elrsr(struct kvm_vcpu *vcpu, int lr,
 				  struct vgic_lr lr_desc)
 {
 	if (!(lr_desc.state & LR_STATE_MASK))
-		set_bit(lr, (unsigned long *)vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr);
+		__set_bit(lr, (unsigned long *)vcpu->arch.vgic_cpu.vgic_v2.vgic_elrsr);
 }
 
 static u64 vgic_v2_get_elrsr(const struct kvm_vcpu *vcpu)
-- 
2.0.0

  reply	other threads:[~2014-09-22 21:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 21:12 [GIT PULL] Last-minute fix for kvm/arm64 Christoffer Dall
2014-09-22 21:12 ` Christoffer Dall [this message]
2014-09-22 22:07   ` [GIT PULL] arm/arm64: KVM: Fix unaligned access bug on gicv2 access Will Deacon
2014-09-23  8:36     ` Paolo Bonzini
2014-09-23 11:14       ` Christoffer Dall
2014-09-23 11:50         ` Paolo Bonzini
2014-09-23 12:44           ` Andre Przywara
2014-09-23 12:48             ` Paolo Bonzini
2014-09-23 13:52             ` Christoffer Dall
2014-09-23 13:52               ` Paolo Bonzini
2014-09-23 14:07                 ` Christoffer Dall
2014-09-23 14:01               ` Peter Maydell
2014-09-23 14:03                 ` 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=1411420350-368-2-git-send-email-christoffer.dall@linaro.org \
    --to=christoffer.dall@linaro.org \
    --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).