From nobody Thu Jan 23 05:58:06 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=1737459793; cv=none; d=zohomail.com; s=zohoarc; b=WGVniKJui+thm2mHXKLuHsPsIeXnXWXz/1fySnM0njCgFOMlrQsyC1jBKxIai3+l4ekw0+Y0RMATYONUNdgBs3YvcEdVOAMTFYG1+aZOnMGUkQ8YugStq74BJE2yKLnFhnZUp8Mj815TGMuSl3PNCrSzb2NA1Hi/PFHE+bWGMtc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737459793; h=Content-Type: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=FMaF6+Wa5WYYaGZJTTHWyD0ctSisYPOSoq9ZRxR4GzI=; b=Jowxs2R8EcTJP5dT1fqpCcyR3jnbo7yW8VJAdTpJhF6619g9xIVMaJ8nwPP5IA1YAB5H0dsECMyD7MuFirNwlW9LE5Ez6BwGPlSHHrnZGnf9GI7kFesOtyMST+FuFbByA7GbQ49RZ2j5s51mF7awnbAr0NbY4IUrME75vGku6LQ= 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 1737459793469381.5604324968375; Tue, 21 Jan 2025 03:43:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taCd8-0004xA-Nr; Tue, 21 Jan 2025 06:41:14 -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 1taCd6-0004vp-GZ for qemu-devel@nongnu.org; Tue, 21 Jan 2025 06:41:12 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taCd0-0003KH-AW for qemu-devel@nongnu.org; Tue, 21 Jan 2025 06:41:12 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4362f61757fso56490985e9.2 for ; Tue, 21 Jan 2025 03:41:04 -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-438904625f5sm179480395e9.28.2025.01.21.03.41.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 03:41:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737459663; x=1738064463; 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=FMaF6+Wa5WYYaGZJTTHWyD0ctSisYPOSoq9ZRxR4GzI=; b=ThHmGR80lbQgQQ081h5rrGm1TLSh8wKDufGenbg3tXEC9+g84uRTm4kweJco/NxQ8e hnPp12BKT3MkZ9TJr+CJFgOgaXLVYioDblj0R8ty5+jm+Fr2qmfFtg++vGd3WxyHNwX9 1Wqk7onitcDsMNz3kkwcQSA3L6KAEPZklGPCZ5qizZMYSSKQW+jC32VTWu9x8Gi9lNOF 2sUMUmZg0GWs4C9TLjgDuYeRn4YdXlEZl3Ck2xu85LgEoT90LUSPYOiSbiamzMV6nHfF lt2dmj4xcBFC21pnfOYhWwKCY8wfaVna6ox5lQ5K3QElSXAMM3YJUMHKg9jUglRX7OSL GfWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737459663; x=1738064463; 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=FMaF6+Wa5WYYaGZJTTHWyD0ctSisYPOSoq9ZRxR4GzI=; b=LrVnFMcSV10GUflNVX5q9XpsqGUBCQC08cWoYe4FoUi5CvRjoTUXEnoFLY4QTF918f SI5rkdOMugiZ44v16DP9llGkZzSKTGa6CZ/Urfm6TFjVx/ui1eo7lXQ681HGGRwD6RyT GIIOtCYa4Up+VStbkURsSV9+cK3D9voBFT2tL5od+PG39xBM6Jk3ifBvZ+lLqzFK3kty Cltx3DKehWNgRrDJ8LrQ9rb0b60Sn2o0CzlnWh0DLz6nCEIAj63tV3h8mr588Hg+hASL f0YrZUK80W3p4erl3i14rB9zGSPGcXCSqy5g+r6Gle2wZkGb8M1705Jx4D+yxzTJ6Vsn dLIg== X-Gm-Message-State: AOJu0Yz8nNJn5mnVDy4DkIRF85ZYWj7Vga/SRHMng5Jajji7N8/mFhUH HuPiEA5PrBpFxVeJIuWelwGpWzkAUK8/C1ZuaWeVvy3h+TpZ6LZqdDwA1KlrWZXSywT7uA0Fd8D UU4E= X-Gm-Gg: ASbGncuRWAKRxV5/VeFhG0RDGGRoYLmgHgfZHHZPuLLQnbLmugdIKMmQw8UqpLTyruq ll1cmQBFsIBlFk0GXilRnXzkNVlt2a+QqNq2whje2jKUvtJZxHRQRVunbexL9qqOEetH+gHmOkh T5SrEATfc0YiL5439alAZlpHPSwCZ7XG2UqsKoviyjR+1Jwr/aZM8FIWg4x0Yn46urqrLqkCev4 aDZUzgExiLknWziCR0hcuHXG8U70GVR2x1l2t+Dmy/LNtab6yLIdL/FxrkraLwPaJCECGW5o13i FcYRVVO4UDLFjMOBNgHk9nCDzgImhvqFsJQbG3RTmiIH X-Google-Smtp-Source: AGHT+IFxIGaP83HpPmv6NXZkFq2jfmtvkIsdcXSRb5Ou3rbnTeLi0+ZTeJpHOJpXjMv4wJPlutsUQA== X-Received: by 2002:a05:600c:b8c:b0:435:330d:de86 with SMTP id 5b1f17b1804b1-438912d2c48mr162947445e9.0.1737459662693; Tue, 21 Jan 2025 03:41:02 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 01/11] cpus: Cache CPUClass early in instance_init() handler Date: Tue, 21 Jan 2025 12:40:46 +0100 Message-ID: <20250121114056.53949-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121114056.53949-1-philmd@linaro.org> References: <20250121114056.53949-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::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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=unavailable 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: 1737459795276019000 Cache CPUClass as early as possible, when the instance is initialized. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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