From nobody Sun Nov 24 21:41:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1720707583; cv=none; d=zohomail.com; s=zohoarc; b=ASQwusjKcYiv/3e4EwadMV+R1pf6nK7HKQTjXpBgiAFREYv7r/yjOavLN0azKoFjnAZsPh7ufweGF4dgenaqeNY4Z06IoOn1XI6Z0PjL87VDJYvEm104siH86DvJjj4KuQQO3nlT2fJpKlybAGlFcUS08UxOWkgWS+aVkR2dgJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720707583; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=k/0JQNiQg7zbx/VBkr1CcWf+JFBJuc5tZvRHhkhIoiY=; b=nE13an0NPw1XFa5uJEfqpYqlk33BaXOa0VEmyrRKhSaM/o3z81WSGuocGF8+EUdokTgxrAdDUBhnH5dOQTHGPiWmkxG8WsZ9xoM2sr8NM/2kKpZGIsGbRrFwmongEyYgUEWSnFd8VX/8/nCl3maY5wKszq4GwGs9yTI3xsf1Wok= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720707583495403.80228613542613; Thu, 11 Jul 2024 07:19:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRudj-00037o-16; Thu, 11 Jul 2024 10:19:19 -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 1sRudh-00030W-8J; Thu, 11 Jul 2024 10:19:17 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sRudf-0005Rz-Pu; Thu, 11 Jul 2024 10:19:16 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-70af3d9169bso860182b3a.1; Thu, 11 Jul 2024 07:19:15 -0700 (PDT) Received: from wheely.local0.net ([203.220.44.216]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70b54ec730fsm3308904b3a.173.2024.07.11.07.19.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jul 2024 07:19:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720707553; x=1721312353; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k/0JQNiQg7zbx/VBkr1CcWf+JFBJuc5tZvRHhkhIoiY=; b=FM8c7SRBfQVrREweoXnTMOLORhgolGp/Qi1BpomHqmnCN0JDp6GnZ+5bHqlz6jyre8 eeFDtBHl111MT4ivwQBB4C4c8VjsP/g94BgRlDno8Ux4ysdG+lZd2KknWmh33Eibt/IP 6qF5Jbv8Y6x5OTfTeUOpQt+HlMYVu7zO/R+0EETpBK+Qa5Bq6yDC41SFP6tNhki+VOwF KibDQx3h5Sw4pGxq+v2FjRcwaml674kNYg3IqZxzW706TY04qMM/ord+kfiO24oJfWBE pgEzNZOqVUq57AHB0uBnVsBUlpg5kBJktwCLqwTiFxVnyxPFEDxp5MRCvJAXdeeSn6aP 5gtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720707553; x=1721312353; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k/0JQNiQg7zbx/VBkr1CcWf+JFBJuc5tZvRHhkhIoiY=; b=Mb5gHIgSlsP7RYbygeaz9TSsq04lKe9/+jdC5tg1wJfm+d68oCpbCc27KE2g+iPYFC +fqzpxyU6L6HdC3jCDlPSWP+L1XUahj53Cv39uAK/+GP2dytiXtizXGD0NQ1ZxC4CgjI f4L+quxxGYzYhAQ0j4gxYE+2NCXCW2YOJCiMNQje6OrZX/n+JP0FeBAY6+zSz1bXygT6 I9LPJ63uFriqm1WMxZ6usobX8GALNjkMlBv+wntd2eYB8X67aOf2n5vVj4kTqqYsfOeC 11f/6N4IHDg5i6U6xdCwtkjMzF9JU48a8jdUl7kMp5ZbLtXY7GfFK0jsLhS/+ovP9k2m ebIg== X-Forwarded-Encrypted: i=1; AJvYcCVUfoiB0ubF48/RUV8DP27veDdpRWWjpMmG2dv4HCw45+z8Xrpn754LE78ARz1j9dj19jlTxITHJXdWTGcAempNC27je9U= X-Gm-Message-State: AOJu0Yz5mgVCk4zvU79PE3dxHpJu3EQLwDLdYt7Lobcsh7bK/jnajPXP eLrch+DOQF0SA+i16jbaFzLwoDDITG4mnrCQWWv34K0fPhNTFNQSqZnoCfRj X-Google-Smtp-Source: AGHT+IEHK9hFKCMVXA2i3/XqteYTJn1Byq7QkglNbkLE0opkdHddDU6L82lJ+qFWl4tigtF5IZkzlQ== X-Received: by 2002:a05:6a00:a27:b0:704:2bdd:82fe with SMTP id d2e1a72fcca58-70b4356c534mr9166117b3a.15.1720707553286; Thu, 11 Jul 2024 07:19:13 -0700 (PDT) From: Nicholas Piggin To: qemu-ppc@nongnu.org Cc: Nicholas Piggin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Harsh Prateek Bora , qemu-devel@nongnu.org Subject: [PATCH 03/18] ppc/pnv: Add a pointer from PnvChip to PnvMachineState Date: Fri, 12 Jul 2024 00:18:35 +1000 Message-ID: <20240711141851.406677-4-npiggin@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240711141851.406677-1-npiggin@gmail.com> References: <20240711141851.406677-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=npiggin@gmail.com; helo=mail-pf1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1720707584262116600 Content-Type: text/plain; charset="utf-8" This helps avoid qdev_get_machine() calls. Signed-off-by: Nicholas Piggin --- include/hw/ppc/pnv_chip.h | 2 ++ hw/ppc/pnv.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/hw/ppc/pnv_chip.h b/include/hw/ppc/pnv_chip.h index 4eaa7d3999..decfbc0ff7 100644 --- a/include/hw/ppc/pnv_chip.h +++ b/include/hw/ppc/pnv_chip.h @@ -23,6 +23,8 @@ struct PnvChip { SysBusDevice parent_obj; =20 /*< public >*/ + PnvMachineState *pnv_machine; + uint32_t chip_id; uint64_t ram_start; uint64_t ram_size; diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 7878fed43c..3bcf11984c 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -2202,6 +2202,7 @@ static void pnv_chip_core_realize(PnvChip *chip, Erro= r **errp) return; } =20 + chip->pnv_machine =3D pnv; chip->cores =3D g_new0(PnvCore *, chip->nr_cores); =20 for (i =3D 0, core_hwid =3D 0; (core_hwid < sizeof(chip->cores_mask) *= 8) @@ -2614,7 +2615,7 @@ static void pnv_cpu_do_nmi(PnvChip *chip, PowerPCCPU = *cpu, void *opaque) =20 static void pnv_nmi(NMIState *n, int cpu_index, Error **errp) { - PnvMachineState *pnv =3D PNV_MACHINE(qdev_get_machine()); + PnvMachineState *pnv =3D PNV_MACHINE(n); int i; =20 for (i =3D 0; i < pnv->num_chips; i++) { --=20 2.45.1