From nobody Tue Feb 10 07:21:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499087785771846.6996076959364; Mon, 3 Jul 2017 06:16:25 -0700 (PDT) Received: from localhost ([::1]:35183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS1DD-0005gH-J1 for importer@patchew.org; Mon, 03 Jul 2017 09:16:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS1C3-0004kG-Sv for qemu-devel@nongnu.org; Mon, 03 Jul 2017 09:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS1C2-0001wp-QF for qemu-devel@nongnu.org; Mon, 03 Jul 2017 09:15:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53864) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dS1C2-0001wP-Hg; Mon, 03 Jul 2017 09:15:10 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7397F80C20; Mon, 3 Jul 2017 13:15:09 +0000 (UTC) Received: from thinkpad.redhat.com (ovpn-116-196.ams2.redhat.com [10.36.116.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 368C068D8F; Mon, 3 Jul 2017 13:15:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7397F80C20 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lvivier@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7397F80C20 From: Laurent Vivier To: David Gibson Date: Mon, 3 Jul 2017 15:14:55 +0200 Message-Id: <20170703131455.25424-3-lvivier@redhat.com> In-Reply-To: <20170703131455.25424-1-lvivier@redhat.com> References: <20170703131455.25424-1-lvivier@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 03 Jul 2017 13:15:09 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC v3 2/2] target/ppc: move POWER9 DD1 workaround to ppc_cpu_initfn X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , Suraj Singh , joserz@linux.vnet.ibm.com, qemu-devel@nongnu.org, Greg Kurz , qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Sam Bobroff Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit 5f3066d ("target/ppc: Allow workarounds for POWER9 DD1") disables compatibility mode for POWER9 DD1 to allow to boot on POWER9 DD1 host with KVM. As the workaround has been added in kvmppc_host_cpu_class_init(), it applies only on CPU created with "-cpu host". As we want to be able to use also "-cpu POWER9" on a POWER9 DD1 host, this patch moves the workaround from kvmppc_host_cpu_class_init() to ppc_cpu_initfn(). Signed-off-by: Laurent Vivier --- target/ppc/kvm.c | 11 ----------- target/ppc/translate_init.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index f2f7c53..9d76817 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -2381,17 +2381,6 @@ static void kvmppc_host_cpu_class_init(ObjectClass *= oc, void *data) =20 #if defined(TARGET_PPC64) pcc->radix_page_info =3D kvm_get_radix_page_info(); - - if ((pcc->pvr & 0xffffff00) =3D=3D CPU_POWERPC_POWER9_DD1) { - /* - * POWER9 DD1 has some bugs which make it not really ISA 3.00 - * compliant. More importantly, advertising ISA 3.00 - * architected mode may prevent guests from activating - * necessary DD1 workarounds. - */ - pcc->pcr_supported &=3D ~(PCR_COMPAT_3_00 | PCR_COMPAT_2_07 - | PCR_COMPAT_2_06 | PCR_COMPAT_2_05); - } #endif /* defined(TARGET_PPC64) */ } =20 diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c index 56a0ab2..ceb5bdb 100644 --- a/target/ppc/translate_init.c +++ b/target/ppc/translate_init.c @@ -10617,6 +10617,16 @@ static void ppc_cpu_initfn(Object *obj) }; env->sps =3D (env->mmu_model & POWERPC_MMU_64K) ? defsps_64k : def= sps_4k; } + if ((pcc->pvr & 0xffffff00) =3D=3D CPU_POWERPC_POWER9_DD1) { + /* + * POWER9 DD1 has some bugs which make it not really ISA 3.00 + * compliant. More importantly, advertising ISA 3.00 + * architected mode may prevent guests from activating + * necessary DD1 workarounds. + */ + pcc->pcr_supported &=3D ~(PCR_COMPAT_3_00 | PCR_COMPAT_2_07 + | PCR_COMPAT_2_06 | PCR_COMPAT_2_05); + } #endif /* defined(TARGET_PPC64) */ =20 if (tcg_enabled()) { --=20 2.9.4