From nobody Thu Nov 13 20:44:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1582743646; cv=none; d=zohomail.com; s=zohoarc; b=bRDpOQ2iDDBBYz51PlSve38WLJ9NMZ+TgznoripBbQJFgqC/vZbKyTE+PId0osM18gsDH6ytfAlXZkfk8bgZ9gUJtfyMojxbW62Ab6xHMmQTdLBACYMaDk8eiqqExhUkNeT2u2pSCQGh4hawTrgpRRq+oTsPjxahKUB4EHXMAoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582743646; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=nlNrr96phCGP5T5UL/R94mDPwi00bbYBkqCV8G1LHXI=; b=VUyksrkUnbKy6u7UejOxgcG5QUiWxEioVHoUG4/yVNoHMnz7hDdguSo+bOCXDB2KQ7OsEcik8eWGlkeMzXWccOIPtDm0pXfjrLl6a2Vb+Ql5jIMfmpDfcRmfEGjRJBZB6d7AkitGCu1l4QXSRBbPmKp4BcJjAYBxXRpnfysfYeY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582743646499931.3305822405808; Wed, 26 Feb 2020 11:00:46 -0800 (PST) Received: from localhost ([::1]:48840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j71vI-0003SD-4O for importer@patchew.org; Wed, 26 Feb 2020 14:00:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39201) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j71uR-0002w4-HF for qemu-devel@nongnu.org; Wed, 26 Feb 2020 13:59:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j71uP-0007e6-4s for qemu-devel@nongnu.org; Wed, 26 Feb 2020 13:59:51 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:30132) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j71uO-0007bF-Sw for qemu-devel@nongnu.org; Wed, 26 Feb 2020 13:59:49 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01QIoqoJ038384 for ; Wed, 26 Feb 2020 13:59:47 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ydq6wh07n-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 26 Feb 2020 13:59:46 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 26 Feb 2020 18:59:44 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 26 Feb 2020 18:59:41 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01QIxftw48824424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Feb 2020 18:59:41 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 020624C044; Wed, 26 Feb 2020 18:59:41 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71DAB4C04A; Wed, 26 Feb 2020 18:59:40 +0000 (GMT) Received: from bahia.lan (unknown [9.145.89.213]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 26 Feb 2020 18:59:40 +0000 (GMT) Subject: [PATCH] ppc: Officially deprecate the CPU "compat" property From: Greg Kurz To: David Gibson Date: Wed, 26 Feb 2020 19:59:38 +0100 User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20022618-0020-0000-0000-000003ADDDEF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20022618-0021-0000-0000-00002205F9FC Message-Id: <158274357799.140275.12263135811731647490.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-26_07:2020-02-26, 2020-02-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=999 clxscore=1034 mlxscore=0 adultscore=0 impostorscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002260118 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Server class POWER CPUs have a "compat" property, which was obsoleted by commit 7843c0d60d and replaced by a "max-cpu-compat" property on the pseries machine type. A hack was introduced so that passing "compat" to -cpu would still produce the desired effect, for the sake of backward compatibility : it strips the "compat" option from the CPU properties and applies internally it to the pseries machine. The accessors of the "compat" property were updated to do nothing but warn the user about the deprecated status when doing something like: $ qemu-system-ppc64 -global POWER9-family-powerpc64-cpu.compat=3Dpower9 qemu-system-ppc64: warning: CPU 'compat' property is deprecated and has no effect; use max-cpu-compat machine property instead This was merged during the QEMU 2.10 timeframe, a few weeks before we formalized our deprecation process. As a consequence, the "compat" property fell through the cracks and was never listed in the officialy deprecated features. We are now eight QEMU versions later, it is largely time to mention it in qemu-deprecated.texi. Also, since -global XXX-powerpc64-cpu.compat=3D has been emitting warnings since QEMU 2.10 and the usual way of setting CPU properties is with -cpu, completely remove the "compat" property. Keep the hack so that -cpu XXX,compat=3D stays functional some more time, as required by our deprecation process. The now empty powerpc_servercpu_properties[] list which was introduced for "compat" and never had any other use is removed on the way. We can re-add it in the future if the need for a server class POWER CPU specific property arises again. Signed-off-by: Greg Kurz --- qemu-deprecated.texi | 6 +++++ target/ppc/translate_init.inc.c | 44 ++---------------------------------= ---- 2 files changed, 8 insertions(+), 42 deletions(-) diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 66eca3a1dede..56a69400c14a 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -242,6 +242,12 @@ The RISC-V no MMU cpus have been depcreated. The two C= PUs: ``rv32imacu-nommu`` a ``rv64imacu-nommu`` should no longer be used. Instead the MMU status can b= e specified via the CPU ``mmu`` option when using the ``rv32`` or ``rv64`` CPUs. =20 +@subsection ``compat`` property of server class POWER CPUs (since 5.0) + +The ``compat`` property used to set backwards compatibility modes for +the processor has been deprecated. The ``max-cpu-compat`` property of +the ``pseries`` machine type should be used instead. + @section System emulator devices =20 @subsection ide-drive (since 4.2) diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.in= c.c index 53995f62eab2..2f7125c51f35 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -8492,44 +8492,6 @@ POWERPC_FAMILY(POWER5P)(ObjectClass *oc, void *data) pcc->l1_icache_size =3D 0x10000; } =20 -/* - * The CPU used to have a "compat" property which set the - * compatibility mode PVR. However, this was conceptually broken - it - * only makes sense on the pseries machine type (otherwise the guest - * owns the PCR and can control the compatibility mode itself). It's - * been replaced with the 'max-cpu-compat' property on the pseries - * machine type. For backwards compatibility, pseries specially - * parses the -cpu parameter and converts old compat=3D parameters into - * the appropriate machine parameters. This stub implementation of - * the parameter catches any uses on explicitly created CPUs. - */ -static void getset_compat_deprecated(Object *obj, Visitor *v, const char *= name, - void *opaque, Error **errp) -{ - QNull *null =3D NULL; - - if (!qtest_enabled()) { - warn_report("CPU 'compat' property is deprecated and has no effect= ; " - "use max-cpu-compat machine property instead"); - } - visit_type_null(v, name, &null, NULL); - qobject_unref(null); -} - -static const PropertyInfo ppc_compat_deprecated_propinfo =3D { - .name =3D "str", - .description =3D "compatibility mode (deprecated)", - .get =3D getset_compat_deprecated, - .set =3D getset_compat_deprecated, -}; -static Property powerpc_servercpu_properties[] =3D { - { - .name =3D "compat", - .info =3D &ppc_compat_deprecated_propinfo, - }, - DEFINE_PROP_END_OF_LIST(), -}; - static void init_proc_POWER7(CPUPPCState *env) { /* Common Registers */ @@ -8611,7 +8573,6 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) =20 dc->fw_name =3D "PowerPC,POWER7"; dc->desc =3D "POWER7"; - device_class_set_props(dc, powerpc_servercpu_properties); pcc->pvr_match =3D ppc_pvr_match_power7; pcc->pcr_mask =3D PCR_VEC_DIS | PCR_VSX_DIS | PCR_COMPAT_2_05; pcc->pcr_supported =3D PCR_COMPAT_2_06 | PCR_COMPAT_2_05; @@ -8776,7 +8737,6 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) =20 dc->fw_name =3D "PowerPC,POWER8"; dc->desc =3D "POWER8"; - device_class_set_props(dc, powerpc_servercpu_properties); pcc->pvr_match =3D ppc_pvr_match_power8; pcc->pcr_mask =3D PCR_TM_DIS | PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->pcr_supported =3D PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | PCR_COMPAT_= 2_05; @@ -8988,7 +8948,6 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) =20 dc->fw_name =3D "PowerPC,POWER9"; dc->desc =3D "POWER9"; - device_class_set_props(dc, powerpc_servercpu_properties); pcc->pvr_match =3D ppc_pvr_match_power9; pcc->pcr_mask =3D PCR_COMPAT_2_05 | PCR_COMPAT_2_06 | PCR_COMPAT_2_07; pcc->pcr_supported =3D PCR_COMPAT_3_00 | PCR_COMPAT_2_07 | PCR_COMPAT_= 2_06 | @@ -9198,7 +9157,6 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) =20 dc->fw_name =3D "PowerPC,POWER10"; dc->desc =3D "POWER10"; - device_class_set_props(dc, powerpc_servercpu_properties); pcc->pvr_match =3D ppc_pvr_match_power10; pcc->pcr_mask =3D PCR_COMPAT_2_05 | PCR_COMPAT_2_06 | PCR_COMPAT_2_07 | PCR_COMPAT_3_00; @@ -10486,6 +10444,8 @@ static void ppc_cpu_parse_featurestr(const char *ty= pe, char *features, *s =3D '\0'; for (i =3D 0; inpieces[i]; i++) { if (g_str_has_prefix(inpieces[i], "compat=3D")) { + warn_report_once("CPU 'compat' property is deprecated; " + "use max-cpu-compat machine property instead"); compat_str =3D inpieces[i]; continue; }