From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1as0cC-0002Yd-TA for qemu-devel@nongnu.org; Mon, 18 Apr 2016 00:16:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1as0c8-00005h-L6 for qemu-devel@nongnu.org; Mon, 18 Apr 2016 00:16:48 -0400 In-Reply-To: <20160415120613.1bbdc5d5@kryten> From: Michael Ellerman Message-Id: <3qpFFw5n3Gz9t3x@ozlabs.org> Date: Mon, 18 Apr 2016 14:16:36 +1000 (AEST) Subject: Re: [Qemu-devel] [1/3] powerpc: scan_features() updates incorrect bits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Unknown sender due to SPF , Alexey Kardashevskiy , Paul Mackerras , Benjamin Herrenschmidt , Michael Neuling , David Gibson , Alexander Graf Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Fri, 2016-15-04 at 02:06:13 UTC, Unknown sender due to SPF wrote: > The real LE feature entry in the ibm_pa_feature struct has the > wrong number of elements. Instead of checking for byte 5, bit 0, > we check for byte 0, bit 0, and we also incorrectly update cpu user > feature bit 5. > > diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c > index 7030b03..9a3a7c6 100644 > --- a/arch/powerpc/kernel/prom.c > +++ b/arch/powerpc/kernel/prom.c > @@ -158,7 +158,7 @@ static struct ibm_pa_feature { > {CPU_FTR_NOEXECUTE, 0, 0, 0, 6, 0}, > {CPU_FTR_NODSISRALIGN, 0, 0, 1, 1, 1}, > {0, MMU_FTR_CI_LARGE_PAGE, 0, 1, 2, 0}, > - {CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 5, 0, 0}, > + {CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 0, 5, 0, 0}, This should be: > + {CPU_FTR_REAL_LE, 0, PPC_FEATURE_TRUE_LE, 5, 0, 0}, Because the struct layout is: static struct ibm_pa_feature { unsigned long cpu_features; /* CPU_FTR_xxx bit */ unsigned long mmu_features; /* MMU_FTR_xxx bit */ unsigned int cpu_user_ftrs; /* PPC_FEATURE_xxx bit */ unsigned int cpu_user_ftrs2; /* PPC_FEATURE2_xxx bit */ unsigned char pabyte; /* byte number in ibm,pa-features */ unsigned char pabit; /* bit number (big-endian) */ unsigned char invert; /* if 1, pa bit set => clear feature */ } I'll fix it up locally. cheers