From nobody Fri Apr 26 05:34:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642184066529245.58250136450033; Fri, 14 Jan 2022 10:14:26 -0800 (PST) Received: from localhost ([::1]:45050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8R5l-0005gH-GI for importer@patchew.org; Fri, 14 Jan 2022 13:14:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8Qz8-0005SO-3U; Fri, 14 Jan 2022 13:07:34 -0500 Received: from [2607:f8b0:4864:20::c31] (port=45745 helo=mail-oo1-xc31.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8Qz6-0000Mr-CZ; Fri, 14 Jan 2022 13:07:33 -0500 Received: by mail-oo1-xc31.google.com with SMTP id l10-20020a4a840a000000b002dc09752694so2770661oog.12; Fri, 14 Jan 2022 10:07:31 -0800 (PST) Received: from rekt.COMFAST ([152.249.109.193]) by smtp.gmail.com with ESMTPSA id e17sm1353584otr.13.2022.01.14.10.07.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 10:07:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UeZQhN7i74gPGlvXNoYGRr9eqyhQ4j7/HSM2uxOXsKI=; b=qBJEUaytMzeSaWKhRleUqWsQkSQWiRVU+riJ1+gfK8QeuSb44wB0lfM0+sMxnf0HgO DuKwlwNXsgBeyMXCTnBbPWkPHR/moMz2rjHJqclskXh5eWIpp5BZHr+B8DZxkuTocDSf tGUMsdVDuRIO4B45Mp3/s0Fqq/3Icl92O3YSzdacup1F+W5OLYrVy8DkwEAxo6NEPNE1 Bgijgh1gd0DCckeMlBypqu8zuB1uGKdfmaDHOe7Kbrn4lx6vgCEoOCXPBNuHyBt7ISFW Ua1Xg3G9L3PU70xfZD2ksFcb8u/TM27+D4BCDZctNycYDzf5mswxYKioh5+Ew2zkQpRe DDeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UeZQhN7i74gPGlvXNoYGRr9eqyhQ4j7/HSM2uxOXsKI=; b=jMqhB4BM2ZaE5rfH6eFoPqWJSnqB9cJ+zMrautDYqc9rCY9/HgPb1QshSkfTiLC6fd PvgU6sREs2gZYcgRVoYFP4+b5aSGNnttLu/AU+cjgZKFU01xk3RdpEGgpk1kxvZohD15 LXR5gXwN4ec4vcRl4W3UNx0Cj284QHRkqAjennujMrDsyYGcnQ+g8/fOsrhy7ZD4f27g BHE98Zcq6ZisSUpssb5kLLk9dGvxfC2Fki3+vVGt00mpUu7G6KTMbdu/gnFRi/wRIZFA TdXDOPSrBH5JKo/LiWf75K179Bj7RpVq2XBDJWAtY0rK2/96pgjyNcqJjcckefQnxiag d35Q== X-Gm-Message-State: AOAM530XyUz18qGcQfkx20VvOWmR/pEpcV9VFxafT2C8xlsFOIJkUEt+ CdQZCSbizQcjn6SPoIfG0vYOyd6u8yz2Edi2 X-Google-Smtp-Source: ABdhPJxxU5+qGZxCfiDi1zy6FNlOot43X+9aJtb1Neb0fmcr6vpO2ctzf6YDOnmB75fCG0mbu4KnzQ== X-Received: by 2002:a4a:e50e:: with SMTP id r14mr7483493oot.27.1642183650796; Fri, 14 Jan 2022 10:07:30 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v2 1/8] ppc/pnv: introduce PnvPHB4 'pec' property Date: Fri, 14 Jan 2022 15:07:12 -0300 Message-Id: <20220114180719.52117-2-danielhb413@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220114180719.52117-1-danielhb413@gmail.com> References: <20220114180719.52117-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::c31 (failed) 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::c31; envelope-from=danielhb413@gmail.com; helo=mail-oo1-xc31.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Daniel Henrique Barboza , qemu-ppc@nongnu.org, clg@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642184068048100001 This property will track the owner PEC of this PHB. For now it's redundant since we can retrieve the PEC via phb->stack->pec but it will not be redundant when we get rid of the stack device. Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Daniel Henrique Barboza --- hw/pci-host/pnv_phb4.c | 19 +++++++++++++------ hw/pci-host/pnv_phb4_pec.c | 2 ++ include/hw/pci-host/pnv_phb4.h | 3 +++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index b5045fca64..2658ef2d84 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -895,7 +895,7 @@ static void pnv_phb4_update_regions(PnvPHB4 *phb) static void pnv_pec_stk_update_map(PnvPHB4 *phb) { PnvPhb4PecStack *stack =3D phb->stack; - PnvPhb4PecState *pec =3D stack->pec; + PnvPhb4PecState *pec =3D phb->pec; MemoryRegion *sysmem =3D get_system_memory(); uint64_t bar_en =3D phb->nest_regs[PEC_NEST_STK_BAR_EN]; uint64_t bar, mask, size; @@ -969,7 +969,7 @@ static void pnv_pec_stk_update_map(PnvPHB4 *phb) bar =3D phb->nest_regs[PEC_NEST_STK_INT_BAR] >> 8; size =3D PNV_PHB4_MAX_INTs << 16; snprintf(name, sizeof(name), "pec-%d.%d-phb-%d-int", - stack->pec->chip_id, stack->pec->index, stack->stack_no); + phb->pec->chip_id, phb->pec->index, stack->stack_no); memory_region_init(&phb->intbar, OBJECT(phb), name, size); memory_region_add_subregion(sysmem, bar, &phb->intbar); } @@ -982,7 +982,7 @@ static void pnv_pec_stk_nest_xscom_write(void *opaque, = hwaddr addr, uint64_t val, unsigned size) { PnvPHB4 *phb =3D PNV_PHB4(opaque); - PnvPhb4PecState *pec =3D phb->stack->pec; + PnvPhb4PecState *pec =3D phb->pec; uint32_t reg =3D addr >> 3; =20 switch (reg) { @@ -1459,7 +1459,7 @@ static AddressSpace *pnv_phb4_dma_iommu(PCIBus *bus, = void *opaque, int devfn) static void pnv_phb4_xscom_realize(PnvPHB4 *phb) { PnvPhb4PecStack *stack =3D phb->stack; - PnvPhb4PecState *pec =3D stack->pec; + PnvPhb4PecState *pec =3D phb->pec; PnvPhb4PecClass *pecc =3D PNV_PHB4_PEC_GET_CLASS(pec); uint32_t pec_nest_base; uint32_t pec_pci_base; @@ -1568,8 +1568,13 @@ static void pnv_phb4_realize(DeviceState *dev, Error= **errp) return; } =20 - /* All other phb properties but 'version' are already set */ - pecc =3D PNV_PHB4_PEC_GET_CLASS(phb->stack->pec); + /* + * All other phb properties but 'pec' ad 'version' are + * already set. + */ + object_property_set_link(OBJECT(phb), "pec", OBJECT(phb->stack->pe= c), + &error_abort); + pecc =3D PNV_PHB4_PEC_GET_CLASS(phb->pec); object_property_set_int(OBJECT(phb), "version", pecc->version, &error_fatal); =20 @@ -1682,6 +1687,8 @@ static Property pnv_phb4_properties[] =3D { DEFINE_PROP_UINT64("version", PnvPHB4, version, 0), DEFINE_PROP_LINK("stack", PnvPHB4, stack, TYPE_PNV_PHB4_PEC_STACK, PnvPhb4PecStack *), + DEFINE_PROP_LINK("pec", PnvPHB4, pec, TYPE_PNV_PHB4_PEC, + PnvPhb4PecState *), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c index 7fe7f1f007..22194b8de2 100644 --- a/hw/pci-host/pnv_phb4_pec.c +++ b/hw/pci-host/pnv_phb4_pec.c @@ -285,6 +285,8 @@ static void pnv_pec_stk_default_phb_realize(PnvPhb4PecS= tack *stack, =20 stack->phb =3D PNV_PHB4(qdev_new(TYPE_PNV_PHB4)); =20 + object_property_set_link(OBJECT(stack->phb), "pec", OBJECT(pec), + &error_abort); object_property_set_int(OBJECT(stack->phb), "chip-id", pec->chip_id, &error_fatal); object_property_set_int(OBJECT(stack->phb), "index", phb_id, diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index 6968efaba8..1d27e4c0cb 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -84,6 +84,9 @@ struct PnvPHB4 { =20 uint64_t version; =20 + /* The owner PEC */ + PnvPhb4PecState *pec; + char bus_path[8]; =20 /* Main register images */ --=20 2.33.1 From nobody Fri Apr 26 05:34:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642184289097630.7072674360465; Fri, 14 Jan 2022 10:18:09 -0800 (PST) Received: from localhost ([::1]:53448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8R9M-0002ts-4N for importer@patchew.org; Fri, 14 Jan 2022 13:18:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8QzH-0005lH-12; Fri, 14 Jan 2022 13:07:43 -0500 Received: from [2607:f8b0:4864:20::32b] (port=36834 helo=mail-ot1-x32b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8Qz8-0000OK-9m; Fri, 14 Jan 2022 13:07:42 -0500 Received: by mail-ot1-x32b.google.com with SMTP id s21-20020a05683004d500b0058f585672efso10975173otd.3; Fri, 14 Jan 2022 10:07:33 -0800 (PST) Received: from rekt.COMFAST ([152.249.109.193]) by smtp.gmail.com with ESMTPSA id e17sm1353584otr.13.2022.01.14.10.07.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 10:07:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SCTWNvfONvAG20pSuoDHmmCdiFQbwCr5TBcbCLkF+bg=; b=U21i/gmHvLmgON8X66XvQKMzWA/xbrv0yocWx5/5a5jl79IoD4JI86ushJYovlQNth jUcECvXEzDElYnbT438SkS7Zp6kIrCpm5Rw4uTTJN/b2easrdbv8zHmtxw9BNJkupk0Z dytkdpu3xMMe5YnSgIU8jbP7JyN5NePaK3F5fpcGQzhdFF3B8JRw0lG+zUQUufPDl7FO PUivldFNpHxCwH/CLOFTh6T/NmV4OQynPkcwUswsjd/SgmdaWoZix5/IgTTr4xNpb9Wt 12GvktsKysXbStttzOJldX6xxviv9FhQepvyLPUMLACnvZIjfCJdjWhWBn77XVQpZqMi 9T/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SCTWNvfONvAG20pSuoDHmmCdiFQbwCr5TBcbCLkF+bg=; b=y3jMk2l7wBzS8QG7sFl5qKjM2PePfJ27jJCCwSir7B3/7e/mloW17VTA9KuAhO/KSU GcsHoySzsyTXWPG0BMi9Q6orwIB67BhDF4zIB3+7hZACMsUgMI7zJArdWjhgHG/XbIT2 Vt/w0IewScVEJcRzmvoLErCeLDSc6SpPElcj0CTilQud8hUe76MayrptTN0EV+Xf3srq E7ZpEaJk7ZStBYwcv3/wqo6KE9olcPVs2u4ATDi8BDqhJbGaIwVZ/xPHMR/gHyoGgcZX U0RURQLiCrvTR01R72dXYKr/ngfwaRSbitIJJEaEwcA47NYWf33SbD6Ctvl9i+m9yzkt CGmw== X-Gm-Message-State: AOAM531LYpUV1CWOhQjxlyKd5roOzzEiHWMBa6tyMg4ZXGXL+hZ2tRec nBdZ+PXJczqqU8eqwOKQaOKKxJ/dRckB6RsK X-Google-Smtp-Source: ABdhPJwhV6KqiHGZTbVzB2/VUhmt66PVJZZ8+dj277UlP3bEi3DSGO8SvJkEUHOycvUPpCdl7qXBWg== X-Received: by 2002:a05:6830:22c8:: with SMTP id q8mr7643643otc.54.1642183652790; Fri, 14 Jan 2022 10:07:32 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v2 2/8] ppc/pnv: reduce stack->stack_no usage Date: Fri, 14 Jan 2022 15:07:13 -0300 Message-Id: <20220114180719.52117-3-danielhb413@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220114180719.52117-1-danielhb413@gmail.com> References: <20220114180719.52117-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::32b (failed) 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::32b; envelope-from=danielhb413@gmail.com; helo=mail-ot1-x32b.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Daniel Henrique Barboza , qemu-ppc@nongnu.org, clg@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642184291494100001 Content-Type: text/plain; charset="utf-8" 'stack->stack_no' represents the order that a stack appears in its PEC. Its primary use is in XSCOM address space calculation in pnv_phb4_xscom_realize() when calculating the memory region offset. This attribute is redundant with phb->phb_id, which is calculated via pnv_phb4_pec_get_phb_id() using stack->stack_no information. It'll also be awkward to assign it when dealing with PECs and PHBs only in a future patch. A new pnv_phb4_get_phb_stack_no() helper is introduced to eliminate most of the stack->stack_no uses we have. The only use left after this patch is during pnv_pec_stk_default_phb_realize() when calculating phb_id, which will also handled in the next patches. Signed-off-by: Daniel Henrique Barboza Reviewed-by: C=C3=A9dric Le Goater --- hw/pci-host/pnv_phb4.c | 46 +++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 2658ef2d84..4933fe57fe 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -868,6 +868,28 @@ static uint64_t pnv_pec_stk_nest_xscom_read(void *opaq= ue, hwaddr addr, return phb->nest_regs[reg]; } =20 +/* + * Return the 'stack_no' of a PHB4. 'stack_no' is the order + * the PHB4 occupies in the PEC. This is the reverse of what + * pnv_phb4_pec_get_phb_id() does. + * + * E.g. a phb with phb_id =3D 4 and pec->index =3D 1 (PEC1) will + * be the second phb (stack_no =3D 1) of the PEC. + */ +static int pnv_phb4_get_phb_stack_no(PnvPHB4 *phb) +{ + PnvPhb4PecState *pec =3D phb->pec; + PnvPhb4PecClass *pecc =3D PNV_PHB4_PEC_GET_CLASS(pec); + int index =3D pec->index; + int stack_no =3D phb->phb_id; + + while (index--) { + stack_no -=3D pecc->num_stacks[index]; + } + + return stack_no; +} + static void pnv_phb4_update_regions(PnvPHB4 *phb) { /* Unmap first always */ @@ -894,10 +916,10 @@ static void pnv_phb4_update_regions(PnvPHB4 *phb) =20 static void pnv_pec_stk_update_map(PnvPHB4 *phb) { - PnvPhb4PecStack *stack =3D phb->stack; PnvPhb4PecState *pec =3D phb->pec; MemoryRegion *sysmem =3D get_system_memory(); uint64_t bar_en =3D phb->nest_regs[PEC_NEST_STK_BAR_EN]; + int stack_no =3D pnv_phb4_get_phb_stack_no(phb); uint64_t bar, mask, size; char name[64]; =20 @@ -937,7 +959,7 @@ static void pnv_pec_stk_update_map(PnvPHB4 *phb) mask =3D phb->nest_regs[PEC_NEST_STK_MMIO_BAR0_MASK]; size =3D ((~mask) >> 8) + 1; snprintf(name, sizeof(name), "pec-%d.%d-phb-%d-mmio0", - pec->chip_id, pec->index, stack->stack_no); + pec->chip_id, pec->index, stack_no); memory_region_init(&phb->mmbar0, OBJECT(phb), name, size); memory_region_add_subregion(sysmem, bar, &phb->mmbar0); phb->mmio0_base =3D bar; @@ -949,7 +971,7 @@ static void pnv_pec_stk_update_map(PnvPHB4 *phb) mask =3D phb->nest_regs[PEC_NEST_STK_MMIO_BAR1_MASK]; size =3D ((~mask) >> 8) + 1; snprintf(name, sizeof(name), "pec-%d.%d-phb-%d-mmio1", - pec->chip_id, pec->index, stack->stack_no); + pec->chip_id, pec->index, stack_no); memory_region_init(&phb->mmbar1, OBJECT(phb), name, size); memory_region_add_subregion(sysmem, bar, &phb->mmbar1); phb->mmio1_base =3D bar; @@ -960,7 +982,7 @@ static void pnv_pec_stk_update_map(PnvPHB4 *phb) bar =3D phb->nest_regs[PEC_NEST_STK_PHB_REGS_BAR] >> 8; size =3D PNV_PHB4_NUM_REGS << 3; snprintf(name, sizeof(name), "pec-%d.%d-phb-%d", - pec->chip_id, pec->index, stack->stack_no); + pec->chip_id, pec->index, stack_no); memory_region_init(&phb->phbbar, OBJECT(phb), name, size); memory_region_add_subregion(sysmem, bar, &phb->phbbar); } @@ -969,7 +991,7 @@ static void pnv_pec_stk_update_map(PnvPHB4 *phb) bar =3D phb->nest_regs[PEC_NEST_STK_INT_BAR] >> 8; size =3D PNV_PHB4_MAX_INTs << 16; snprintf(name, sizeof(name), "pec-%d.%d-phb-%d-int", - phb->pec->chip_id, phb->pec->index, stack->stack_no); + phb->pec->chip_id, phb->pec->index, stack_no); memory_region_init(&phb->intbar, OBJECT(phb), name, size); memory_region_add_subregion(sysmem, bar, &phb->intbar); } @@ -1458,9 +1480,9 @@ static AddressSpace *pnv_phb4_dma_iommu(PCIBus *bus, = void *opaque, int devfn) =20 static void pnv_phb4_xscom_realize(PnvPHB4 *phb) { - PnvPhb4PecStack *stack =3D phb->stack; PnvPhb4PecState *pec =3D phb->pec; PnvPhb4PecClass *pecc =3D PNV_PHB4_PEC_GET_CLASS(pec); + int stack_no =3D pnv_phb4_get_phb_stack_no(phb); uint32_t pec_nest_base; uint32_t pec_pci_base; char name[64]; @@ -1469,20 +1491,20 @@ static void pnv_phb4_xscom_realize(PnvPHB4 *phb) =20 /* Initialize the XSCOM regions for the stack registers */ snprintf(name, sizeof(name), "xscom-pec-%d.%d-nest-phb-%d", - pec->chip_id, pec->index, stack->stack_no); + pec->chip_id, pec->index, stack_no); pnv_xscom_region_init(&phb->nest_regs_mr, OBJECT(phb), &pnv_pec_stk_nest_xscom_ops, phb, name, PHB4_PEC_NEST_STK_REGS_COUNT); =20 snprintf(name, sizeof(name), "xscom-pec-%d.%d-pci-phb-%d", - pec->chip_id, pec->index, stack->stack_no); + pec->chip_id, pec->index, stack_no); pnv_xscom_region_init(&phb->pci_regs_mr, OBJECT(phb), &pnv_pec_stk_pci_xscom_ops, phb, name, PHB4_PEC_PCI_STK_REGS_COUNT); =20 /* PHB pass-through */ snprintf(name, sizeof(name), "xscom-pec-%d.%d-pci-phb-%d", - pec->chip_id, pec->index, stack->stack_no); + pec->chip_id, pec->index, stack_no); pnv_xscom_region_init(&phb->phb_regs_mr, OBJECT(phb), &pnv_phb4_xscom_ops, phb, name, 0x40); =20 @@ -1491,14 +1513,14 @@ static void pnv_phb4_xscom_realize(PnvPHB4 *phb) =20 /* Populate the XSCOM address space. */ pnv_xscom_add_subregion(pec->chip, - pec_nest_base + 0x40 * (stack->stack_no + 1), + pec_nest_base + 0x40 * (stack_no + 1), &phb->nest_regs_mr); pnv_xscom_add_subregion(pec->chip, - pec_pci_base + 0x40 * (stack->stack_no + 1), + pec_pci_base + 0x40 * (stack_no + 1), &phb->pci_regs_mr); pnv_xscom_add_subregion(pec->chip, pec_pci_base + PNV9_XSCOM_PEC_PCI_STK0 + - 0x40 * stack->stack_no, + 0x40 * stack_no, &phb->phb_regs_mr); } =20 --=20 2.33.1 From nobody Fri Apr 26 05:34:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164218404215624.229265618640852; Fri, 14 Jan 2022 10:14:02 -0800 (PST) Received: from localhost ([::1]:43484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8R5M-0004Zh-8i for importer@patchew.org; Fri, 14 Jan 2022 13:14:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8QzE-0005eI-Ep; Fri, 14 Jan 2022 13:07:40 -0500 Received: from [2607:f8b0:4864:20::22f] (port=34659 helo=mail-oi1-x22f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8QzB-0000OZ-Ge; Fri, 14 Jan 2022 13:07:40 -0500 Received: by mail-oi1-x22f.google.com with SMTP id r131so13274781oig.1; Fri, 14 Jan 2022 10:07:35 -0800 (PST) Received: from rekt.COMFAST ([152.249.109.193]) by smtp.gmail.com with ESMTPSA id e17sm1353584otr.13.2022.01.14.10.07.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 10:07:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fgF5H6lNIGjSlEyrdCNMVwu51M54GmXO+JKSD0uKvAA=; b=I74iRHm1sdDMK3GDPFhqCsbhrSIterByM4pUCLJdek/sQnadoEomh+TGY/G7AFQFE5 aaMm97/EE/3gDurx2M8KEHtqfSkc3EyY4adv8uafySdSkd7XexUOQ4h8NtYz7dpQizOt /FxUJxVDwKxUAmwgR3oEWk19nj8y7oeELgQHI6Gp7J7X6vAsAFDhkvGeq0Tjyp7e+JgH mrsiV37RKu69+fac3Zn23MNl2WXgFqMGzZ/2zK3TcEXqnMv3LVz9yhc4r4kXY7bjOD8R TNi6qdjc9z+3//h5EJk9i0K2musg/g4YrfQmYflipWUJNHiMkfrsjPsbr/1efomx6ku3 zZsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fgF5H6lNIGjSlEyrdCNMVwu51M54GmXO+JKSD0uKvAA=; b=X4Hqpsk8Q5xnibL0nUlgKKesmjEeM3ll2ZoB3GZAmeEuWPTroEz0C5XM6yWwOtBaHT y0aZAUg4RRSZzA7GBhrQ1tk9fRSbXgg9qEvPlNO1uOV6Y2UW2d32oz+eOQrGMBbqBo+I 9sZL4Zit2phkf//Ws1BuKuzQGrzrdsssovbxkfEUXRWaRe5KfKimvjWH3kwwafWFqfyL u1laDweeJML6fTzVQl/uQCI3m9wQZ9fSsH9VkR2JvVoUG7DxapEiBnyAY8h2PM06Vs3k CZt3AavlaNJ0CnhnDSEp9xWj32DZsqypjH8oQX60FGGHroFlkMRpI7mQTrU8k9+Uvkoc skaQ== X-Gm-Message-State: AOAM531VQs9cAOPCbskbLZ9h5WPkSxON7Zepmfa4/4C+srgtMUD2rf7Q 72Jd+ZG0+s2/99/a9cWpRk3NCVFyJtuktlxh X-Google-Smtp-Source: ABdhPJyBJwLSpi+HIGiVjS97Sqhk9i2oue2wODrJHaPMwjPrnOlSbvl4sX5036x48I/PqbBCLsDYqA== X-Received: by 2002:a05:6808:1805:: with SMTP id bh5mr11663960oib.105.1642183655117; Fri, 14 Jan 2022 10:07:35 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v2 3/8] ppc/pnv: remove stack pointer from PnvPHB4 Date: Fri, 14 Jan 2022 15:07:14 -0300 Message-Id: <20220114180719.52117-4-danielhb413@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220114180719.52117-1-danielhb413@gmail.com> References: <20220114180719.52117-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::22f (failed) 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::22f; envelope-from=danielhb413@gmail.com; helo=mail-oi1-x22f.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Daniel Henrique Barboza , qemu-ppc@nongnu.org, clg@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642184043280100001 This pointer was being used for two reasons: pnv_phb4_update_regions() was using it to access the PHB and phb4_realize() was using it as a way to determine if the PHB was user created. We can determine if the PHB is user created via phb->pec, introduced in the previous patch, and pnv_phb4_update_regions() is no longer using stack->phb. Remove the pointer from the PnvPHB4 device. Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Daniel Henrique Barboza --- hw/pci-host/pnv_phb4.c | 15 ++++----------- hw/pci-host/pnv_phb4_pec.c | 2 -- include/hw/pci-host/pnv_phb4.h | 2 -- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 4933fe57fe..2efd34518e 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -1573,9 +1573,10 @@ static void pnv_phb4_realize(DeviceState *dev, Error= **errp) char name[32]; =20 /* User created PHB */ - if (!phb->stack) { + if (!phb->pec) { PnvMachineState *pnv =3D PNV_MACHINE(qdev_get_machine()); PnvChip *chip =3D pnv_get_chip(pnv, phb->chip_id); + PnvPhb4PecStack *stack; PnvPhb4PecClass *pecc; BusState *s; =20 @@ -1584,7 +1585,7 @@ static void pnv_phb4_realize(DeviceState *dev, Error = **errp) return; } =20 - phb->stack =3D pnv_phb4_get_stack(chip, phb, &local_err); + stack =3D pnv_phb4_get_stack(chip, phb, &local_err); if (local_err) { error_propagate(errp, local_err); return; @@ -1594,18 +1595,12 @@ static void pnv_phb4_realize(DeviceState *dev, Erro= r **errp) * All other phb properties but 'pec' ad 'version' are * already set. */ - object_property_set_link(OBJECT(phb), "pec", OBJECT(phb->stack->pe= c), + object_property_set_link(OBJECT(phb), "pec", OBJECT(stack->pec), &error_abort); pecc =3D PNV_PHB4_PEC_GET_CLASS(phb->pec); object_property_set_int(OBJECT(phb), "version", pecc->version, &error_fatal); =20 - /* - * Assign stack->phb since pnv_phb4_update_regions() uses it - * to access the phb. - */ - phb->stack->phb =3D phb; - /* * Reparent user created devices to the chip to build * correctly the device tree. @@ -1707,8 +1702,6 @@ static Property pnv_phb4_properties[] =3D { DEFINE_PROP_UINT32("index", PnvPHB4, phb_id, 0), DEFINE_PROP_UINT32("chip-id", PnvPHB4, chip_id, 0), DEFINE_PROP_UINT64("version", PnvPHB4, version, 0), - DEFINE_PROP_LINK("stack", PnvPHB4, stack, TYPE_PNV_PHB4_PEC_STACK, - PnvPhb4PecStack *), DEFINE_PROP_LINK("pec", PnvPHB4, pec, TYPE_PNV_PHB4_PEC, PnvPhb4PecState *), DEFINE_PROP_END_OF_LIST(), diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c index 22194b8de2..ed1d644182 100644 --- a/hw/pci-host/pnv_phb4_pec.c +++ b/hw/pci-host/pnv_phb4_pec.c @@ -293,8 +293,6 @@ static void pnv_pec_stk_default_phb_realize(PnvPhb4PecS= tack *stack, &error_fatal); object_property_set_int(OBJECT(stack->phb), "version", pecc->version, &error_fatal); - object_property_set_link(OBJECT(stack->phb), "stack", OBJECT(stack), - &error_abort); =20 if (!sysbus_realize(SYS_BUS_DEVICE(stack->phb), errp)) { return; diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index 1d27e4c0cb..a9059b7279 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -151,8 +151,6 @@ struct PnvPHB4 { XiveSource xsrc; qemu_irq *qirqs; =20 - PnvPhb4PecStack *stack; - QLIST_HEAD(, PnvPhb4DMASpace) dma_spaces; }; =20 --=20 2.33.1 From nobody Fri Apr 26 05:34:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642183794052934.7534958793915; Fri, 14 Jan 2022 10:09:54 -0800 (PST) Received: from localhost ([::1]:36924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8R1M-00005p-SF for importer@patchew.org; Fri, 14 Jan 2022 13:09:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8QzF-0005gI-7g; Fri, 14 Jan 2022 13:07:41 -0500 Received: from [2607:f8b0:4864:20::c34] (port=35730 helo=mail-oo1-xc34.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8QzD-0000Oi-Hx; Fri, 14 Jan 2022 13:07:40 -0500 Received: by mail-oo1-xc34.google.com with SMTP id q15-20020a4a6c0f000000b002dc415427d3so2785626ooc.2; Fri, 14 Jan 2022 10:07:38 -0800 (PST) Received: from rekt.COMFAST ([152.249.109.193]) by smtp.gmail.com with ESMTPSA id e17sm1353584otr.13.2022.01.14.10.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 10:07:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qSLl+cOxpZwCNfrBCEshtGdu1AAwLTRzg6xsRSIPD+k=; b=nui1qTQ0c+3JvoXW3BvvrnprwaFU4ueVqPfLKqRoCbbDOE+Hv+fM/xemueukL7JrjB 4Us+hYiZSdr/tW/Epf7sCOZ3sGKH9JRwfjKJMNEok6Mx41oWzU26ADZNy8tZmfVH4+BJ csvWhO/nTIbjAzfwWiUKOgGfEEwy3q7EtzObJb0aDzBEbMl0K8l3QVQxUuOJoJC0DMhc /AsGn5NdnHTAcbFzWlAOIKcas6kq+fDCFl/ydrBsZ0jCqp93hpzmfnrYWDfz5CLcCYPL XxSSo1BlgGTPzziOrj1uXUrSQ6bqvghHBLyOwcD5CzTr07uZzRNzvhU+zHzMxdiRLBbw XMDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qSLl+cOxpZwCNfrBCEshtGdu1AAwLTRzg6xsRSIPD+k=; b=TNtHFb92xFZ64nXdEWDeuzfQPj77SMmYDmMXoGec1/cmU/pMhdObrr50iJK3eeQ6Rn 3A5Cg4dhDbxra78xTCxkUVKN2zQyc/4AdaCRUDpKax90wQKrS9jzLa3zrGDIEtjnW71x 7fJLwLYkTWTD+K5ow1xwaZPdCBE2TFhPH+VoNdWPRn6dL8JiSyMJ8KE+/uqWE0AbWqax HGNLtNDJ33qHUKAfI4PE7f/foBzRJwM8GDb4ie2rzH4zva9gKqZjLiccPjsSkavs3xy3 KxIuC+En3pvvnig7SIogh+HKu5IkFKknm8VFZQCZNbKj9yH2Jo56KFbV3n+Qg7uaHNiQ iinQ== X-Gm-Message-State: AOAM532O6u9CKqFMMYJXSOszHOA2y+SBqteb8EbcT2oYYIvEbtdPmnFi 4INOSuMyv7v1Aa/WaMoZD9ZMnL8jBWSxDkBl X-Google-Smtp-Source: ABdhPJycENJsrO28Ewh77z9NIEMAfT4jTtMx2kNpPfHKrisdJ4ZUf6FBMAMh2Wt1BdgPhH1JjTeGkg== X-Received: by 2002:a4a:b2c3:: with SMTP id l3mr7349502ooo.58.1642183657172; Fri, 14 Jan 2022 10:07:37 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v2 4/8] ppc/pnv: move default_phb_realize() to pec_realize() Date: Fri, 14 Jan 2022 15:07:15 -0300 Message-Id: <20220114180719.52117-5-danielhb413@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220114180719.52117-1-danielhb413@gmail.com> References: <20220114180719.52117-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::c34 (failed) 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::c34; envelope-from=danielhb413@gmail.com; helo=mail-oo1-xc34.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Daniel Henrique Barboza , qemu-ppc@nongnu.org, clg@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642183795961100001 Move the current pnv_pec_stk_default_phb_realize() call to pec_realize(), renaming the function to pnv_pec_default_phb_realize(), and set the PHB attributes using the PEC object directly. This will be important to allow for PECs devices to handle PHB4s directly later on. Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Daniel Henrique Barboza --- hw/pci-host/pnv_phb4_pec.c | 63 ++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c index ed1d644182..a80a21db77 100644 --- a/hw/pci-host/pnv_phb4_pec.c +++ b/hw/pci-host/pnv_phb4_pec.c @@ -112,6 +112,30 @@ static const MemoryRegionOps pnv_pec_pci_xscom_ops =3D= { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 +static void pnv_pec_default_phb_realize(PnvPhb4PecStack *stack, + int stack_no, + Error **errp) +{ + PnvPhb4PecState *pec =3D stack->pec; + PnvPhb4PecClass *pecc =3D PNV_PHB4_PEC_GET_CLASS(pec); + int phb_id =3D pnv_phb4_pec_get_phb_id(pec, stack_no); + + stack->phb =3D PNV_PHB4(qdev_new(TYPE_PNV_PHB4)); + + object_property_set_link(OBJECT(stack->phb), "pec", OBJECT(pec), + &error_abort); + object_property_set_int(OBJECT(stack->phb), "chip-id", pec->chip_id, + &error_fatal); + object_property_set_int(OBJECT(stack->phb), "index", phb_id, + &error_fatal); + object_property_set_int(OBJECT(stack->phb), "version", pecc->version, + &error_fatal); + + if (!sysbus_realize(SYS_BUS_DEVICE(stack->phb), errp)) { + return; + } +} + static void pnv_pec_instance_init(Object *obj) { PnvPhb4PecState *pec =3D PNV_PHB4_PEC(obj); @@ -144,6 +168,15 @@ static void pnv_pec_realize(DeviceState *dev, Error **= errp) =20 object_property_set_int(stk_obj, "stack-no", i, &error_abort); object_property_set_link(stk_obj, "pec", OBJECT(pec), &error_abort= ); + + if (defaults_enabled()) { + pnv_pec_default_phb_realize(stack, i, errp); + } + + /* + * qdev gets angry if we don't realize 'stack' here, even + * if stk_realize() is now empty. + */ if (!qdev_realize(DEVICE(stk_obj), NULL, errp)) { return; } @@ -276,38 +309,8 @@ static const TypeInfo pnv_pec_type_info =3D { } }; =20 -static void pnv_pec_stk_default_phb_realize(PnvPhb4PecStack *stack, - Error **errp) -{ - PnvPhb4PecState *pec =3D stack->pec; - PnvPhb4PecClass *pecc =3D PNV_PHB4_PEC_GET_CLASS(pec); - int phb_id =3D pnv_phb4_pec_get_phb_id(pec, stack->stack_no); - - stack->phb =3D PNV_PHB4(qdev_new(TYPE_PNV_PHB4)); - - object_property_set_link(OBJECT(stack->phb), "pec", OBJECT(pec), - &error_abort); - object_property_set_int(OBJECT(stack->phb), "chip-id", pec->chip_id, - &error_fatal); - object_property_set_int(OBJECT(stack->phb), "index", phb_id, - &error_fatal); - object_property_set_int(OBJECT(stack->phb), "version", pecc->version, - &error_fatal); - - if (!sysbus_realize(SYS_BUS_DEVICE(stack->phb), errp)) { - return; - } -} - static void pnv_pec_stk_realize(DeviceState *dev, Error **errp) { - PnvPhb4PecStack *stack =3D PNV_PHB4_PEC_STACK(dev); - - if (!defaults_enabled()) { - return; - } - - pnv_pec_stk_default_phb_realize(stack, errp); } =20 static Property pnv_pec_stk_properties[] =3D { --=20 2.33.1 From nobody Fri Apr 26 05:34:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642184167378421.73695143138; Fri, 14 Jan 2022 10:16:07 -0800 (PST) Received: from localhost ([::1]:49122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8R7N-0008Ma-Py for importer@patchew.org; Fri, 14 Jan 2022 13:16:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8QzG-0005jC-Bw; Fri, 14 Jan 2022 13:07:42 -0500 Received: from [2607:f8b0:4864:20::c35] (port=37562 helo=mail-oo1-xc35.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8QzE-0000Ot-GT; Fri, 14 Jan 2022 13:07:42 -0500 Received: by mail-oo1-xc35.google.com with SMTP id p11-20020a4adfcb000000b002dd4a3e84beso2790302ood.4; Fri, 14 Jan 2022 10:07:39 -0800 (PST) Received: from rekt.COMFAST ([152.249.109.193]) by smtp.gmail.com with ESMTPSA id e17sm1353584otr.13.2022.01.14.10.07.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 10:07:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qpwkERfVTCeSqn5sNm4lZEtFIEicamQqN26TtaIo6MU=; b=HkHsnNOXB0IETWoqn45EJBreFn2PQd1q3cW2OhEkxeRa7gEJzrv4ctLN1FmEEVJorY RYNUkV1hn36aOWebzPbw0OmItGc57mci67Hgl2xjKvA4XsCYr8Wf9NV6zITgspM8JUMp ELrCvrcZGDxHtzZE8rOvHVJEHrnhzCShoWOUdc5dbARoQ51KV3l+sW18TXXNhuHqsZvp SPHrS/e5KdSLXade3lTLTnrQyqO0c9Zvol54Zae9xByz3WdwPy/anykorcIPBDjx0GBN FGCjhSUkXWhsOYYoeFjPXz4mh0HDkoSDH9FKWjd9m24ai454wv+ttrW3mLoxTsGad2Bd oMBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qpwkERfVTCeSqn5sNm4lZEtFIEicamQqN26TtaIo6MU=; b=l8NXYDKprasCGoshxYWAm38mopkbAZlRCSHFwDS3/9iIp7lYmTNSg5hQX1JWe29D07 D97mMl4k8UvGI9eSjG3KvPfX/B5ZCoewMpOu0bXS3Us3qieYDj9N+BNWqsSGdkvcqfyW 4Hqy+/HZF5And+VbBdrFTlFN0I/WsH604TAeQzRm8gxsmmkVTbjyzxo1W7YQLRTsBrd9 fFQ4BPOnF5SBmHEhqMUHik9fKJOcAhMVoAIMq6HHj8BYELgDqd6Gapv2/C1+5NVNq8FJ wfQ9gDduouLghnZ2R29iCy7dZ46BsAE1pYAUTpKLI9H9dl+WbxfmetE0QsMNmdmjFnLm S4CA== X-Gm-Message-State: AOAM530D0FhUP4DWxo4HdYPL5uKdoYa9pcXCMlmh2zFDDvib3VMwMjKY 8UPVHxRrHbdv58H6yNJzkjOiog4MPgOYKI5W X-Google-Smtp-Source: ABdhPJx64EDQXXPmvu6VSzhlLaQWJazmC6YtR4fN8Wn1gZFLn0RyoAEdKMrKaIiYwGo6dpdJk8/YSA== X-Received: by 2002:a4a:3412:: with SMTP id b18mr7242865ooa.23.1642183659110; Fri, 14 Jan 2022 10:07:39 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v2 5/8] ppc/pnv: remove PnvPhb4PecStack::stack_no Date: Fri, 14 Jan 2022 15:07:16 -0300 Message-Id: <20220114180719.52117-6-danielhb413@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220114180719.52117-1-danielhb413@gmail.com> References: <20220114180719.52117-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::c35 (failed) 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::c35; envelope-from=danielhb413@gmail.com; helo=mail-oo1-xc35.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Daniel Henrique Barboza , qemu-ppc@nongnu.org, clg@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642184169543100001 Content-Type: text/plain; charset="utf-8" pnv_pec_default_phb_realize() stopped using it after the previous patch and no one else is using it. Signed-off-by: Daniel Henrique Barboza Reviewed-by: C=C3=A9dric Le Goater --- hw/pci-host/pnv_phb4_pec.c | 2 -- include/hw/pci-host/pnv_phb4.h | 3 --- 2 files changed, 5 deletions(-) diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c index a80a21db77..d6405d6ca3 100644 --- a/hw/pci-host/pnv_phb4_pec.c +++ b/hw/pci-host/pnv_phb4_pec.c @@ -166,7 +166,6 @@ static void pnv_pec_realize(DeviceState *dev, Error **e= rrp) PnvPhb4PecStack *stack =3D &pec->stacks[i]; Object *stk_obj =3D OBJECT(stack); =20 - object_property_set_int(stk_obj, "stack-no", i, &error_abort); object_property_set_link(stk_obj, "pec", OBJECT(pec), &error_abort= ); =20 if (defaults_enabled()) { @@ -314,7 +313,6 @@ static void pnv_pec_stk_realize(DeviceState *dev, Error= **errp) } =20 static Property pnv_pec_stk_properties[] =3D { - DEFINE_PROP_UINT32("stack-no", PnvPhb4PecStack, stack_no, 0), DEFINE_PROP_LINK("pec", PnvPhb4PecStack, pec, TYPE_PNV_PHB4_PEC, PnvPhb4PecState *), DEFINE_PROP_END_OF_LIST(), diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index a9059b7279..2be56b7afd 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -171,9 +171,6 @@ OBJECT_DECLARE_SIMPLE_TYPE(PnvPhb4PecStack, PNV_PHB4_PE= C_STACK) struct PnvPhb4PecStack { DeviceState parent; =20 - /* My own stack number */ - uint32_t stack_no; - /* The owner PEC */ PnvPhb4PecState *pec; =20 --=20 2.33.1 From nobody Fri Apr 26 05:34:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642184463976309.99377760321033; Fri, 14 Jan 2022 10:21:03 -0800 (PST) Received: from localhost ([::1]:56906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8RCA-0005Ic-8L for importer@patchew.org; Fri, 14 Jan 2022 13:21:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8QzI-0005rO-Tl; Fri, 14 Jan 2022 13:07:44 -0500 Received: from [2607:f8b0:4864:20::335] (port=38436 helo=mail-ot1-x335.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8QzG-0000PQ-Lu; Fri, 14 Jan 2022 13:07:44 -0500 Received: by mail-ot1-x335.google.com with SMTP id g1-20020a9d6481000000b00592d01f2b6eso6891774otl.5; Fri, 14 Jan 2022 10:07:42 -0800 (PST) Received: from rekt.COMFAST ([152.249.109.193]) by smtp.gmail.com with ESMTPSA id e17sm1353584otr.13.2022.01.14.10.07.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 10:07:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Kn8c/M2hPBBRuoQrXKDiUzeXFCTjuWaIarKvfv/zNTE=; b=UodZ2Kv5qhmZmxzEb5bCVEE5YNsZB0U8RHGPqZPra5M58DOfglCJ3kX3EYGJ6F2iTS AaW9AniqPe2B9aOUu11/ChtIzTGGHWRuACdDkE+k7F60glLyY/YnnNsEtsGaPOEtdCis WNkxxUYK3AkznRjmUGxc9W0gpbF60cirh6S4EwyCZWGHHjicnESdRglKUEooVNY6+oW8 fwoPaMndvhoDUDHUDQtN+KoZJI5d/JV3nyDXH4HOY5GCwnIFlqH4YKkWB2DPlGIhqHYx wUQ39OLyaFEuGfU9mL6eMxJWbUfnH54pJ14nQOmxDx72NXPHcCHodkOFJs45/+JMrZ8h Pixw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Kn8c/M2hPBBRuoQrXKDiUzeXFCTjuWaIarKvfv/zNTE=; b=GJGrV6bhDYYoNycFhWmZvCqCyYrbpmqilCuPLI17aA3vxMOlUpjQqpMxdkXqfhWH/0 ipzPkxqtwC9Flpk7pnYp+G1knNgC6mudzhyve2I0nBLUrz5Xw+lKOEsDWeD/GMnYduMf Z+3aAlJ2GUQia3j0qKSLAdoxgxDhO2Hp+GxHwvbsG87MmK93rWnTiu0OZNtzAEYBAxvk GqFeBEU6jXvQbwwkLjZA1U7+p8Vsu3UiIZMBv4/Lba/TQNGmCVxpgUHZZQwzGEOcZECe ge+S4DMNFQcjsyP0Ps1mRmRLFFkkB0UW61QzCOom9oYzK/aiS/NV+QpPseE33ZwdFXRy BDkg== X-Gm-Message-State: AOAM532uaJushAVrrgYGvAYATL70yfhBzwNR2jD6b+dz7ewbi5umUA9l xAYMx40PtwkzaTA2UJT1o7Sk1LrqzF+mJBmf X-Google-Smtp-Source: ABdhPJxPYWPpA+ZGUuIff3oilAWtPbNAM9P5aRc936xSueMUEdcP16RXLX4EvS7jP4lHUeqHwhhMzw== X-Received: by 2002:a9d:5a03:: with SMTP id v3mr7814635oth.17.1642183661176; Fri, 14 Jan 2022 10:07:41 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v2 6/8] ppc/pnv: make PECs create and realize PHB4s Date: Fri, 14 Jan 2022 15:07:17 -0300 Message-Id: <20220114180719.52117-7-danielhb413@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220114180719.52117-1-danielhb413@gmail.com> References: <20220114180719.52117-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::335 (failed) 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::335; envelope-from=danielhb413@gmail.com; helo=mail-ot1-x335.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Daniel Henrique Barboza , qemu-ppc@nongnu.org, clg@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642184464927100001 Content-Type: text/plain; charset="utf-8" This patch changes the design of the PEC device to create and realize PHB4s instead of PecStacks. After all the recent changes, PHB4s now contain all the information needed for their proper functioning, not relying on PecStack in any capacity. All changes are being made in a single patch to avoid renaming parts of the PecState and leaving the code in a strange way. E.g. rename PecClass->num_stacks to num_phbs, which would then read a pnv_pec_num_stacks[] array. To avoid mixing the old and new design more than necessary it's clearer to do these changes in a single step. The name changes made are: - in PnvPhb4PecState: * rename 'num_stacks' to 'num_phbs' * remove the pec->stacks[] array. Current code relies on the pec->stacks[] obj acting as a simple container, without ever accessing pec->stacks[] for any other purpose. Instead of converting this into a pec->phbs[] array, remove it - in PnvPhb4PecClass, rename *num_stacks to *num_phbs; - pnv_pec_num_stacks[] is renamed to pnv_pec_num_phbs[]. The logical changes: - pnv_pec_default_phb_realize(): * init and set the properties of the PnvPHB4 qdev * do not use stack->phb anymore; - pnv_pec_realize(): * use the new default_phb_realize() to init/realize each PHB if running with defaults; - pnv_pec_instance_init(): removed since we're creating the PHBs during pec_realize(); - pnv_phb4_get_stack(): * renamed to pnv_phb4_get_pec() and returns a PnvPhb4PecState*; - pnv_phb4_realize(): use 'phb->pec' instead of 'stack'. This design change shouldn't caused any behavioral change in the runtime of the machine. Signed-off-by: Daniel Henrique Barboza Reviewed-by: C=C3=A9dric Le Goater --- hw/pci-host/pnv_phb4.c | 26 ++++++-------- hw/pci-host/pnv_phb4_pec.c | 66 ++++++++++------------------------ include/hw/pci-host/pnv_phb4.h | 8 ++--- 3 files changed, 31 insertions(+), 69 deletions(-) diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 2efd34518e..3dc3c70cb2 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -884,7 +884,7 @@ static int pnv_phb4_get_phb_stack_no(PnvPHB4 *phb) int stack_no =3D phb->phb_id; =20 while (index--) { - stack_no -=3D pecc->num_stacks[index]; + stack_no -=3D pecc->num_phbs[index]; } =20 return stack_no; @@ -1383,7 +1383,7 @@ int pnv_phb4_pec_get_phb_id(PnvPhb4PecState *pec, int= stack_index) int offset =3D 0; =20 while (index--) { - offset +=3D pecc->num_stacks[index]; + offset +=3D pecc->num_phbs[index]; } =20 return offset + stack_index; @@ -1534,8 +1534,8 @@ static void pnv_phb4_instance_init(Object *obj) object_initialize_child(obj, "source", &phb->xsrc, TYPE_XIVE_SOURCE); } =20 -static PnvPhb4PecStack *pnv_phb4_get_stack(PnvChip *chip, PnvPHB4 *phb, - Error **errp) +static PnvPhb4PecState *pnv_phb4_get_pec(PnvChip *chip, PnvPHB4 *phb, + Error **errp) { Pnv9Chip *chip9 =3D PNV9_CHIP(chip); int chip_id =3D phb->chip_id; @@ -1544,14 +1544,14 @@ static PnvPhb4PecStack *pnv_phb4_get_stack(PnvChip = *chip, PnvPHB4 *phb, =20 for (i =3D 0; i < chip->num_pecs; i++) { /* - * For each PEC, check the amount of stacks it supports - * and see if the given phb4 index matches a stack. + * For each PEC, check the amount of phbs it supports + * and see if the given phb4 index matches an index. */ PnvPhb4PecState *pec =3D &chip9->pecs[i]; =20 - for (j =3D 0; j < pec->num_stacks; j++) { + for (j =3D 0; j < pec->num_phbs; j++) { if (index =3D=3D pnv_phb4_pec_get_phb_id(pec, j)) { - return &pec->stacks[j]; + return pec; } } } @@ -1576,7 +1576,6 @@ static void pnv_phb4_realize(DeviceState *dev, Error = **errp) if (!phb->pec) { PnvMachineState *pnv =3D PNV_MACHINE(qdev_get_machine()); PnvChip *chip =3D pnv_get_chip(pnv, phb->chip_id); - PnvPhb4PecStack *stack; PnvPhb4PecClass *pecc; BusState *s; =20 @@ -1585,18 +1584,13 @@ static void pnv_phb4_realize(DeviceState *dev, Erro= r **errp) return; } =20 - stack =3D pnv_phb4_get_stack(chip, phb, &local_err); + phb->pec =3D pnv_phb4_get_pec(chip, phb, &local_err); if (local_err) { error_propagate(errp, local_err); return; } =20 - /* - * All other phb properties but 'pec' ad 'version' are - * already set. - */ - object_property_set_link(OBJECT(phb), "pec", OBJECT(stack->pec), - &error_abort); + /* All other phb properties are already set */ pecc =3D PNV_PHB4_PEC_GET_CLASS(phb->pec); object_property_set_int(OBJECT(phb), "version", pecc->version, &error_fatal); diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c index d6405d6ca3..852816b9f8 100644 --- a/hw/pci-host/pnv_phb4_pec.c +++ b/hw/pci-host/pnv_phb4_pec.c @@ -112,41 +112,28 @@ static const MemoryRegionOps pnv_pec_pci_xscom_ops = =3D { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 -static void pnv_pec_default_phb_realize(PnvPhb4PecStack *stack, +static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec, int stack_no, Error **errp) { - PnvPhb4PecState *pec =3D stack->pec; + PnvPHB4 *phb =3D PNV_PHB4(qdev_new(TYPE_PNV_PHB4)); PnvPhb4PecClass *pecc =3D PNV_PHB4_PEC_GET_CLASS(pec); int phb_id =3D pnv_phb4_pec_get_phb_id(pec, stack_no); =20 - stack->phb =3D PNV_PHB4(qdev_new(TYPE_PNV_PHB4)); - - object_property_set_link(OBJECT(stack->phb), "pec", OBJECT(pec), + object_property_set_link(OBJECT(phb), "pec", OBJECT(pec), &error_abort); - object_property_set_int(OBJECT(stack->phb), "chip-id", pec->chip_id, + object_property_set_int(OBJECT(phb), "chip-id", pec->chip_id, &error_fatal); - object_property_set_int(OBJECT(stack->phb), "index", phb_id, + object_property_set_int(OBJECT(phb), "index", phb_id, &error_fatal); - object_property_set_int(OBJECT(stack->phb), "version", pecc->version, + object_property_set_int(OBJECT(phb), "version", pecc->version, &error_fatal); =20 - if (!sysbus_realize(SYS_BUS_DEVICE(stack->phb), errp)) { + if (!sysbus_realize(SYS_BUS_DEVICE(phb), errp)) { return; } } =20 -static void pnv_pec_instance_init(Object *obj) -{ - PnvPhb4PecState *pec =3D PNV_PHB4_PEC(obj); - int i; - - for (i =3D 0; i < PHB4_PEC_MAX_STACKS; i++) { - object_initialize_child(obj, "stack[*]", &pec->stacks[i], - TYPE_PNV_PHB4_PEC_STACK); - } -} - static void pnv_pec_realize(DeviceState *dev, Error **errp) { PnvPhb4PecState *pec =3D PNV_PHB4_PEC(dev); @@ -159,29 +146,13 @@ static void pnv_pec_realize(DeviceState *dev, Error *= *errp) return; } =20 - pec->num_stacks =3D pecc->num_stacks[pec->index]; - - /* Create stacks */ - for (i =3D 0; i < pec->num_stacks; i++) { - PnvPhb4PecStack *stack =3D &pec->stacks[i]; - Object *stk_obj =3D OBJECT(stack); - - object_property_set_link(stk_obj, "pec", OBJECT(pec), &error_abort= ); + pec->num_phbs =3D pecc->num_phbs[pec->index]; =20 - if (defaults_enabled()) { - pnv_pec_default_phb_realize(stack, i, errp); + /* Create PHBs if running with defaults */ + if (defaults_enabled()) { + for (i =3D 0; i < pec->num_phbs; i++) { + pnv_pec_default_phb_realize(pec, i, errp); } - - /* - * qdev gets angry if we don't realize 'stack' here, even - * if stk_realize() is now empty. - */ - if (!qdev_realize(DEVICE(stk_obj), NULL, errp)) { - return; - } - } - for (; i < PHB4_PEC_MAX_STACKS; i++) { - object_unparent(OBJECT(&pec->stacks[i])); } =20 /* Initialize the XSCOM regions for the PEC registers */ @@ -227,7 +198,7 @@ static int pnv_pec_dt_xscom(PnvXScomInterface *dev, voi= d *fdt, _FDT((fdt_setprop(fdt, offset, "compatible", pecc->compat, pecc->compat_size))); =20 - for (i =3D 0; i < pec->num_stacks; i++) { + for (i =3D 0; i < pec->num_phbs; i++) { int phb_id =3D pnv_phb4_pec_get_phb_id(pec, i); int stk_offset; =20 @@ -263,11 +234,11 @@ static uint32_t pnv_pec_xscom_nest_base(PnvPhb4PecSta= te *pec) } =20 /* - * PEC0 -> 1 stack - * PEC1 -> 2 stacks - * PEC2 -> 3 stacks + * PEC0 -> 1 phb + * PEC1 -> 2 phb + * PEC2 -> 3 phbs */ -static const uint32_t pnv_pec_num_stacks[] =3D { 1, 2, 3 }; +static const uint32_t pnv_pec_num_phbs[] =3D { 1, 2, 3 }; =20 static void pnv_pec_class_init(ObjectClass *klass, void *data) { @@ -292,14 +263,13 @@ static void pnv_pec_class_init(ObjectClass *klass, vo= id *data) pecc->stk_compat =3D stk_compat; pecc->stk_compat_size =3D sizeof(stk_compat); pecc->version =3D PNV_PHB4_VERSION; - pecc->num_stacks =3D pnv_pec_num_stacks; + pecc->num_phbs =3D pnv_pec_num_phbs; } =20 static const TypeInfo pnv_pec_type_info =3D { .name =3D TYPE_PNV_PHB4_PEC, .parent =3D TYPE_DEVICE, .instance_size =3D sizeof(PnvPhb4PecState), - .instance_init =3D pnv_pec_instance_init, .class_init =3D pnv_pec_class_init, .class_size =3D sizeof(PnvPhb4PecClass), .interfaces =3D (InterfaceInfo[]) { diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index 2be56b7afd..e750165e77 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -200,10 +200,8 @@ struct PnvPhb4PecState { uint64_t pci_regs[PHB4_PEC_PCI_REGS_COUNT]; MemoryRegion pci_regs_mr; =20 - /* Stacks */ - #define PHB4_PEC_MAX_STACKS 3 - uint32_t num_stacks; - PnvPhb4PecStack stacks[PHB4_PEC_MAX_STACKS]; + /* PHBs */ + uint32_t num_phbs; =20 PnvChip *chip; }; @@ -221,7 +219,7 @@ struct PnvPhb4PecClass { const char *stk_compat; int stk_compat_size; uint64_t version; - const uint32_t *num_stacks; + const uint32_t *num_phbs; }; =20 #endif /* PCI_HOST_PNV_PHB4_H */ --=20 2.33.1 From nobody Fri Apr 26 05:34:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642183798199155.63213218975477; Fri, 14 Jan 2022 10:09:58 -0800 (PST) Received: from localhost ([::1]:37296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8R1R-0000Ln-6G for importer@patchew.org; Fri, 14 Jan 2022 13:09:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8QzK-0005wa-90; Fri, 14 Jan 2022 13:07:46 -0500 Received: from [2607:f8b0:4864:20::22e] (port=33312 helo=mail-oi1-x22e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8QzI-0000Py-JX; Fri, 14 Jan 2022 13:07:45 -0500 Received: by mail-oi1-x22e.google.com with SMTP id x193so13295844oix.0; Fri, 14 Jan 2022 10:07:43 -0800 (PST) Received: from rekt.COMFAST ([152.249.109.193]) by smtp.gmail.com with ESMTPSA id e17sm1353584otr.13.2022.01.14.10.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 10:07:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+s3nhtSk2YpzWrGuoOJzW9TunNDpdDP8jlJZEj/uFJ0=; b=QPucnjcUzn1Hrc37ySoRoExFIen76RwJlM0y5nMJ/QerLjYEKDGgYnufxQGVgRYmrc FxuC4wih96kBA1jEQP3Q682QCj6TXXLWUOo+Zk+A0kXZuLQDu/yiC6SSWvGoGxyrkKyd pgoH9iP5TCQ0zp5MFSWe4rpl7o/PEg5WBVCH3YK0nQcqvpjldz+qVHAZkjLomEHkPspN a4t47KxScFL6Rv8bHQnoeBJ13LWV/zRXC7Aes8mfKs4TadAB3ioG8RQ+I4Oeok61XJ+o JW6Psslqap3Xok0KFX8nFMQOHIAMzC9C9MOzZRW0I9CY7Lfb6NBnk1OJDGz72iaa1PXw LsqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+s3nhtSk2YpzWrGuoOJzW9TunNDpdDP8jlJZEj/uFJ0=; b=aRE+kkGR04khlnRdivZ2wAcaG/zudoF/x5TBlLnAzXN8Lrfydgcxx4sV7qccrQcBFG p9Uh0/jX10IJ83mkI25Ndiz3B2IxtXIcEto/GhrkjdA6hu+sTi5ivpoZ8byqmKeQeNcx cMdQf2CHHNyUeO2zowT+nrPCj97qihubxwuihg3kOvAKSWw9iFr/MLBRIQKJe72brsa9 3rsIpWuMovkSiZhdkpVKNNen5TKCBWikwcRBhLc9zlKYMKyx8cAELt9BF1yagkkeB2kh vMu7ILBjRi8zdYToO3zAedr/JOJjOHO6yPiVCxjTnon1FqOE9XYmxveasDUTCrewZ3EF e5Pw== X-Gm-Message-State: AOAM532c74I9t7sbdL/wLhsRoXE/Kuv7PfIm6tz1oF+pTBdt94KZGpGN ETTlaCN3zvlV877lDeXG6XxtvSBI2MAZS9rP X-Google-Smtp-Source: ABdhPJyQQRcAsH6PceZxVo+pLpOLy8yjfq1Te8WIwpkr83BxfMkCj4AOhUCUkl09v6CEVcdjKN3tgQ== X-Received: by 2002:a05:6808:91a:: with SMTP id w26mr101907oih.145.1642183663211; Fri, 14 Jan 2022 10:07:43 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v2 7/8] ppc/pnv: remove PnvPhb4PecStack object Date: Fri, 14 Jan 2022 15:07:18 -0300 Message-Id: <20220114180719.52117-8-danielhb413@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220114180719.52117-1-danielhb413@gmail.com> References: <20220114180719.52117-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::22e (failed) 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::22e; envelope-from=danielhb413@gmail.com; helo=mail-oi1-x22e.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Daniel Henrique Barboza , qemu-ppc@nongnu.org, clg@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642183800394100001 All the complexity that was scattered between PnvPhb4PecStack and PnvPHB4 are now centered in the PnvPHB4 device. PnvPhb4PecStack does not serve any purpose in the current code base. Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Daniel Henrique Barboza --- hw/pci-host/pnv_phb4_pec.c | 33 --------------------------------- include/hw/pci-host/pnv_phb4.h | 17 ----------------- 2 files changed, 50 deletions(-) diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c index 852816b9f8..12aa459628 100644 --- a/hw/pci-host/pnv_phb4_pec.c +++ b/hw/pci-host/pnv_phb4_pec.c @@ -278,42 +278,9 @@ static const TypeInfo pnv_pec_type_info =3D { } }; =20 -static void pnv_pec_stk_realize(DeviceState *dev, Error **errp) -{ -} - -static Property pnv_pec_stk_properties[] =3D { - DEFINE_PROP_LINK("pec", PnvPhb4PecStack, pec, TYPE_PNV_PHB4_PEC, - PnvPhb4PecState *), - DEFINE_PROP_END_OF_LIST(), -}; - -static void pnv_pec_stk_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc =3D DEVICE_CLASS(klass); - - device_class_set_props(dc, pnv_pec_stk_properties); - dc->realize =3D pnv_pec_stk_realize; - dc->user_creatable =3D false; - - /* TODO: reset regs ? */ -} - -static const TypeInfo pnv_pec_stk_type_info =3D { - .name =3D TYPE_PNV_PHB4_PEC_STACK, - .parent =3D TYPE_DEVICE, - .instance_size =3D sizeof(PnvPhb4PecStack), - .class_init =3D pnv_pec_stk_class_init, - .interfaces =3D (InterfaceInfo[]) { - { TYPE_PNV_XSCOM_INTERFACE }, - { } - } -}; - static void pnv_pec_register_types(void) { type_register_static(&pnv_pec_type_info); - type_register_static(&pnv_pec_stk_type_info); } =20 type_init(pnv_pec_register_types); diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index e750165e77..74fdec2b47 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -164,23 +164,6 @@ extern const MemoryRegionOps pnv_phb4_xscom_ops; #define TYPE_PNV_PHB4_PEC "pnv-phb4-pec" OBJECT_DECLARE_TYPE(PnvPhb4PecState, PnvPhb4PecClass, PNV_PHB4_PEC) =20 -#define TYPE_PNV_PHB4_PEC_STACK "pnv-phb4-pec-stack" -OBJECT_DECLARE_SIMPLE_TYPE(PnvPhb4PecStack, PNV_PHB4_PEC_STACK) - -/* Per-stack data */ -struct PnvPhb4PecStack { - DeviceState parent; - - /* The owner PEC */ - PnvPhb4PecState *pec; - - /* - * PHB4 pointer. pnv_phb4_update_regions() needs to access - * the PHB4 via a PnvPhb4PecStack pointer. - */ - PnvPHB4 *phb; -}; - struct PnvPhb4PecState { DeviceState parent; =20 --=20 2.33.1 From nobody Fri Apr 26 05:34:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642184575546584.6495741510856; Fri, 14 Jan 2022 10:22:55 -0800 (PST) Received: from localhost ([::1]:34032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8RDy-0000WA-JQ for importer@patchew.org; Fri, 14 Jan 2022 13:22:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8QzM-00063D-8Q; Fri, 14 Jan 2022 13:07:48 -0500 Received: from [2607:f8b0:4864:20::233] (port=35751 helo=mail-oi1-x233.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8QzK-0000QH-JL; Fri, 14 Jan 2022 13:07:47 -0500 Received: by mail-oi1-x233.google.com with SMTP id s127so13270754oig.2; Fri, 14 Jan 2022 10:07:45 -0800 (PST) Received: from rekt.COMFAST ([152.249.109.193]) by smtp.gmail.com with ESMTPSA id e17sm1353584otr.13.2022.01.14.10.07.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 10:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X5e0WNYOkSb9/7sSS76exmWPGRyaYulA3prv/bx4WpM=; b=Hcr2CV/6GAxvPNkAFwyKf16t7SIgQP7v/jH5SONh23X3SS9/RNK1g4xpAFu/f4yCpo jps/oI+7Khg+1Iv976Qjb9x35sDaWcJvz+0HtPxc98ORG+AoTo2x4aHhVDQ8xyosLuBy vVb715LugvFhI/M/25996CfzFux3lZqPZ7+ElS6eFaXlf3EPolzkGkoRNhzjUHNidYg7 psNanoz9O4VTDZ7Sb2p30/yE9YRJ0SnS+g40+UT2/l1D3VmsBDkaySkncmG2Hty0BDEw CMDFOwmfOP5Cc+76Va1n2ll3DyVzIUx6NRE04eOrc9ONpRnfwD4voL0HiJ4/QyRZemIB Gqgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X5e0WNYOkSb9/7sSS76exmWPGRyaYulA3prv/bx4WpM=; b=CwZbnEmL6/a+Vt0Ej5uZwO0YXDmvRienpRbj0Xbk16jJA9Bx60j/OxNwqXMNktIHAZ vW+WfFR7EWXQzvO8gFGrUuIWMNCuOjZKO27d4/dNmmlJpyDx5gevlilWWFRkZhAjTMja ioY/WSTXroZ2fZiKpGNIgqtxNZDqwlZ69AZk5QwO+xu834Np8e2vFM0EEvhIfhXNPdXm JYPBuDOVubk1gFY6hEv8P/Sqb7BX+Z5BL/EUHY/o2MdtNt01mtivDUEZpKGrfQNPl+XS hi0EmxmnEsJ/JckCy8EzDfIhW2eRW1SW+Lbj4NU+o0SDIXitkBfzVZZclxSjs5S6yoQo WRiQ== X-Gm-Message-State: AOAM531KGIcB83ijjZJW+DOHDyA3rukUC2FYP4E0bvLm4B3QwIv3JHny U8rh8y9m141s2U2A5Idgu2SYxYiNAv1TPvvO X-Google-Smtp-Source: ABdhPJxBj8IvwZvp0Qi20xhdlSF8vdamoPLlsc56xJKbsfiI9yjmVJRxX/tC5h6oyxrD7tfPnU0mgA== X-Received: by 2002:aca:702:: with SMTP id 2mr8456627oih.44.1642183665206; Fri, 14 Jan 2022 10:07:45 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v2 8/8] ppc/pnv: rename pnv_pec_stk_update_map() Date: Fri, 14 Jan 2022 15:07:19 -0300 Message-Id: <20220114180719.52117-9-danielhb413@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220114180719.52117-1-danielhb413@gmail.com> References: <20220114180719.52117-1-danielhb413@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::233 (failed) 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::233; envelope-from=danielhb413@gmail.com; helo=mail-oi1-x233.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Daniel Henrique Barboza , qemu-ppc@nongnu.org, clg@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1642184576882100001 This function does not use 'stack' anymore. Rename it to pnv_pec_phb_update_map(). Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Daniel Henrique Barboza --- hw/pci-host/pnv_phb4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 3dc3c70cb2..1db815b1ab 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -914,7 +914,7 @@ static void pnv_phb4_update_regions(PnvPHB4 *phb) pnv_phb4_check_all_mbt(phb); } =20 -static void pnv_pec_stk_update_map(PnvPHB4 *phb) +static void pnv_pec_phb_update_map(PnvPHB4 *phb) { PnvPhb4PecState *pec =3D phb->pec; MemoryRegion *sysmem =3D get_system_memory(); @@ -1066,7 +1066,7 @@ static void pnv_pec_stk_nest_xscom_write(void *opaque= , hwaddr addr, break; case PEC_NEST_STK_BAR_EN: phb->nest_regs[reg] =3D val & 0xf000000000000000ull; - pnv_pec_stk_update_map(phb); + pnv_pec_phb_update_map(phb); break; case PEC_NEST_STK_DATA_FRZ_TYPE: case PEC_NEST_STK_PBCQ_TUN_BAR: --=20 2.33.1