From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwC3a-0008TU-BP for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:50:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwC3W-0002Kp-Bs for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:50:38 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37898 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bwC3W-0002Kd-4W for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:50:34 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9HHmcBi002725 for ; Mon, 17 Oct 2016 13:50:33 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0b-001b2d01.pphosted.com with ESMTP id 264y4wd9b6-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 17 Oct 2016 13:50:33 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Oct 2016 11:50:32 -0600 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Roth In-Reply-To: <1474450935-30812-1-git-send-email-thuth@redhat.com> References: <1474450935-30812-1-git-send-email-thuth@redhat.com> Date: Mon, 17 Oct 2016 12:50:21 -0500 Message-Id: <20161017175021.16964.97878@loki> Subject: Re: [Qemu-devel] [PATCH] ppc/kvm: Mark 64kB page size support as disabled if not available List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , David Gibson , qemu-ppc@nongnu.org Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Alexander Graf , qemu-devel@nongnu.org, qemu-stable@nongnu.org Quoting Thomas Huth (2016-09-21 04:42:15) > QEMU currently refuses to start with KVM-PR and only prints out > = > qemu: fatal: Unknown MMU model 851972 > = > when being started there. This is because commit 4322e8ced5aaac719 > ("ppc: Fix 64K pages support in full emulation") introduced a new > POWERPC_MMU_64K bit to indicate support for this page size, but > it never gets cleared on KVM-PR if the host kernel does not support > this. Thus we've got to turn off this bit in the mmu_model for KVM-PR. > = > Signed-off-by: Thomas Huth Cc'ing qemu-stable > --- > target-ppc/kvm.c | 7 +++++++ > 1 file changed, 7 insertions(+) > = > diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c > index dcb68b9..6bdc804 100644 > --- a/target-ppc/kvm.c > +++ b/target-ppc/kvm.c > @@ -427,6 +427,7 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu) > CPUPPCState *env =3D &cpu->env; > long rampagesize; > int iq, ik, jq, jk; > + bool has_64k_pages =3D false; > = > /* We only handle page sizes for 64-bit server guests for now */ > if (!(env->mmu_model & POWERPC_MMU_64)) { > @@ -470,6 +471,9 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu) > ksps->enc[jk].page_shift)) { > continue; > } > + if (ksps->enc[jk].page_shift =3D=3D 16) { > + has_64k_pages =3D true; > + } > qsps->enc[jq].page_shift =3D ksps->enc[jk].page_shift; > qsps->enc[jq].pte_enc =3D ksps->enc[jk].pte_enc; > if (++jq >=3D PPC_PAGE_SIZES_MAX_SZ) { > @@ -484,6 +488,9 @@ static void kvm_fixup_page_sizes(PowerPCCPU *cpu) > if (!(smmu_info.flags & KVM_PPC_1T_SEGMENTS)) { > env->mmu_model &=3D ~POWERPC_MMU_1TSEG; > } > + if (!has_64k_pages) { > + env->mmu_model &=3D ~POWERPC_MMU_64K; > + } > } > #else /* defined (TARGET_PPC64) */ > = > -- = > 1.8.3.1 > = >=20