From nobody Thu Apr 3 10:03:39 2025 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741276137; cv=none; d=zohomail.com; s=zohoarc; b=KP2sQeGSJ2slyQdC8u68LJreGJt76ZmairX4RuA+paj/qiCh8EYaDM9CfW1ZJtZ0WTRp+L13OKlX6DUs4xaO9+VsDgi8AYtALp9yfMPXjnjbTuPLiUFa1ZHwqXiH+Hx4FFvK+H0/LBDwnkyMN4evMmpZQmmUxpPejWFh0gQ9UXs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741276137; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=ibKdWczve1piqobnZ/7eakxu3MNnTBDuUSaIAp0/9Gg=; b=mfCVWMXT/ByH4RumUu9rZZ8TiAMzE5Zo7vrZpwQZTZeGHoz2cy1ZhdfaxWmF4Q83B8h4eP52kcBS1ifMG4bvwh3pHuHmBpJFj8DxrMvfajV4QbKzgAbtzEzmr8+owvnzjzH9UnpoWqTUCJSmT1zCo18fbuIQcgUxBCib6XmIaBo= 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 1741276137545727.7567728341169; Thu, 6 Mar 2025 07:48:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tqDS6-0007GQ-5s; Thu, 06 Mar 2025 10:48:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tqDS4-0007G2-Fl for qemu-devel@nongnu.org; Thu, 06 Mar 2025 10:48:00 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqDS3-0006Dh-1W for qemu-devel@nongnu.org; Thu, 06 Mar 2025 10:48:00 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43bc63876f1so7438835e9.3 for ; Thu, 06 Mar 2025 07:47:58 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd4291cb9sm53396655e9.13.2025.03.06.07.47.56 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 06 Mar 2025 07:47:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741276077; x=1741880877; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ibKdWczve1piqobnZ/7eakxu3MNnTBDuUSaIAp0/9Gg=; b=M34fM6l8WWVLS4+V+Nx0CfYrLXOxgcNvGp99Rbhw/OREoxuRp0JjKSUcjbRE4J50eT WdZ4iDlpypn/OdJkd0p+xKRxXj+tHalT7c2Yv0wMdqYEnSQ1nYSdRTTc59/Ohu938F3+ ceEmxQxBGOfd+27RpNdLpcFeZ5C6lEwDfde3vu0bHbuX8GuRZqL9VDZW6uJA82I8TUi+ X2YBYAYuA6yXpUdeSbHhokeFwU+2Rj/cPkoqKPZrpxPB55TOTLdnpwr2naQBWe8Oqs+y lDP0QVinZ+jrTqAgdBB4seNsWDio4ZNc+szYJH1mT+GHN1wae+QmWydAHZosMN+uRKYo 6xdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741276077; x=1741880877; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ibKdWczve1piqobnZ/7eakxu3MNnTBDuUSaIAp0/9Gg=; b=ZbGuZ/4PXOd4xqkw4AHC/f1mwgsTlV8/TrJ1B8ID9rq7lV4Cj2ZmymUkdNm0ABYZHN sNAduwmekiB52Np7ZtbiwX/6n0Qtg4Zz6nXniDL7esjboFAZILynqwXoh4VP484yTgiT gerkY39jEMTOmsBAVLZGs05Bz9eUPtpA0EVgAKrgUJZnRebsrZs3BpPbDJHJ0I6AWbkq FhNlRcuHQ20ptMr5kM7lQ6T/mAoET3JWiQfGzrPoUZKdohTRhun8Fo/5Q0ILWKu6SUxP MFXewA4uNC3dFBWaPQYl90WLv5mwdHexTd3h0DpV1ezdCrnw+bNfjYcYroryVi56vhhe ediw== X-Gm-Message-State: AOJu0Yxv1K1tA0bjxKPkRAQ2tKvhqZsNAumDhMS3FYzPQOcMzeJAHPAJ Xag8bIipXaO9+FLCXXI4bjzD5sXRs4ggZ8Xbty3FlhTOCIhoPXiqpQMK6c8SHKiz+TK/13gdyF/ +SPg= X-Gm-Gg: ASbGncsdpOvRaQkLsvHiwJ3qFVOaEIT0nX2L+M7kKLQceiJWE7mKiTjBYtpYfrrf99A DbcE8qfkTh2u0mTaZ8jGVicZj9rO0sBk9K/X5i5mYoHJLPkkQS5p1vd6R+vOxmfBMr6eO9jHK9c 3u6I563y7G0FCopP/01hztFBRu2qqc2GHiXVLEF28QEu+R1RgdSW1P1RizajLG/q2v2j2MFwewN jb1BbLZj03P4zTfnsOmW/FWnHVpBmmo2C5kjhkX5gFlYBayIWRSYBrsYrDnkBzZNA9X+5Q/6CA9 NML4UZ9s/aaqaRkN198qOvWgfSoeQOlPuEVwv1pAagkM6mXhulkYe4HacGo4k/126/ve4l3pPxi o1sCqJBe+yGs6pGY0pBs= X-Google-Smtp-Source: AGHT+IG153zJml+tWit6jd08Ss8mxkrue3nnpfcCV9mVPUxEoTPGu6m02eVvi9xQIn/MvjHKxlOArQ== X-Received: by 2002:a05:600c:310f:b0:439:985b:17d6 with SMTP id 5b1f17b1804b1-43bd2adb414mr61160735e9.27.1741276076849; Thu, 06 Mar 2025 07:47:56 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 04/54] cpus: Cache CPUClass early in instance_init() handler Date: Thu, 6 Mar 2025 16:46:46 +0100 Message-ID: <20250306154737.70886-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250306154737.70886-1-philmd@linaro.org> References: <20250306154737.70886-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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, 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 @linaro.org) X-ZM-MESSAGEID: 1741276140223019100 Cache CPUClass as early as possible, when the instance is initialized. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20250123234415.59850-5-philmd@linaro.org> --- cpu-target.c | 3 --- hw/core/cpu-common.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu-target.c b/cpu-target.c index 667688332c9..89874496a41 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -134,9 +134,6 @@ const VMStateDescription vmstate_cpu_common =3D { =20 bool cpu_exec_realizefn(CPUState *cpu, Error **errp) { - /* cache the cpu class for the hotpath */ - cpu->cc =3D CPU_GET_CLASS(cpu); - if (!accel_cpu_common_realize(cpu, errp)) { return false; } diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index cb79566cc51..ff605059c15 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -238,6 +238,9 @@ static void cpu_common_initfn(Object *obj) { CPUState *cpu =3D CPU(obj); =20 + /* cache the cpu class for the hotpath */ + cpu->cc =3D CPU_GET_CLASS(cpu); + gdb_init_cpu(cpu); cpu->cpu_index =3D UNASSIGNED_CPU_INDEX; cpu->cluster_index =3D UNASSIGNED_CLUSTER_INDEX; --=20 2.47.1