From patchwork Tue Jul 4 05:42:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 13300667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF966EB64DA for ; Tue, 4 Jul 2023 05:43:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGYo9-0003U5-G1; Tue, 04 Jul 2023 01:42:39 -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 1qGYnx-0003PZ-MU; Tue, 04 Jul 2023 01:42:26 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGYns-00045S-Rr; Tue, 04 Jul 2023 01:42:23 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1b8033987baso31214055ad.0; Mon, 03 Jul 2023 22:42:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688449338; x=1691041338; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Q7eoUd+iblNvNzIFTkrpWth12Z0eS/m6oGNV7VBXjms=; b=FtS3Mme61xbr9JohVKHc8tXV6o9aM949Yx+RRakjCPugcDeFzuWa/ZTfeL+O9AOxhS BsLyl9YBzcH18Vw3rc1mhucBIZGJRm8/N/cjsVoSvGAkaktitTKsH1fm4AffxnHtmEp1 0sc87VfyuLcw+EKvvXf9qGavOf8NlrMfMRkcVmtLHprb8dmxPtvJ0QlBma5Qvg136GNA Ifm19qPCMDgkS1VHFo5ev4Bp9aEyV3mRrdpczTF6wLhAEWVYJCAQ8SIIROCtRLG+wbAO nVYtlJSE45t1Y2Ms2d9iteWGrzKq9gU8YdJIvlV5m5UySOH1sf189CNNotdVEgIKaE/t jy0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688449338; x=1691041338; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Q7eoUd+iblNvNzIFTkrpWth12Z0eS/m6oGNV7VBXjms=; b=LdbjzCxtPuNtouyMTtscIvPCk+p2MkC0MjnxFOW/tJ8gLLvE1MLk/+3R09t9OxgV+C o5ryd8EpFdUiV67geXm4Od8oUDb3pyjRRGcWLC/tz7fHK3CwpJl7chr+QWkMXGn4ozPU hp4g70KtaNN689kHti8oIlkIsZQ67aOg5J8+t/2TRZfGct81ieo8KMmMpw0n1r3hmb7B /ltKE7FSq/Et9iDvYelez126OFW1TQmkJmATQ9YseYCmEslVGYFw6Dmp8j101oO3iPH1 7Z2pjariypEBZbDcfxwWQj99pD9xHNxFznlquTQ2hLuTYsNFS/nIxUZG7Ksd8ysx2IVN sWeQ== X-Gm-Message-State: ABy/qLZCnjLjTQDFBhSSzPFw/UHWjDU0pNNQFBygQb15mGssjH2QnaRQ SFSVTMZPoN3nngYOuR5nf4U= X-Google-Smtp-Source: APBJJlHEU6nTRQrnvWwkgQDEBPInw5K7GA3+PYa2S3cH4hhgDmtt3rOL35smoHU6ShPeJr7Jyy56qg== X-Received: by 2002:a17:902:d4ca:b0:1b8:224f:e823 with SMTP id o10-20020a170902d4ca00b001b8224fe823mr19794904plg.7.1688449338529; Mon, 03 Jul 2023 22:42:18 -0700 (PDT) Received: from localhost.localdomain (2403-5808-8af8-0-7926-51ea-3ff2-71dd.ip6.aussiebb.net. [2403:5808:8af8:0:7926:51ea:3ff2:71dd]) by smtp.gmail.com with ESMTPSA id q9-20020a17090311c900b001ae59169f05sm16261879plh.182.2023.07.03.22.42.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 22:42:17 -0700 (PDT) From: Joel Stanley To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Nicholas Piggin , =?utf-8?b?RnLDqWTDqXJpYyBCYXJyYXQ=?= Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v2 1/5] ppc/pnv: quad xscom callbacks are P9 specific Date: Tue, 4 Jul 2023 15:12:00 +0930 Message-Id: <20230704054204.168547-2-joel@jms.id.au> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230704054204.168547-1-joel@jms.id.au> References: <20230704054204.168547-1-joel@jms.id.au> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=joel.stan@gmail.com; helo=mail-pl1-x635.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Rename the functions to include P9 in the name in preparation for adding P10 versions. Correct the unimp read message while we're changing the function. Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley Reviewed-by: Frederic Barrat --- v2: Fix unimp print, and grammar in the commit message --- hw/ppc/pnv_core.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c index 0bc3ad41c81c..0f451b3b6e1f 100644 --- a/hw/ppc/pnv_core.c +++ b/hw/ppc/pnv_core.c @@ -360,8 +360,8 @@ DEFINE_TYPES(pnv_core_infos) #define P9X_EX_NCU_SPEC_BAR 0x11010 -static uint64_t pnv_quad_xscom_read(void *opaque, hwaddr addr, - unsigned int width) +static uint64_t pnv_quad_power9_xscom_read(void *opaque, hwaddr addr, + unsigned int width) { uint32_t offset = addr >> 3; uint64_t val = -1; @@ -372,15 +372,15 @@ static uint64_t pnv_quad_xscom_read(void *opaque, hwaddr addr, val = 0; break; default: - qemu_log_mask(LOG_UNIMP, "%s: writing @0x%08x\n", __func__, + qemu_log_mask(LOG_UNIMP, "%s: reading @0x%08x\n", __func__, offset); } return val; } -static void pnv_quad_xscom_write(void *opaque, hwaddr addr, uint64_t val, - unsigned int width) +static void pnv_quad_power9_xscom_write(void *opaque, hwaddr addr, uint64_t val, + unsigned int width) { uint32_t offset = addr >> 3; @@ -394,9 +394,9 @@ static void pnv_quad_xscom_write(void *opaque, hwaddr addr, uint64_t val, } } -static const MemoryRegionOps pnv_quad_xscom_ops = { - .read = pnv_quad_xscom_read, - .write = pnv_quad_xscom_write, +static const MemoryRegionOps pnv_quad_power9_xscom_ops = { + .read = pnv_quad_power9_xscom_read, + .write = pnv_quad_power9_xscom_write, .valid.min_access_size = 8, .valid.max_access_size = 8, .impl.min_access_size = 8, @@ -410,7 +410,8 @@ static void pnv_quad_realize(DeviceState *dev, Error **errp) char name[32]; snprintf(name, sizeof(name), "xscom-quad.%d", eq->quad_id); - pnv_xscom_region_init(&eq->xscom_regs, OBJECT(dev), &pnv_quad_xscom_ops, + pnv_xscom_region_init(&eq->xscom_regs, OBJECT(dev), + &pnv_quad_power9_xscom_ops, eq, name, PNV9_XSCOM_EQ_SIZE); } From patchwork Tue Jul 4 05:42:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 13300669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A55DEEB64D9 for ; Tue, 4 Jul 2023 05:43:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGYo4-0003T8-8E; Tue, 04 Jul 2023 01:42:32 -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 1qGYo0-0003Q3-8Q; Tue, 04 Jul 2023 01:42:28 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGYnw-00046Y-Cy; Tue, 04 Jul 2023 01:42:27 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1b82bf265b2so23517485ad.0; Mon, 03 Jul 2023 22:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688449342; x=1691041342; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=f01K8TPirXj02TiUU43o+gRSEIiFUJd37Q1MfjPfulk=; b=OpA1U/+yo7sCPiBxV7f0adQ++Be7/HNTEkikz0wQELdBET0DCgN0QlnEyKtL9y8Bei ktBrPIMsKC53GYyJ5wHRgpR67Fz+shKlU51+GoLB/6VdqT1/lfuAnYx4G/DA08fFjDiW rEbPFSogRNU1Y++l8DK90beDCvDSt1WwaGjZ5A9ygInO5y+387K0FVGov9gi22goPvAO jDz4Fr6y2Mgz+QCn1gBLbBan6pfPUiNTBI5bxN31D2hrwWm8K3mIpEUbBcNw7tvfsRE5 TZmuKwbkwuYQmTWl/YuL8skfI4qE3foxRc/ZKfh5Qa/owXa1nob2f6stYu4dAISaH459 yqTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688449342; x=1691041342; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=f01K8TPirXj02TiUU43o+gRSEIiFUJd37Q1MfjPfulk=; b=SBhT7QtSC//UnKbsXxk+z6QENoiKDLDY/NClZ4vZgaTeYsVRhHlHIBSV90satfX4S9 5ehomqyfBQyF1atoLJXMpd7XLnJHLfHWNzahCw5aEMNCKfD1u6YAYX9dr4iwUOj7o9Wk R6I6Np+Tm+UE4HHt41huJz1GgMtsNqLujmIDO6MvVxHD3b9oDIVotTMy2b6E6qP59GXm 03k799R4pxHx5aFbaUSE6QBD+ueCaGAU1DNTSsU0NBiWxB+lvuLrsq/sWv62bU+HPvke KoJNKr9Lx4TFQ+r2yBUCYrxoOMKX/7s83/VYCqp35kg7RTO6rg1WDBirGcwtJwaiR359 sAwQ== X-Gm-Message-State: ABy/qLY4GfukxhpgS3IqvcmWK+bR/5AyNQ9Vmp3YjMynswh9rnlhoJB3 f5zh8OhuQEqsGNHKEbz/c3s= X-Google-Smtp-Source: APBJJlEHlVCTmTF+bgtWdnnTCrc8fYjUXGcbzb/xiok/GQtEtaqH+GSyN1eejPzjg1OqNtHi5jiKEg== X-Received: by 2002:a17:902:7245:b0:1b5:253f:d05f with SMTP id c5-20020a170902724500b001b5253fd05fmr8341763pll.29.1688449341912; Mon, 03 Jul 2023 22:42:21 -0700 (PDT) Received: from localhost.localdomain (2403-5808-8af8-0-7926-51ea-3ff2-71dd.ip6.aussiebb.net. [2403:5808:8af8:0:7926:51ea:3ff2:71dd]) by smtp.gmail.com with ESMTPSA id q9-20020a17090311c900b001ae59169f05sm16261879plh.182.2023.07.03.22.42.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 22:42:21 -0700 (PDT) From: Joel Stanley To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Nicholas Piggin , =?utf-8?b?RnLDqWTDqXJpYyBCYXJyYXQ=?= Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v2 2/5] ppc/pnv: Subclass quad xscom callbacks Date: Tue, 4 Jul 2023 15:12:01 +0930 Message-Id: <20230704054204.168547-3-joel@jms.id.au> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230704054204.168547-1-joel@jms.id.au> References: <20230704054204.168547-1-joel@jms.id.au> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=joel.stan@gmail.com; helo=mail-pl1-x631.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Make the existing pnv_quad_xscom_read/write be P9 specific, in preparation for a different P10 callback. Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley Reviewed-by: Frederic Barrat --- v2: Add scom region size to class --- include/hw/ppc/pnv_core.h | 13 ++++++++++++- hw/ppc/pnv.c | 11 +++++++---- hw/ppc/pnv_core.c | 40 ++++++++++++++++++++++++++------------- 3 files changed, 46 insertions(+), 18 deletions(-) diff --git a/include/hw/ppc/pnv_core.h b/include/hw/ppc/pnv_core.h index 3d75706e95da..77ef00f47a72 100644 --- a/include/hw/ppc/pnv_core.h +++ b/include/hw/ppc/pnv_core.h @@ -60,8 +60,19 @@ static inline PnvCPUState *pnv_cpu_state(PowerPCCPU *cpu) return (PnvCPUState *)cpu->machine_data; } +struct PnvQuadClass { + DeviceClass parent_class; + + const MemoryRegionOps *xscom_ops; + uint64_t xscom_size; +}; + #define TYPE_PNV_QUAD "powernv-cpu-quad" -OBJECT_DECLARE_SIMPLE_TYPE(PnvQuad, PNV_QUAD) + +#define PNV_QUAD_TYPE_SUFFIX "-" TYPE_PNV_QUAD +#define PNV_QUAD_TYPE_NAME(cpu_model) cpu_model PNV_QUAD_TYPE_SUFFIX + +OBJECT_DECLARE_TYPE(PnvQuad, PnvQuadClass, PNV_QUAD) struct PnvQuad { DeviceState parent_obj; diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index fc083173f346..c77fdb6747a4 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1429,14 +1429,15 @@ static void pnv_chip_power9_instance_init(Object *obj) } static void pnv_chip_quad_realize_one(PnvChip *chip, PnvQuad *eq, - PnvCore *pnv_core) + PnvCore *pnv_core, + const char *type) { char eq_name[32]; int core_id = CPU_CORE(pnv_core)->core_id; snprintf(eq_name, sizeof(eq_name), "eq[%d]", core_id); object_initialize_child_with_props(OBJECT(chip), eq_name, eq, - sizeof(*eq), TYPE_PNV_QUAD, + sizeof(*eq), type, &error_fatal, NULL); object_property_set_int(OBJECT(eq), "quad-id", core_id, &error_fatal); @@ -1454,7 +1455,8 @@ static void pnv_chip_quad_realize(Pnv9Chip *chip9, Error **errp) for (i = 0; i < chip9->nr_quads; i++) { PnvQuad *eq = &chip9->quads[i]; - pnv_chip_quad_realize_one(chip, eq, chip->cores[i * 4]); + pnv_chip_quad_realize_one(chip, eq, chip->cores[i * 4], + PNV_QUAD_TYPE_NAME("power9")); pnv_xscom_add_subregion(chip, PNV9_XSCOM_EQ_BASE(eq->quad_id), &eq->xscom_regs); @@ -1666,7 +1668,8 @@ static void pnv_chip_power10_quad_realize(Pnv10Chip *chip10, Error **errp) for (i = 0; i < chip10->nr_quads; i++) { PnvQuad *eq = &chip10->quads[i]; - pnv_chip_quad_realize_one(chip, eq, chip->cores[i * 4]); + pnv_chip_quad_realize_one(chip, eq, chip->cores[i * 4], + PNV_QUAD_TYPE_NAME("power9")); pnv_xscom_add_subregion(chip, PNV10_XSCOM_EQ_BASE(eq->quad_id), &eq->xscom_regs); diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c index 0f451b3b6e1f..73d25409c937 100644 --- a/hw/ppc/pnv_core.c +++ b/hw/ppc/pnv_core.c @@ -407,12 +407,14 @@ static const MemoryRegionOps pnv_quad_power9_xscom_ops = { static void pnv_quad_realize(DeviceState *dev, Error **errp) { PnvQuad *eq = PNV_QUAD(dev); + PnvQuadClass *pqc = PNV_QUAD_GET_CLASS(eq); char name[32]; snprintf(name, sizeof(name), "xscom-quad.%d", eq->quad_id); pnv_xscom_region_init(&eq->xscom_regs, OBJECT(dev), - &pnv_quad_power9_xscom_ops, - eq, name, PNV9_XSCOM_EQ_SIZE); + pqc->xscom_ops, + eq, name, + pqc->xscom_size); } static Property pnv_quad_properties[] = { @@ -420,6 +422,14 @@ static Property pnv_quad_properties[] = { DEFINE_PROP_END_OF_LIST(), }; +static void pnv_quad_power9_class_init(ObjectClass *oc, void *data) +{ + PnvQuadClass *pqc = PNV_QUAD_CLASS(oc); + + pqc->xscom_ops = &pnv_quad_power9_xscom_ops; + pqc->xscom_size = PNV9_XSCOM_EQ_SIZE; +} + static void pnv_quad_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -429,16 +439,20 @@ static void pnv_quad_class_init(ObjectClass *oc, void *data) dc->user_creatable = false; } -static const TypeInfo pnv_quad_info = { - .name = TYPE_PNV_QUAD, - .parent = TYPE_DEVICE, - .instance_size = sizeof(PnvQuad), - .class_init = pnv_quad_class_init, +static const TypeInfo pnv_quad_infos[] = { + { + .name = TYPE_PNV_QUAD, + .parent = TYPE_DEVICE, + .instance_size = sizeof(PnvQuad), + .class_size = sizeof(PnvQuadClass), + .class_init = pnv_quad_class_init, + .abstract = true, + }, + { + .parent = TYPE_PNV_QUAD, + .name = PNV_QUAD_TYPE_NAME("power9"), + .class_init = pnv_quad_power9_class_init, + }, }; -static void pnv_core_register_types(void) -{ - type_register_static(&pnv_quad_info); -} - -type_init(pnv_core_register_types) +DEFINE_TYPES(pnv_quad_infos); From patchwork Tue Jul 4 05:42:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 13300668 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D73DAEB64DD for ; Tue, 4 Jul 2023 05:43:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGYoC-0003UT-DM; Tue, 04 Jul 2023 01:42:41 -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 1qGYo1-0003Qn-Id; Tue, 04 Jul 2023 01:42:31 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGYnz-00048O-EQ; Tue, 04 Jul 2023 01:42:29 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1b89b75dc1cso9593095ad.1; Mon, 03 Jul 2023 22:42:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688449345; x=1691041345; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=plmvhQj1QqkwSrWn7DQhxC+OBfDhnt1XZ5qJc7WBdCY=; b=odWPm+OmSfWkh/d7HxWopTzApyJQUVzbTrU6G8kbqpJI45iXvRy+Uq2BtWlBWvaTWH +q1GeUlOU/g0Su8WsamKR6UUquVJ4OaPxExRt96+3yOxEPGu4nDPxhjX7E59Uw6uQ7tL XcSVN120Fs4Y8oHzbde795L9ATMMIgdflmRNrKwqdgzFFeLx9TYjL4F9vmuyhOQUVxkm RI38PrJrArerBxEjbLcADWzwHboQ4/Iw9/PbrldvK7NVd8Z73fKCLzYbQ7o1B9cM+uuN s8y0hFZ/jgloXMu/pDYJG+0wvrgsINJHsNV8TWnm0aa+6w4yjMXcVRoppubusDTlHyvz QBFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688449345; x=1691041345; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=plmvhQj1QqkwSrWn7DQhxC+OBfDhnt1XZ5qJc7WBdCY=; b=PRqPhsTc6hKikylsa3/QrqbeUz5KFxJpRs9ZR5BuBgRGKx8eX2nqZ2H694A/yd/wjE N4ILd/RgI9ZFOFY863YFt7qq9RZ8agsqst5WFJMdwi24e/EbE4NgxbkY45pQTuPkdleO fc2FcwSGQUwWPTX7xpY+pCz9h2fF4luBCyvjygO8j2zePQx4CX1YLE89zikERwMOKHhU lx3ruXMgKB0RK+6x+eqhpR1WHd/WqFSIgriM4wLIvgN1vmKIq12FLGr9tBxPsNE+OmGQ BgkK2VUG5mXaSDXDFYc4BdPme7BgYHs/kQ4NXR1ST4tpBI6ORmvT9tKwdPdhHQbc4Fe1 y6SQ== X-Gm-Message-State: ABy/qLZSee2huIESGqEjzHukaLN/8Si2iEhXjSlYr6H/TYgRNhpn7Lm+ Pj9CBl6CJJFo8Kkp7NJzJjc= X-Google-Smtp-Source: APBJJlHzep0uRCyKfu876FewRRy13Gutpah1vQKmhar1q5DzNXfXWjwMT45oUe1SEjKgh00p1zmlKA== X-Received: by 2002:a17:902:e548:b0:1b8:69d7:4362 with SMTP id n8-20020a170902e54800b001b869d74362mr19449644plf.10.1688449345267; Mon, 03 Jul 2023 22:42:25 -0700 (PDT) Received: from localhost.localdomain (2403-5808-8af8-0-7926-51ea-3ff2-71dd.ip6.aussiebb.net. [2403:5808:8af8:0:7926:51ea:3ff2:71dd]) by smtp.gmail.com with ESMTPSA id q9-20020a17090311c900b001ae59169f05sm16261879plh.182.2023.07.03.22.42.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 22:42:24 -0700 (PDT) From: Joel Stanley To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Nicholas Piggin , =?utf-8?b?RnLDqWTDqXJpYyBCYXJyYXQ=?= Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v2 3/5] ppc/pnv: Add P10 quad xscom model Date: Tue, 4 Jul 2023 15:12:02 +0930 Message-Id: <20230704054204.168547-4-joel@jms.id.au> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230704054204.168547-1-joel@jms.id.au> References: <20230704054204.168547-1-joel@jms.id.au> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=joel.stan@gmail.com; helo=mail-pl1-x635.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Add a PnvQuad class for the P10 powernv machine. No xscoms are implemented yet, but this allows them to be added. The size is reduced to avoid the quad region from overlapping with the core region. address-space: xscom-0 0000000000000000-00000003ffffffff (prio 0, i/o): xscom-0 0000000100000000-00000001000fffff (prio 0, i/o): xscom-quad.0 0000000100108000-0000000100907fff (prio 0, i/o): xscom-core.3 0000000100110000-000000010090ffff (prio 0, i/o): xscom-core.2 0000000100120000-000000010091ffff (prio 0, i/o): xscom-core.1 0000000100140000-000000010093ffff (prio 0, i/o): xscom-core.0 Signed-off-by: Joel Stanley Reviewed-by: Cédric Le Goater Reviewed-by: Frederic Barrat --- v2: Fix unimp read message Wrap lines at 80 col Set size --- include/hw/ppc/pnv_xscom.h | 2 +- hw/ppc/pnv.c | 2 +- hw/ppc/pnv_core.c | 54 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h index cbe848d27ba0..f7da9a1dc617 100644 --- a/include/hw/ppc/pnv_xscom.h +++ b/include/hw/ppc/pnv_xscom.h @@ -129,7 +129,7 @@ struct PnvXScomInterfaceClass { #define PNV10_XSCOM_EQ_BASE(core) \ ((uint64_t) PNV10_XSCOM_EQ(PNV10_XSCOM_EQ_CHIPLET(core))) -#define PNV10_XSCOM_EQ_SIZE 0x100000 +#define PNV10_XSCOM_EQ_SIZE 0x20000 #define PNV10_XSCOM_EC_BASE(core) \ ((uint64_t) PNV10_XSCOM_EQ_BASE(core) | PNV10_XSCOM_EC(core & 0x3)) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index c77fdb6747a4..5f25fe985ab2 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1669,7 +1669,7 @@ static void pnv_chip_power10_quad_realize(Pnv10Chip *chip10, Error **errp) PnvQuad *eq = &chip10->quads[i]; pnv_chip_quad_realize_one(chip, eq, chip->cores[i * 4], - PNV_QUAD_TYPE_NAME("power9")); + PNV_QUAD_TYPE_NAME("power10")); pnv_xscom_add_subregion(chip, PNV10_XSCOM_EQ_BASE(eq->quad_id), &eq->xscom_regs); diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c index 73d25409c937..e4df435b15e9 100644 --- a/hw/ppc/pnv_core.c +++ b/hw/ppc/pnv_core.c @@ -404,6 +404,47 @@ static const MemoryRegionOps pnv_quad_power9_xscom_ops = { .endianness = DEVICE_BIG_ENDIAN, }; +/* + * POWER10 Quads + */ + +static uint64_t pnv_quad_power10_xscom_read(void *opaque, hwaddr addr, + unsigned int width) +{ + uint32_t offset = addr >> 3; + uint64_t val = -1; + + switch (offset) { + default: + qemu_log_mask(LOG_UNIMP, "%s: reading @0x%08x\n", __func__, + offset); + } + + return val; +} + +static void pnv_quad_power10_xscom_write(void *opaque, hwaddr addr, + uint64_t val, unsigned int width) +{ + uint32_t offset = addr >> 3; + + switch (offset) { + default: + qemu_log_mask(LOG_UNIMP, "%s: writing @0x%08x\n", __func__, + offset); + } +} + +static const MemoryRegionOps pnv_quad_power10_xscom_ops = { + .read = pnv_quad_power10_xscom_read, + .write = pnv_quad_power10_xscom_write, + .valid.min_access_size = 8, + .valid.max_access_size = 8, + .impl.min_access_size = 8, + .impl.max_access_size = 8, + .endianness = DEVICE_BIG_ENDIAN, +}; + static void pnv_quad_realize(DeviceState *dev, Error **errp) { PnvQuad *eq = PNV_QUAD(dev); @@ -430,6 +471,14 @@ static void pnv_quad_power9_class_init(ObjectClass *oc, void *data) pqc->xscom_size = PNV9_XSCOM_EQ_SIZE; } +static void pnv_quad_power10_class_init(ObjectClass *oc, void *data) +{ + PnvQuadClass *pqc = PNV_QUAD_CLASS(oc); + + pqc->xscom_ops = &pnv_quad_power10_xscom_ops; + pqc->xscom_size = PNV10_XSCOM_EQ_SIZE; +} + static void pnv_quad_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); @@ -453,6 +502,11 @@ static const TypeInfo pnv_quad_infos[] = { .name = PNV_QUAD_TYPE_NAME("power9"), .class_init = pnv_quad_power9_class_init, }, + { + .parent = TYPE_PNV_QUAD, + .name = PNV_QUAD_TYPE_NAME("power10"), + .class_init = pnv_quad_power10_class_init, + }, }; DEFINE_TYPES(pnv_quad_infos); From patchwork Tue Jul 4 05:42:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 13300666 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 893ACEB64D9 for ; Tue, 4 Jul 2023 05:43:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGYoF-0003WO-T6; Tue, 04 Jul 2023 01:42:43 -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 1qGYo5-0003Tt-Q3; Tue, 04 Jul 2023 01:42:35 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGYo3-0004A0-7e; Tue, 04 Jul 2023 01:42:32 -0400 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-55ae51a45deso2526617a12.3; Mon, 03 Jul 2023 22:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688449349; x=1691041349; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=jQ2U4ciqTykEMRLsEsLYlQMNeQfrUH1E23P+plpKsNY=; b=BPghNxnAqehzdurmVgZlj/ITN5orfMb6VMUxWHMu9rHOmchREG5a37UhEOCBH8q2NP dFWbretJw1KnuPwBTj65Oi1Iu8RIJWszIj9OLR9VFyes5FaUCXPgikSm/u1LRlJpc2MU u9fX7IXBvS9NLbnX079PcIwYZtT0xZM/9luaQobIP5XBEASBeOFDeN4Kcu2i666WMEDN WohleA4wL8iw2J99QEQ4fnLDpQn2Amx3LipCFhOOKo+yzsYLiRh5cas6zo0rf30GsT7e CurVrkAZP31K24YpW86UZXxpoWauuOO+EGePZOCCOGFnC6WXTeMLAe2KqvUqVTmEKw8k zUDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688449349; x=1691041349; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jQ2U4ciqTykEMRLsEsLYlQMNeQfrUH1E23P+plpKsNY=; b=F65Fsy98nCz45Uv724kGDnQyX+MJtyTsNq6QPcNXmFtDBbuM+kF/teHx/PNwgBojOm GR2u4UH9s8k9gwuV0eKX4ifs358NnzMa99Y0sOZMLDAGym08AZ3YUoJNhBel9mQeh39M OQ+eOYMaYIqdRsXllugoNedX0D1NjREBhOcwSoLEQsRAm7myn1AXR/KCmZJK0t8jdm43 0RsAFrOsMMCf8qTgRw3fqeot67BLRg5CA4TnAWZDHHK2HWMVSYYGgk7PMR//YgB/+0uU 0evQj+OL3OifPZzCItYfqxw12DOfOTc+bnWqBOazQV4n89TIRkz3eMYjEgmnjvxyb/SS ElSg== X-Gm-Message-State: AC+VfDyhXcmUCa9nRNFboymFpVkMLvK4OCf2p4ErjaF10BP/v+ut8Zn+ EdSJ2AkRyEIoVfDPfhme4O34LQ+nwGY= X-Google-Smtp-Source: ACHHUZ5M4nyxS5WjduqZhWcQlwHqVcpZRWeVESmAaGDzpDkSoYhdv4f/XKKpBm1gfa3pF+96FTXSFw== X-Received: by 2002:a05:6a20:488:b0:103:d538:5ea6 with SMTP id 8-20020a056a20048800b00103d5385ea6mr9189255pzc.48.1688449348946; Mon, 03 Jul 2023 22:42:28 -0700 (PDT) Received: from localhost.localdomain (2403-5808-8af8-0-7926-51ea-3ff2-71dd.ip6.aussiebb.net. [2403:5808:8af8:0:7926:51ea:3ff2:71dd]) by smtp.gmail.com with ESMTPSA id q9-20020a17090311c900b001ae59169f05sm16261879plh.182.2023.07.03.22.42.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 22:42:28 -0700 (PDT) From: Joel Stanley To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Nicholas Piggin , =?utf-8?b?RnLDqWTDqXJpYyBCYXJyYXQ=?= Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v2 4/5] ppc/pnv: Add P10 core xscom model Date: Tue, 4 Jul 2023 15:12:03 +0930 Message-Id: <20230704054204.168547-5-joel@jms.id.au> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230704054204.168547-1-joel@jms.id.au> References: <20230704054204.168547-1-joel@jms.id.au> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=joel.stan@gmail.com; helo=mail-pg1-x52b.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Like the quad xscoms, add a core model for P10 to allow future differentiation from P9. Signed-off-by: Joel Stanley Reviewed-by: Cédric Le Goater Reviewed-by: Frederic Barrat --- hw/ppc/pnv_core.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c index e4df435b15e9..1eec28c88c41 100644 --- a/hw/ppc/pnv_core.c +++ b/hw/ppc/pnv_core.c @@ -167,6 +167,47 @@ static const MemoryRegionOps pnv_core_power9_xscom_ops = { .endianness = DEVICE_BIG_ENDIAN, }; +/* + * POWER10 core controls + */ + +static uint64_t pnv_core_power10_xscom_read(void *opaque, hwaddr addr, + unsigned int width) +{ + uint32_t offset = addr >> 3; + uint64_t val = 0; + + switch (offset) { + default: + qemu_log_mask(LOG_UNIMP, "Warning: reading reg=0x%" HWADDR_PRIx "\n", + addr); + } + + return val; +} + +static void pnv_core_power10_xscom_write(void *opaque, hwaddr addr, + uint64_t val, unsigned int width) +{ + uint32_t offset = addr >> 3; + + switch (offset) { + default: + qemu_log_mask(LOG_UNIMP, "Warning: writing to reg=0x%" HWADDR_PRIx "\n", + addr); + } +} + +static const MemoryRegionOps pnv_core_power10_xscom_ops = { + .read = pnv_core_power10_xscom_read, + .write = pnv_core_power10_xscom_write, + .valid.min_access_size = 8, + .valid.max_access_size = 8, + .impl.min_access_size = 8, + .impl.max_access_size = 8, + .endianness = DEVICE_BIG_ENDIAN, +}; + static void pnv_core_cpu_realize(PnvCore *pc, PowerPCCPU *cpu, Error **errp) { CPUPPCState *env = &cpu->env; @@ -315,8 +356,7 @@ static void pnv_core_power10_class_init(ObjectClass *oc, void *data) { PnvCoreClass *pcc = PNV_CORE_CLASS(oc); - /* TODO: Use the P9 XSCOMs for now on P10 */ - pcc->xscom_ops = &pnv_core_power9_xscom_ops; + pcc->xscom_ops = &pnv_core_power10_xscom_ops; } static void pnv_core_class_init(ObjectClass *oc, void *data) From patchwork Tue Jul 4 05:42:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 13300665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8365BEB64DD for ; Tue, 4 Jul 2023 05:42:58 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGYoF-0003W9-H8; Tue, 04 Jul 2023 01:42:43 -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 1qGYo8-0003U7-WF; Tue, 04 Jul 2023 01:42:37 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGYo6-0004DR-4k; Tue, 04 Jul 2023 01:42:35 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1b8033987baso31215065ad.0; Mon, 03 Jul 2023 22:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688449352; x=1691041352; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Mb1g58UHfH5R1KjeTnU8nIlKmYBN2xuz7JIA9+P33R0=; b=cl4PF2sRSSdUvNIZtJ5IWhh+ziiuX5ZrdP53KIAFjvh/0i32DoH5iGJ8Sutv7L5Vy/ NgHYBJRHNWE5ThjD/gR9aEUkG/4I2pJe1DZKXmQy7rHu3lz2m4JysT8ecmnf+GY8XRwS EdiripQCVRU6ELwPua5eMzwlCcnDdJgSrYbqHVH9QMaZXG71iQJ7E1Gpd+MU+BBTIh9w XYpcawoPyc8fExQ+BBurJR2QZP0lFMuyMISOJ+DE5a7czNUeH78PxRmTaY1bL3ukiUzN NOa0IGUD6WdSkvql9JAbL0vGdr+/78HDNVW/3eldlI5ChH68QyTshGt7qYXaG8YoU1nr YJDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688449352; x=1691041352; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Mb1g58UHfH5R1KjeTnU8nIlKmYBN2xuz7JIA9+P33R0=; b=CZj+sd5LtfV6Lzj6UzGxBSqlOweEpSc/iICdyEpqKUxbnAYfqZQKEE0JvILFUUJooY S2j16mW+WiAhFEoxekQZ9667FSCyHZ3InvWfReuHDqYJGNdZ0Cm3c8CcmdOCKNqBpPJC HJ/QGsrQ+8a3MOK5MnfMlclGxomDJDMIQQ9qYASA4Fe0o0w7qUczwzuTjz3uII2dBl4p 04y7Rs4bn5ELYsABW0/F1rzWaNhGriiPl3nXlJ3iihEPD9W0Vca+EVp0IMhxhNFor10I zQ5+kNqvfXnTIlMvM6xx202A9jojNZOh5tr3YpHdPyb4WWJSh6ieAbo9XddD3br4IMGN bksA== X-Gm-Message-State: ABy/qLb4rRUjDhFBtJqfGFZM5FZcAxnlDZNXgu9lIVR0728Tc8tNbn9A ViJ6YAdplsvpjBmBk8CH2z8= X-Google-Smtp-Source: APBJJlEeEaiGKQGThIb3ewD1abrBFIlclIpSHNOVZhCbjnunAKuV8Fk5xHeNqs8NVAH9fH9e4k6dDQ== X-Received: by 2002:a17:903:22c6:b0:1b8:a39e:ff4b with SMTP id y6-20020a17090322c600b001b8a39eff4bmr2834903plg.32.1688449352140; Mon, 03 Jul 2023 22:42:32 -0700 (PDT) Received: from localhost.localdomain (2403-5808-8af8-0-7926-51ea-3ff2-71dd.ip6.aussiebb.net. [2403:5808:8af8:0:7926:51ea:3ff2:71dd]) by smtp.gmail.com with ESMTPSA id q9-20020a17090311c900b001ae59169f05sm16261879plh.182.2023.07.03.22.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 22:42:31 -0700 (PDT) From: Joel Stanley To: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Nicholas Piggin , =?utf-8?b?RnLDqWTDqXJpYyBCYXJyYXQ=?= Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v2 5/5] ppc/pnv: Return zero for core thread state xscom Date: Tue, 4 Jul 2023 15:12:04 +0930 Message-Id: <20230704054204.168547-6-joel@jms.id.au> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230704054204.168547-1-joel@jms.id.au> References: <20230704054204.168547-1-joel@jms.id.au> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=joel.stan@gmail.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Firmware now warns if booting in LPAR per core mode (PPC bit 62). So this warning doesn't trigger, report the core thread state is 0. Reviewed-by: Cédric Le Goater Signed-off-by: Joel Stanley Reviewed-by: Frederic Barrat --- hw/ppc/pnv_core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c index 1eec28c88c41..b7223bb44597 100644 --- a/hw/ppc/pnv_core.c +++ b/hw/ppc/pnv_core.c @@ -116,6 +116,8 @@ static const MemoryRegionOps pnv_core_power8_xscom_ops = { #define PNV9_XSCOM_EC_PPM_SPECIAL_WKUP_HYP 0xf010d #define PNV9_XSCOM_EC_PPM_SPECIAL_WKUP_OTR 0xf010a +#define PNV9_XSCOM_EC_CORE_THREAD_STATE 0x10ab3 + static uint64_t pnv_core_power9_xscom_read(void *opaque, hwaddr addr, unsigned int width) { @@ -134,6 +136,9 @@ static uint64_t pnv_core_power9_xscom_read(void *opaque, hwaddr addr, case PNV9_XSCOM_EC_PPM_SPECIAL_WKUP_OTR: val = 0x0; break; + case PNV9_XSCOM_EC_CORE_THREAD_STATE: + val = 0; + break; default: qemu_log_mask(LOG_UNIMP, "Warning: reading reg=0x%" HWADDR_PRIx "\n", addr); @@ -171,6 +176,8 @@ static const MemoryRegionOps pnv_core_power9_xscom_ops = { * POWER10 core controls */ +#define PNV10_XSCOM_EC_CORE_THREAD_STATE 0x412 + static uint64_t pnv_core_power10_xscom_read(void *opaque, hwaddr addr, unsigned int width) { @@ -178,6 +185,9 @@ static uint64_t pnv_core_power10_xscom_read(void *opaque, hwaddr addr, uint64_t val = 0; switch (offset) { + case PNV10_XSCOM_EC_CORE_THREAD_STATE: + val = 0; + break; default: qemu_log_mask(LOG_UNIMP, "Warning: reading reg=0x%" HWADDR_PRIx "\n", addr);