From nobody Sun Nov 24 16:08:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1722405111; cv=none; d=zohomail.com; s=zohoarc; b=AYbl7e8nQ6I7iNAUx05vxrhbr7QplS4moBpOUw7xnV+HVwajEaYayAzMKKQ9jKai4+16POg00qJJtqHslk8/10Q3ZX/QkNUCzYL/I9f4HClVyI1MWWC606i02iXtZPrYosDo3V1fCHx9mDW1QW3f9o1vvpsw+19Onc9EkCIGKck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722405111; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IVOz0PUC7UK9mIwBCQ10IVcoyQIdfoGIptTF86r7v7U=; b=eTILX7uiYh/qlQUicjRCa1QNMeXgtDQ97dZsL5Je3eUDo3wm9ZSVjp582KlRQwSxmfUqUW4GKj3o5GWRVt8esKrIb8+at4Gj2C/9udNTySPg4l+TvgEc1cckLnfBT86TBqUoBxaPQCDFhf7nZyjy4Iq5ytl2qNMPAtWZsNUwn7U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722405111629916.4735646808895; Tue, 30 Jul 2024 22:51:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZ2Ed-0002n0-3N; Wed, 31 Jul 2024 01:50:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ2Eb-0002kf-AX; Wed, 31 Jul 2024 01:50:49 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZ2EZ-0007NU-Hy; Wed, 31 Jul 2024 01:50:49 -0400 Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46V2x2w6007927; Wed, 31 Jul 2024 05:50:37 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 40qcy18ajm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 05:50:37 +0000 (GMT) Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 46V5oatb001903; Wed, 31 Jul 2024 05:50:36 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 40qcy18ajf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 05:50:36 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 46V2Lc2B011133; Wed, 31 Jul 2024 05:50:35 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 40ncqmshs1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 Jul 2024 05:50:35 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 46V5oThr51577336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Jul 2024 05:50:31 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BEB3820043; Wed, 31 Jul 2024 05:50:29 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 08E7820040; Wed, 31 Jul 2024 05:50:28 +0000 (GMT) Received: from li-3c92a0cc-27cf-11b2-a85c-b804d9ca68fa.in.ibm.com (unknown [9.109.199.72]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 31 Jul 2024 05:50:27 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=pp1; bh= IVOz0PUC7UK9mIwBCQ10IVcoyQIdfoGIptTF86r7v7U=; b=fpeVvfQ+TlteR8w6 8LI2MgH9yialpcWuEdngi4qoEp8blgWhqHBpmVFzbiVqxM2G2hZNA0680I+PtajJ zPyppoRcukRZCjCQncUv3277DeJ5PPsI8kQsyLCv48ZYqWng1yJINWzoJtfiKDQu hW1kxBsXHJqNYNItTGcayJAIgLFj59LmvIc9WDDbOe0BUAInwUrLtZb1vctkvIDq b5FRUtWTK7xO38vpxAf85pgDAkfz0ICeEjSofLQ2v7xa8L/LNpE0GdugTKUB8z8Q nD5+X3LOj2HuRUZe/XVZQdO1/UEJWb/HeyIFpGehZ6Da0n6EhbY4zo82/9SrqT+Q K6lXtg== From: Aditya Gupta To: Mahesh J Salgaonkar , Madhavan Srinivasan , Nicholas Piggin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora Cc: , , Daniel Henrique Barboza Subject: [PATCH v6 RESEND 2/5] target/ppc: Introduce 'PowerPCCPUClass::spapr_logical_pvr' Date: Wed, 31 Jul 2024 11:20:19 +0530 Message-ID: <20240731055022.696051-3-adityag@linux.ibm.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731055022.696051-1-adityag@linux.ibm.com> References: <20240731055022.696051-1-adityag@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: pOT5LvlL9QDI8M1LQ60buGPrFrqNWj88 X-Proofpoint-ORIG-GUID: NXoJVBYR6iyw_r89y9nZq8Vviri2xT13 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-31_02,2024-07-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 priorityscore=1501 bulkscore=0 adultscore=0 suspectscore=0 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2407310039 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; Received-SPF: pass client-ip=148.163.156.1; envelope-from=adityag@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1722405112224116600 Introduce 'PnvChipClass::spapr_logical_pvr' to know corresponding logical PVR of a PowerPC CPU. This helps to have a one-to-one mapping between PVR and logical PVR for a CPU, and used in a later commit to handle cases where PCR of two generations of Power chip is same, which causes regressions with compat-mode. Cc: C=C3=A9dric Le Goater Cc: Daniel Henrique Barboza Cc: Harsh Prateek Bora Cc: Mahesh J Salgaonkar Cc: Madhavan Srinivasan Cc: Nicholas Piggin Reviewed-by: Nicholas Piggin Signed-off-by: Aditya Gupta --- target/ppc/cpu.h | 1 + target/ppc/cpu_init.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 321ed2da75b7..752e11204b35 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1482,6 +1482,7 @@ struct PowerPCCPUClass { void (*parent_parse_features)(const char *type, char *str, Error **err= p); =20 uint32_t pvr; + uint32_t spapr_logical_pvr; /* * If @best is false, match if pcc is in the family of pvr * Else match only if pcc is the best match for pvr in this family. diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 4c7368cfaeb5..c5cd4133ea2f 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -6154,6 +6154,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) =20 dc->fw_name =3D "PowerPC,POWER7"; dc->desc =3D "POWER7"; + pcc->spapr_logical_pvr =3D CPU_POWERPC_LOGICAL_2_06_PLUS; 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; @@ -6317,6 +6318,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) =20 dc->fw_name =3D "PowerPC,POWER8"; dc->desc =3D "POWER8"; + pcc->spapr_logical_pvr =3D CPU_POWERPC_LOGICAL_2_07; 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; @@ -6510,6 +6512,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) =20 dc->fw_name =3D "PowerPC,POWER9"; dc->desc =3D "POWER9"; + pcc->spapr_logical_pvr =3D CPU_POWERPC_LOGICAL_3_00; pcc->pvr_match =3D ppc_pvr_match_power9; pcc->pcr_mask =3D PPC_PCR_MASK_POWER9; pcc->pcr_supported =3D PPC_PCR_SUPPORTED_POWER9; @@ -6644,6 +6647,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) =20 dc->fw_name =3D "PowerPC,POWER10"; dc->desc =3D "POWER10"; + pcc->spapr_logical_pvr =3D CPU_POWERPC_LOGICAL_3_10; pcc->pvr_match =3D ppc_pvr_match_power10; pcc->pcr_mask =3D PPC_PCR_MASK_POWER10; pcc->pcr_supported =3D PPC_PCR_SUPPORTED_POWER10; --=20 2.45.2