From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKZDh-0001C0-2F for qemu-devel@nongnu.org; Sat, 06 Oct 2012 14:35:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKZDf-0006e5-Cx for qemu-devel@nongnu.org; Sat, 06 Oct 2012 14:35:24 -0400 Date: Sat, 6 Oct 2012 20:35:12 +0200 From: Aurelien Jarno Message-ID: <20121006183512.GL4623@ohm.aurel32.net> References: <1349404606-24057-1-git-send-email-agraf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1349404606-24057-1-git-send-email-agraf@suse.de> Subject: Re: [Qemu-devel] [PATCH] PPC: KVM: Fix BAT put List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: "qemu-ppc@nongnu.org List" , qemu-devel qemu-devel On Fri, Oct 05, 2012 at 04:36:46AM +0200, Alexander Graf wrote: > In the sregs API, upper and lower 32bit segments of the BAT registers > are swapped when doing a set. Since we need to support old kernels out > there, don't bother to fix it in the kernel, but instead work around > the problem in QEMU by swapping on put. > > Signed-off-by: Alexander Graf > --- > target-ppc/kvm.c | 9 +++++---- > 1 files changed, 5 insertions(+), 4 deletions(-) > > diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c > index 1975323..93c5bb7 100644 > --- a/target-ppc/kvm.c > +++ b/target-ppc/kvm.c > @@ -493,10 +493,11 @@ int kvm_arch_put_registers(CPUPPCState *env, int level) > > /* Sync BATs */ > for (i = 0; i < 8; i++) { > - sregs.u.s.ppc32.dbat[i] = ((uint64_t)env->DBAT[1][i] << 32) > - | env->DBAT[0][i]; > - sregs.u.s.ppc32.ibat[i] = ((uint64_t)env->IBAT[1][i] << 32) > - | env->IBAT[0][i]; > + /* Beware. We have to swap upper and lower bits here */ > + sregs.u.s.ppc32.dbat[i] = ((uint64_t)env->DBAT[0][i] << 32) > + | env->DBAT[1][i]; > + sregs.u.s.ppc32.ibat[i] = ((uint64_t)env->IBAT[0][i] << 32) > + | env->IBAT[1][i]; > } > > ret = kvm_vcpu_ioctl(env, KVM_SET_SREGS, &sregs); Applied (actually as part of the PPC pull). -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net