From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bs7Oc-0004PQ-34 for qemu-devel@nongnu.org; Thu, 06 Oct 2016 08:03:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bs7OY-0007UK-7H for qemu-devel@nongnu.org; Thu, 06 Oct 2016 08:03:29 -0400 From: David Gibson Date: Thu, 6 Oct 2016 23:02:51 +1100 Message-Id: <1475755395-27307-6-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1475755395-27307-1-git-send-email-david@gibson.dropbear.id.au> References: <1475755395-27307-1-git-send-email-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 05/29] hw/ppc/spapr: Fix the selection of the processor features List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: agraf@suse.de, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Thomas Huth , David Gibson From: Thomas Huth The current code uses pa_features_206 for POWERPC_MMU_2_06, and for everything else, it uses pa_features_207. This is bad in some cases because there is also a "degraded" MMU version of ISA 2.06, called POWERPC_MMU_2_06a, which should of course use the flags for 2.06 instead. And there is also the possibility that the user runs the pseries machine with a POWER5+ or even 970 processor. In that case we certainly do not want to set the flags for 2.07, and rather simply skip the setting of the pa-features property instead. Signed-off-by: Thomas Huth Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: David Gibson --- hw/ppc/spapr.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 8048f92..8654108 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -559,12 +559,19 @@ static void spapr_populate_pa_features(CPUPPCState = *env, void *fdt, int offset) uint8_t *pa_features; size_t pa_size; =20 - if (env->mmu_model =3D=3D POWERPC_MMU_2_06) { + switch (env->mmu_model) { + case POWERPC_MMU_2_06: + case POWERPC_MMU_2_06a: pa_features =3D pa_features_206; pa_size =3D sizeof(pa_features_206); - } else { /* env->mmu_model =3D=3D POWERPC_MMU_2_07 */ + break; + case POWERPC_MMU_2_07: + case POWERPC_MMU_2_07a: pa_features =3D pa_features_207; pa_size =3D sizeof(pa_features_207); + break; + default: + return; } =20 if (env->ci_large_pages) { --=20 2.7.4