From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: Re: [PATCH] arm64: KVM: fix 64bit CP15 VM access for 32bit guests Date: Fri, 1 Aug 2014 14:04:44 +0200 Message-ID: <20140801120444.GM11610@cbox> References: <1406890836-7294-1-git-send-email-marc.zyngier@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Victor Kamensky To: Marc Zyngier Return-path: Received: from mail-la0-f54.google.com ([209.85.215.54]:51408 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755062AbaHAMEo (ORCPT ); Fri, 1 Aug 2014 08:04:44 -0400 Received: by mail-la0-f54.google.com with SMTP id hz20so3186369lab.13 for ; Fri, 01 Aug 2014 05:04:42 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1406890836-7294-1-git-send-email-marc.zyngier@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 > Cc: Christoffer Dall > Signed-off-by: Marc Zyngier > --- > 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