All of lore.kernel.org
 help / color / mirror / Atom feed
From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: KVM: fix 64bit CP15 VM access for 32bit guests
Date: Fri, 1 Aug 2014 14:04:44 +0200	[thread overview]
Message-ID: <20140801120444.GM11610@cbox> (raw)
In-Reply-To: <1406890836-7294-1-git-send-email-marc.zyngier@arm.com>

On Fri, Aug 01, 2014 at 12:00:36PM +0100, Marc Zyngier wrote:
> Commit f0a3eaff71b8 (ARM64: KVM: fix big endian issue in
> access_vm_reg for 32bit guest) changed the way we handle CP15
> VM accesses, so that all 64bit accesses are done via vcpu_sys_reg.
> 
> This looks like a good idea as it solves indianness issues in an
> elegant way, except for one small detail: the register index is
> doesn't refer to the same array! We end up corrupting some random
> data structure instead.

Ouch!

> 
> Fix this by reverting to the original code, except for the introduction
> of a vcpu_cp15_64_high macro that deals with the endianness thing.
> 
> Tested on Juno with 32bit SMP guests.
> 
> Cc: Victor Kamensky <victor.kamensky@linaro.org>
> Cc: Christoffer Dall <christoffer.dall@linaro.org>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
> Christoffer, can you please have a look at this one and and queue it if
> you find it acceptable?
> 

Good catch, it looks good, I'll queue it on kvmarm/next right away.

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>

-Christoffer

WARNING: multiple messages have this Message-ID (diff)
From: Christoffer Dall <christoffer.dall@linaro.org>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org,
	Victor Kamensky <victor.kamensky@linaro.org>
Subject: Re: [PATCH] arm64: KVM: fix 64bit CP15 VM access for 32bit guests
Date: Fri, 1 Aug 2014 14:04:44 +0200	[thread overview]
Message-ID: <20140801120444.GM11610@cbox> (raw)
In-Reply-To: <1406890836-7294-1-git-send-email-marc.zyngier@arm.com>

On Fri, Aug 01, 2014 at 12:00:36PM +0100, Marc Zyngier wrote:
> Commit f0a3eaff71b8 (ARM64: KVM: fix big endian issue in
> access_vm_reg for 32bit guest) changed the way we handle CP15
> VM accesses, so that all 64bit accesses are done via vcpu_sys_reg.
> 
> This looks like a good idea as it solves indianness issues in an
> elegant way, except for one small detail: the register index is
> doesn't refer to the same array! We end up corrupting some random
> data structure instead.

Ouch!

> 
> Fix this by reverting to the original code, except for the introduction
> of a vcpu_cp15_64_high macro that deals with the endianness thing.
> 
> Tested on Juno with 32bit SMP guests.
> 
> Cc: Victor Kamensky <victor.kamensky@linaro.org>
> Cc: Christoffer Dall <christoffer.dall@linaro.org>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
> Christoffer, can you please have a look at this one and and queue it if
> you find it acceptable?
> 

Good catch, it looks good, I'll queue it on kvmarm/next right away.

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>

-Christoffer

  reply	other threads:[~2014-08-01 12:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-01 11:00 [PATCH] arm64: KVM: fix 64bit CP15 VM access for 32bit guests Marc Zyngier
2014-08-01 11:00 ` Marc Zyngier
2014-08-01 12:04 ` Christoffer Dall [this message]
2014-08-01 12:04   ` 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=20140801120444.GM11610@cbox \
    --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 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.