From nobody Sat Nov 23 23:17:43 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=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1730679978; cv=none; d=zohomail.com; s=zohoarc; b=kohO3ZYBJqX5QqooO3gYJfs42hKxCCOy7tKkUnue/jHIZBcepRWV+tmBqShjDB0/acuj2uQbnuoiKNQxkmVPFL3KP89XekMLbJZw1Y6ypKTRE70GO2ABXyO25THfp8dHBizQi+1/E3v/GUQEu5y5QErBydjAb1MPVUACFfJFv6w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730679978; h=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=u3pa1qIAf5Pto6BGGrw30p+Tnm3/DG2zMWLpFWSye10=; b=nPLMr4Xvf7q42agj/8wXJMuCcKegY4qtZmV5mmPEYGB0QlLM9F4qsSPpl0hkbdLerk4/EbjTFs0JlBFwwM39kU7E5TaM8dbm2dYsM839s+KwtQzQkAxlrkEpv6QiTFVcVDYwPqxUPAiGRS4P9tFQ4Vn2qr2ItIJmj5CxnkYWo3Q= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17306799787131015.8761395021314; Sun, 3 Nov 2024 16:26:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7kqG-00026Z-QV; Sun, 03 Nov 2024 19:21:12 -0500 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 1t7kqD-0001rV-OK; Sun, 03 Nov 2024 19:21:09 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7kqC-0002fI-4J; Sun, 03 Nov 2024 19:21:09 -0500 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-71ec997ad06so2939425b3a.3; Sun, 03 Nov 2024 16:21:07 -0800 (PST) Received: from wheely.local0.net (124-171-217-17.tpgi.com.au. [124.171.217.17]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ee45a0081esm5900648a12.59.2024.11.03.16.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Nov 2024 16:21:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730679666; x=1731284466; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=u3pa1qIAf5Pto6BGGrw30p+Tnm3/DG2zMWLpFWSye10=; b=XX3erpPobRwA5Ye1LPsZdWC2IYEmPwHoawyZR1aqgo12NTIzpEqoClQVyxR72pS7R5 B+6O3qRhc765pbBOJWxTEPzpmU8Gtxb1LV9fMq2Mx/+lRSFUT9UDE8us0NfQYZnqikyQ FhmNObTbZmXXg2nDmMSRjPtL69AS8K6c9yPiiUYBzTm84unSA7QhWdyPgQs9oj25nlpq h6zO2yzNgab3CORxxDzN5xmSfMyYsteWQRVu6nQ2GA5EghAeOls//5kmUG4fXbOty5wd wjEfA6QBZ2am4h8wFJEXHmGtzeG/1VGw1h22Z7sPqpHfgyaFTk0wwYmDUJzhECcN8U6l AJIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730679666; x=1731284466; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u3pa1qIAf5Pto6BGGrw30p+Tnm3/DG2zMWLpFWSye10=; b=inVrDY1m9HI0TbyxJvYYB78YIRzMim/vQ+8ZG9IJLmCUiRdgLmZywAV0VIxPmP/MH1 9jwPk4wW6SHzNbDZkAB7XKIFSZCp83HstmBZBzzP4YSigrm4pG2uRhWz8iCefYztB96x HPmD42OfGgk2Q1dIxOzEi87Wx6qE7aPzmGnGyTMBPsOelWRPB4SYdP1sxktVhBigAP0n H085NmfBYqrZ2YP2siaHW5qyd3vnV2G+jKB0C/HvYre7hpmKXZtWihC890t0Kllk/zkZ c5uqIOadU/lkUvxbCcLHN8q9yHiNwRA6P3DiAVw1SKvg53c2MrpZx7S567jdExkPsGM2 U9jw== X-Forwarded-Encrypted: i=1; AJvYcCWYPTByga8uMIQVVICiatHeF+3401IF0GmO/YzPIe1IfapY8L1zICcMhMNb2N8SkO06meqyMfTSLw==@nongnu.org X-Gm-Message-State: AOJu0Yw8isFfAJAhE0a++QrLundCqFwHgcn4IadTtnE8HUeXfVhZVzfG OnrDaqqwMMxq5zvCeWzsKd6IDVAkKEryrPQ4LKFE4IMpDI6o7X8Zo7YfAg== X-Google-Smtp-Source: AGHT+IET1csJaGF2C0ZH+VPDc3vWD4I1j/hmk/cc23QpAKmN6gkK5HDH4+nBNDiLRESCaEpmCSjOMg== X-Received: by 2002:a05:6a00:331b:b0:721:19bc:4bf4 with SMTP id d2e1a72fcca58-72119bc986cmr5677850b3a.23.1730679665811; Sun, 03 Nov 2024 16:21:05 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, Aditya Gupta , Amit Machhiwal Subject: [PULL 31/67] target/ppc: Introduce 'PowerPCCPUClass::spapr_logical_pvr' Date: Mon, 4 Nov 2024 10:18:20 +1000 Message-ID: <20241104001900.682660-32-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241104001900.682660-1-npiggin@gmail.com> References: <20241104001900.682660-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2607:f8b0:4864:20::42d; envelope-from=npiggin@gmail.com; helo=mail-pf1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 @gmail.com) X-ZM-MESSAGEID: 1730679980168116600 Content-Type: text/plain; charset="utf-8" From: Aditya Gupta 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. Reviewed-by: Nicholas Piggin Signed-off-by: Aditya Gupta Tested-by: Amit Machhiwal Signed-off-by: Nicholas Piggin --- 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 b838bc2ab9..daa12f8733 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1473,6 +1473,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 7c3716b56f..bc8ec77fa0 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