From patchwork Tue Jan 21 11:40:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 858947 Delivered-To: patch@linaro.org Received: by 2002:adf:fb47:0:b0:385:e875:8a9e with SMTP id c7csp148202wrs; Tue, 21 Jan 2025 03:43:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUZ/SP4zm+vMRZlS2v708Zl4XrO7TdywjK18BIP8k5/X9Q4dl1UcPCD5DuBMZqCGwSiH/Kyqw==@linaro.org X-Google-Smtp-Source: AGHT+IH0s9WCakhj1LGbsFud7+nedmj73OzX8V0TFrIlu1+edC64UACoThYZdE22kPiF8l4Sqlae X-Received: by 2002:a05:620a:5623:b0:7b7:142d:53c4 with SMTP id af79cd13be357-7be6328930amr2876411085a.54.1737459805053; Tue, 21 Jan 2025 03:43:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737459805; cv=none; d=google.com; s=arc-20240605; b=fH/7EOp9l/o2dUsKYNkR+Xpd3HvKze5rBJlZtP4KoLtI0rXSussQtxq6opm/6jKp47 0RrYfa7apfKl+fCdguZ7VkTK88SBy+Is4+eFvhicvwHsaAZz3bPwJN8uGm0l5hFjeq1y aq/NLEZq6dMe9mJVhP5k0LOJZhloOBQitk7sbI0cByVGi0TGSg3pE7U09MzCxh1MZZC4 bDSbtciaItHDxkKnPEuwtuShuUD0L6ZlRu6l5E/dNMj/n1dkq3n0Lk7Zqaga+FU6BWnP rRtjqYWRw8MMscenPj1Nbj/E/tOh4HGTjjU0seKUgjBOK4MSkH+pPDW9WR0DtvItWekw SGBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DeYTxKfeYGnuCZs4uhCLhCH6gP528hwEuAlYwVcOULg=; fh=B7PgRO6ceoQX9QVqUxwheTZYUs+aKW2naPWg2jE2ats=; b=atQUFLFVIsdOhUQz/xIlXW7RA2kzpWvHnciTGFKAUJcuC3JNegjRcwKM79Y48qs7N+ ybmY7PPEiW65UjRIyuS7Ry153IOvioJbG2n1mOpA6KheK6q/99mH1myO4oeWvPhL5+3o KrKgJrZa3ljbRffymETpkNHy9xhHsFdsdlE/d/6zfxtwshNiuYgtPjGcqwrPAhwJSlv+ cDrORML/g+7LvL9idS0eo8DHbTSG0unCCQukTbwy8q0cTsx/X1upCNx3LM6V2DON26AL CSL2ScvCR2SC5OC9/WOwLuDNVLZMrUCfbybVyQT1ZEn978TQwpqWrwoHoULVPftloxy3 7nsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W3GP7sLe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be614bff53si1212085985a.284.2025.01.21.03.43.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Jan 2025 03:43:25 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W3GP7sLe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taCdV-0005NW-Ki; Tue, 21 Jan 2025 06:41:37 -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 1taCdT-0005MS-5s for qemu-devel@nongnu.org; Tue, 21 Jan 2025 06:41:35 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taCdQ-0003PU-DK for qemu-devel@nongnu.org; Tue, 21 Jan 2025 06:41:34 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4363ae65100so60364995e9.0 for ; Tue, 21 Jan 2025 03:41:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737459690; x=1738064490; 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=DeYTxKfeYGnuCZs4uhCLhCH6gP528hwEuAlYwVcOULg=; b=W3GP7sLeHtet/KBti2TeVQYKTq+uKCeFPGzKZo0EVnE5A9L+MdrCWkU6jEjYR4WJfy nkLVVxGhkLnKGSIJiuyMgHofvMajBw3Mndls4wkbNJwQM/WuALUdV8g+nw/Jcgzn3TOy dA7DFzPHXHPfSIJ1/LKU/dZXpTiuoSu+5A4J/bcjF53Je3ot5dr37xpwdVJmnY6bFtdL OmgK2l44RmdkV2faN9mOPFqCkJJ68uerM5xFt39FaW1l8CZqK6ZQeO7n5mlTRwBGPfyF cxglLsKloocSRv7dPvrgbVWcKKVIzf/BfCpOVuAKA8TitiXoMT2iW+V9AHRGuiO5oRUC hMjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737459690; x=1738064490; 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=DeYTxKfeYGnuCZs4uhCLhCH6gP528hwEuAlYwVcOULg=; b=LbXZcQRHaIBIbnkoXrQHyHTRWKAIqY7GYfQ0R7jCC4Ywdt7zKjugkP+pbZj3CxPPNQ ZULrq+yDyGl/Qy/mdbQgIvVtja8IezfdgYm6qRy9rTccfLSDehGmI1PIN2TOjrSllNOS aiFVFfPYQbCsA4iQBiYaU+PL9WwZPSjKNVp78EZOofffA9vfj6kIDlXWKaKm1+SKGi0d vyJ/VMWhm7FkBUkmNW4xI1/16Pzeyr/Vd0PIt1ufse/HkwJBJzzp2s3W3LsxfKUhKyyy VgbLXksAtrv8j2pT/Y1vr/Kl43bVq0CLLkZxRpnK22eS1rKZVQUv97uenXZATbumFstT C/zA== X-Gm-Message-State: AOJu0YxfHW7/moh53HoFPiPuux4S8Bk6iLL3AS9cph5lWS9+Nepd9HOy 8Uoc8tasoMIxC3rDl1qKc2CuOiFuLi8j93KwBKHTpYnQPbfdYEMtLRaZiNmZCaLRDymvss+aITK gWP8= X-Gm-Gg: ASbGnctAvLuZV2ZJ5z2mmMwCCgBurJAWGX1AFYPoI/26h0gTvCxTaVF+WE0cCJ2fiz1 8YdVNAzbzel2zCCRDCqE725ppyWdy76p2cDphMBa+iYIeB/q6er06SzJ0abRo8VBJzsTPtdOsv8 lNYmBe8/Z9pWg0Bfs4rRMdsS3Ta9+XYVh2kdGtjCLc+EtMKxmAPYrYsasAjTh6/YSXHbKc8BwbI hlzDfqWeNhaFMCFKg9vPzhV5bpe8AJu1ctgvqGKr/RSJHRVYM9pcN5zBAcw8+jMVSpSBYBYhNVI f5YA37kWYZyBBlKUQ7ZK551FZmvA0EvSgnzuuVT2TLci X-Received: by 2002:a05:600c:6c95:b0:438:a1f5:3e41 with SMTP id 5b1f17b1804b1-438a1f53fa6mr113851535e9.12.1737459690343; Tue, 21 Jan 2025 03:41:30 -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-437c75290a2sm238291245e9.29.2025.01.21.03.41.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 03:41:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 07/11] hw/acpi: Prefer cached CpuClass over CPU_GET_CLASS() macro Date: Tue, 21 Jan 2025 12:40:52 +0100 Message-ID: <20250121114056.53949-8-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 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org CpuState caches its CPUClass since commit 6fbdff87062 ("cpu: cache CPUClass in CPUState for hot code paths"), use it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/acpi/cpu.c | 4 ++-- hw/acpi/cpu_hotplug.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index f70a2c045e1..6f1ae79edbf 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -235,8 +235,8 @@ void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner, static AcpiCpuStatus *get_cpu_status(CPUHotplugState *cpu_st, DeviceState *dev) { - CPUClass *k = CPU_GET_CLASS(dev); - uint64_t cpu_arch_id = k->get_arch_id(CPU(dev)); + CPUState *cpu = CPU(dev); + uint64_t cpu_arch_id = cpu->cc->get_arch_id(cpu); int i; for (i = 0; i < cpu_st->dev_count; i++) { diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c index 83b8bc5deb8..aa0e1e3efa5 100644 --- a/hw/acpi/cpu_hotplug.c +++ b/hw/acpi/cpu_hotplug.c @@ -62,10 +62,9 @@ static const MemoryRegionOps AcpiCpuHotplug_ops = { static void acpi_set_cpu_present_bit(AcpiCpuHotplug *g, CPUState *cpu, bool *swtchd_to_modern) { - CPUClass *k = CPU_GET_CLASS(cpu); int64_t cpu_id; - cpu_id = k->get_arch_id(cpu); + cpu_id = cpu->cc->get_arch_id(cpu); if ((cpu_id / 8) >= ACPI_GPE_PROC_LEN) { object_property_set_bool(g->device, "cpu-hotplug-legacy", false, &error_abort);