From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: Re: [PATCH v3 24/32] arm64: KVM: 32bit GP register access Date: Wed, 24 Apr 2013 14:06:41 +0100 Message-ID: <5177D8E1.6010903@arm.com> References: <1365437854-30214-1-git-send-email-marc.zyngier@arm.com> <1365437854-30214-25-git-send-email-marc.zyngier@arm.com> <20130423230039.GI20569@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Cc: "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , "kvm@vger.kernel.org" , Catalin Marinas , Will Deacon , Christopher Covington To: Christoffer Dall Return-path: Received: from service87.mimecast.com ([91.220.42.44]:33511 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753742Ab3DXNGp convert rfc822-to-8bit (ORCPT ); Wed, 24 Apr 2013 09:06:45 -0400 In-Reply-To: <20130423230039.GI20569@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 24/04/13 00:00, Christoffer Dall wrote: > On Mon, Apr 08, 2013 at 05:17:26PM +0100, Marc Zyngier wrote: >> Allow access to the 32bit register file through the usual API. >> >> Reviewed-by: Christopher Covington >> Signed-off-by: Marc Zyngier >> --- >> arch/arm64/include/asm/kvm_emulate.h | 17 +++- >> arch/arm64/kvm/Makefile | 2 +- >> arch/arm64/kvm/regmap.c | 168 +++++++++++++++++++++++++++++++++++ >> 3 files changed, 184 insertions(+), 3 deletions(-) >> create mode 100644 arch/arm64/kvm/regmap.c >> >> diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h >> index 2dcfa74..37a6567 100644 >> --- a/arch/arm64/include/asm/kvm_emulate.h >> +++ b/arch/arm64/include/asm/kvm_emulate.h >> @@ -28,6 +28,9 @@ >> #include >> #include >> >> +unsigned long *vcpu_reg32(const struct kvm_vcpu *vcpu, u8 reg_num); >> +unsigned long *vcpu_spsr32(const struct kvm_vcpu *vcpu); >> + >> void kvm_inject_undefined(struct kvm_vcpu *vcpu); >> void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr); >> void kvm_inject_pabt(struct kvm_vcpu *vcpu, unsigned long addr); >> @@ -49,7 +52,7 @@ static inline unsigned long *vcpu_cpsr(const struct kvm_vcpu *vcpu) >> >> static inline bool vcpu_mode_is_32bit(const struct kvm_vcpu *vcpu) >> { >> - return false; /* 32bit? Bahhh... */ >> + return !!(*vcpu_cpsr(vcpu) & PSR_MODE32_BIT); > > nit: you don't need the '!!': it's a bool No it is not. It is a bitwise and, turned into a bool. Thanks, M. -- Jazz is not dead. It just smells funny...