From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] arm/arm64: KVM: vgic: Bugfix in handle_mmio_cfg_reg
Date: Fri, 22 Nov 2013 15:57:17 -0800 [thread overview]
Message-ID: <1385164639-18710-2-git-send-email-christoffer.dall@linaro.org> (raw)
In-Reply-To: <1385164639-18710-1-git-send-email-christoffer.dall@linaro.org>
We shift the offset right by 1 bit because we pretend the register
access is for a register packed with 1 bit per setting and not 2 bits
like the hardware. However, after we expand the emulated register into
the layout of the real hardware register, we need to use the hardware
offset for accessing the register. Adjust the code accordingly.
Cc: Haibin Wang <wanghaibin202@gmail.com>
Reported-by: Haibin Wang <wanghaibin202@gmail.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
virt/kvm/arm/vgic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
index 685fc72..6699ed9 100644
--- a/virt/kvm/arm/vgic.c
+++ b/virt/kvm/arm/vgic.c
@@ -553,7 +553,7 @@ static bool handle_mmio_cfg_reg(struct kvm_vcpu *vcpu,
val = *reg & 0xffff;
val = vgic_cfg_expand(val);
- vgic_reg_access(mmio, &val, offset,
+ vgic_reg_access(mmio, &val, offset << 1,
ACCESS_READ_VALUE | ACCESS_WRITE_VALUE);
if (mmio->is_write) {
if (offset < 4) {
--
1.8.4.3
next prev parent reply other threads:[~2013-11-22 23:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 23:57 [PATCH 0/3] arm/arm64: KVM: vgic: Various bugfixes and improvements Christoffer Dall
2013-11-22 23:57 ` Christoffer Dall [this message]
2013-11-22 23:57 ` [PATCH 2/3] arm/arm64: KVM: vgic: Bugfix in vgic_dispatch_sgi Christoffer Dall
2013-11-22 23:57 ` [PATCH 3/3] arm/arm64: KVM: vgic: Use non-atomic bitops 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=1385164639-18710-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).