From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Date: Tue, 01 Sep 2015 22:25:05 +0000 Subject: Re: [PATCH] KVM: ppc: Fix size of the PSPB register Message-Id: <1441146305.2668.51.camel@au1.ibm.com> List-Id: References: <1441143678-14295-1-git-send-email-thuth@redhat.com> In-Reply-To: <1441143678-14295-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Thomas Huth , kvm-ppc@vger.kernel.org, Alexander Graf , Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org On Tue, 2015-09-01 at 23:41 +0200, Thomas Huth wrote: > The size of the Problem State Priority Boost Register is only > 32 bits, so let's change the type of the corresponding variable > accordingly to avoid future trouble. It's not future trouble, it's broken today for LE and this should fix it BUT .... The asm accesses it using lwz/stw and C accesses it as a ulong. On LE that will mean that userspace will see the value << 32 Now "fixing" it might break migration if that field is already stored/loaded in its "broken" form. We may have to keep the "broken" behaviour and document that qemu sees a value shifted by 32. Cheers, Ben. > Signed-off-by: Thomas Huth > --- > arch/powerpc/include/asm/kvm_host.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/include/asm/kvm_host.h > b/arch/powerpc/include/asm/kvm_host.h > index d91f65b..c825f3a 100644 > --- a/arch/powerpc/include/asm/kvm_host.h > +++ b/arch/powerpc/include/asm/kvm_host.h > @@ -473,7 +473,7 @@ struct kvm_vcpu_arch { > ulong ciabr; > ulong cfar; > ulong ppr; > - ulong pspb; > + u32 pspb; > ulong fscr; > ulong shadow_fscr; > ulong ebbhr;