From: Christoffer Dall <christoffer.dall@linaro.org>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: pbonzini@redhat.com, gleb@redhat.com, "Zhaobo (Bob,
ERC)" <zhaobo@huawei.com>,
kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [PATCH 2/4] ARM: KVM: vgic: fix GICD_ICFGRn access
Date: Thu, 29 Aug 2013 13:28:07 -0700 [thread overview]
Message-ID: <20130829202807.GI9215@cbox> (raw)
In-Reply-To: <1377770905-9937-3-git-send-email-marc.zyngier@arm.com>
On Thu, Aug 29, 2013 at 11:08:23AM +0100, Marc Zyngier wrote:
> All the code in handle_mmio_cfg_reg() assumes the offset has
> been shifted right to accomodate for the 2:1 bit compression,
> but this is only done when getting the register addess.
address
>
> Shift the offset early so the code works mostly unchanged.
>
> Reported-by: Zhaobo (Bob, ERC) <zhaobo@huawei.com>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
> virt/kvm/arm/vgic.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
> index a2d478a..902789f 100644
> --- a/virt/kvm/arm/vgic.c
> +++ b/virt/kvm/arm/vgic.c
> @@ -541,8 +541,12 @@ static bool handle_mmio_cfg_reg(struct kvm_vcpu *vcpu,
> struct kvm_exit_mmio *mmio, phys_addr_t offset)
> {
> u32 val;
> - u32 *reg = vgic_bitmap_get_reg(&vcpu->kvm->arch.vgic.irq_cfg,
> - vcpu->vcpu_id, offset >> 1);
> + u32 *reg;
> +
> + offset >>= 1;
> + reg = vgic_bitmap_get_reg(&vcpu->kvm->arch.vgic.irq_cfg,
> + vcpu->vcpu_id, offset);
> +
> if (offset & 2)
> val = *reg >> 16;
> else
> --
> 1.8.2.3
>
>
>
> _______________________________________________
> kvmarm mailing list
> kvmarm@lists.cs.columbia.edu
> https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm
next prev parent reply other threads:[~2013-08-29 20:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-29 10:08 [GIT PULL] ARM: KVM: VGIC fixes for 3.12 Marc Zyngier
2013-08-29 10:08 ` [PATCH 1/4] ARM: KVM: vgic: simplify vgic_get_target_reg Marc Zyngier
2013-08-29 10:08 ` [PATCH 2/4] ARM: KVM: vgic: fix GICD_ICFGRn access Marc Zyngier
2013-08-29 20:28 ` Christoffer Dall [this message]
2013-08-29 10:08 ` [PATCH 3/4] ARM: KVM: Bugfix: vgic_bytemap_get_reg per cpu regs Marc Zyngier
2013-08-29 10:08 ` [PATCH 4/4] ARM: KVM: vgic: Bump VGIC_NR_IRQS to 256 Marc Zyngier
2013-08-30 13:08 ` [GIT PULL] ARM: KVM: VGIC fixes for 3.12 Gleb Natapov
2013-08-30 13:15 ` Marc Zyngier
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=20130829202807.GI9215@cbox \
--to=christoffer.dall@linaro.org \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=marc.zyngier@arm.com \
--cc=pbonzini@redhat.com \
--cc=zhaobo@huawei.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.