From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [Qemu-ppc] [RFC PATCH 07/17] KVM: PPC: e500: Mask ea's high 32-bits in 32/64 instr emulation Date: Wed, 4 Jul 2012 16:00:54 +0200 Message-ID: <78A34E01-4FF9-46F2-8D12-BD27AA44BC37@suse.de> References: <1340627195-11544-1-git-send-email-mihai.caraman@freescale.com> <1340627195-11544-8-git-send-email-mihai.caraman@freescale.com> Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT Cc: , , , To: Mihai Caraman Return-path: Received: from cantor2.suse.de ([195.135.220.15]:38916 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396Ab2GDOA7 convert rfc822-to-8bit (ORCPT ); Wed, 4 Jul 2012 10:00:59 -0400 In-Reply-To: <1340627195-11544-8-git-send-email-mihai.caraman@freescale.com> Sender: kvm-owner@vger.kernel.org List-ID: On 25.06.2012, at 14:26, Mihai Caraman wrote: > Mask high 32 bits of effective address in emulation layer, for guests running > in 32-bit mode. > MAS2's high-order 32 bits represents the upper 32 bits of the effective address > of the page. Mask it too for tlbwe instruction emulation. Ah, there is the tlbwe masking :). Please split this into 2 patches. > > Signed-off-by: Mihai Caraman > --- > arch/powerpc/kvm/e500_emulate.c | 5 ++++- > arch/powerpc/kvm/e500_tlb.c | 2 ++ > 2 files changed, 6 insertions(+), 1 deletions(-) > > diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c > index 81288f7..94305db 100644 > --- a/arch/powerpc/kvm/e500_emulate.c > +++ b/arch/powerpc/kvm/e500_emulate.c > @@ -1,5 +1,5 @@ > /* > - * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All rights reserved. > + * Copyright (C) 2008-2012 Freescale Semiconductor, Inc. All rights reserved. > * > * Author: Yu Liu, > * > @@ -90,6 +90,9 @@ static inline ulong kvmppc_get_ea_indexed(struct kvm_vcpu *vcpu, int ra, int rb) > if (ra) > ea += kvmppc_get_gpr(vcpu, ra); > > + if (!(vcpu->arch.shared->msr & MSR_CM)) > + ea &= 0xffffffffUL; Since this will be in generic code, please guard it with an #ifdef CONFIG_BOOKE. Alex From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx2.suse.de", Issuer "CAcert Class 3 Root" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 0E7C72C007A for ; Thu, 5 Jul 2012 00:01:02 +1000 (EST) Subject: Re: [Qemu-ppc] [RFC PATCH 07/17] KVM: PPC: e500: Mask ea's high 32-bits in 32/64 instr emulation Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <1340627195-11544-8-git-send-email-mihai.caraman@freescale.com> Date: Wed, 4 Jul 2012 16:00:54 +0200 Message-Id: <78A34E01-4FF9-46F2-8D12-BD27AA44BC37@suse.de> References: <1340627195-11544-1-git-send-email-mihai.caraman@freescale.com> <1340627195-11544-8-git-send-email-mihai.caraman@freescale.com> To: Mihai Caraman Cc: qemu-ppc@nongnu.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 25.06.2012, at 14:26, Mihai Caraman wrote: > Mask high 32 bits of effective address in emulation layer, for guests = running > in 32-bit mode. > MAS2's high-order 32 bits represents the upper 32 bits of the = effective address > of the page. Mask it too for tlbwe instruction emulation. Ah, there is the tlbwe masking :). Please split this into 2 patches. >=20 > Signed-off-by: Mihai Caraman > --- > arch/powerpc/kvm/e500_emulate.c | 5 ++++- > arch/powerpc/kvm/e500_tlb.c | 2 ++ > 2 files changed, 6 insertions(+), 1 deletions(-) >=20 > diff --git a/arch/powerpc/kvm/e500_emulate.c = b/arch/powerpc/kvm/e500_emulate.c > index 81288f7..94305db 100644 > --- a/arch/powerpc/kvm/e500_emulate.c > +++ b/arch/powerpc/kvm/e500_emulate.c > @@ -1,5 +1,5 @@ > /* > - * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All rights = reserved. > + * Copyright (C) 2008-2012 Freescale Semiconductor, Inc. All rights = reserved. > * > * Author: Yu Liu, > * > @@ -90,6 +90,9 @@ static inline ulong kvmppc_get_ea_indexed(struct = kvm_vcpu *vcpu, int ra, int rb) > if (ra) > ea +=3D kvmppc_get_gpr(vcpu, ra); >=20 > + if (!(vcpu->arch.shared->msr & MSR_CM)) > + ea &=3D 0xffffffffUL; Since this will be in generic code, please guard it with an #ifdef = CONFIG_BOOKE. Alex From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Date: Wed, 04 Jul 2012 14:00:54 +0000 Subject: Re: [Qemu-ppc] [RFC PATCH 07/17] KVM: PPC: e500: Mask ea's high 32-bits in 32/64 instr emulation Message-Id: <78A34E01-4FF9-46F2-8D12-BD27AA44BC37@suse.de> List-Id: References: <1340627195-11544-1-git-send-email-mihai.caraman@freescale.com> <1340627195-11544-8-git-send-email-mihai.caraman@freescale.com> In-Reply-To: <1340627195-11544-8-git-send-email-mihai.caraman@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Mihai Caraman Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, qemu-ppc@nongnu.org On 25.06.2012, at 14:26, Mihai Caraman wrote: > Mask high 32 bits of effective address in emulation layer, for guests running > in 32-bit mode. > MAS2's high-order 32 bits represents the upper 32 bits of the effective address > of the page. Mask it too for tlbwe instruction emulation. Ah, there is the tlbwe masking :). Please split this into 2 patches. > > Signed-off-by: Mihai Caraman > --- > arch/powerpc/kvm/e500_emulate.c | 5 ++++- > arch/powerpc/kvm/e500_tlb.c | 2 ++ > 2 files changed, 6 insertions(+), 1 deletions(-) > > diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c > index 81288f7..94305db 100644 > --- a/arch/powerpc/kvm/e500_emulate.c > +++ b/arch/powerpc/kvm/e500_emulate.c > @@ -1,5 +1,5 @@ > /* > - * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All rights reserved. > + * Copyright (C) 2008-2012 Freescale Semiconductor, Inc. All rights reserved. > * > * Author: Yu Liu, > * > @@ -90,6 +90,9 @@ static inline ulong kvmppc_get_ea_indexed(struct kvm_vcpu *vcpu, int ra, int rb) > if (ra) > ea += kvmppc_get_gpr(vcpu, ra); > > + if (!(vcpu->arch.shared->msr & MSR_CM)) > + ea &= 0xffffffffUL; Since this will be in generic code, please guard it with an #ifdef CONFIG_BOOKE. Alex