From patchwork Sun Mar 9 17:51:38 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: 871883 Delivered-To: patch@linaro.org Received: by 2002:a5d:64ce:0:b0:38f:210b:807b with SMTP id f14csp653333wri; Sun, 9 Mar 2025 10:55:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV5HPfz8gxEr1pPfI7YD3rR5yNOoGoEJVKFsvUNJkDuX6xZH0VA6Sl+JC+z4Zc5KlFTymnqOg==@linaro.org X-Google-Smtp-Source: AGHT+IGtEks7Ag7Yk6lixks1p7u2+L8RkBxbC/Z4j4mekcdKkXYJ8y0SFs4VAZ0zHCyeivuMIr4o X-Received: by 2002:ac8:5fcc:0:b0:474:ec14:669e with SMTP id d75a77b69052e-47618afacfcmr149235071cf.46.1741542947240; Sun, 09 Mar 2025 10:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741542947; cv=none; d=google.com; s=arc-20240605; b=g0AfIUT97ps9jx2rvr+9Ct3aJ1ySY5ZxqVv6fvr1yo8QCMf/a5VrMd7PgCb/rYLazA QnfSrpTmK6/Qz3hjWYXm8F3SNJEwvwrUQmU/TwtdSd3+GcD5LPd+aDNFb4bwUMu2nXhH zwgX2xYzpeX1135aHzZHoaFU/LWJrG1znHFnSZsx8vbs5HYfxJN2/dDlFGv9Dt5cHVff hmIwufCXcEQpyu9U7hnSX2wbpNcek58Mnr/RHLN+8Mb1++4+1FZeCXZzPODT5Juy08y5 lg8D6eoMrv2+wkVCrvmondj+wXoQm62LGjdFK09bW+BNp48gkbPjcIVeVTIx0ck1MQ35 twag== 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:to:from :dkim-signature; bh=UZBlo3Xf8l3qExmlz56XofEDvMdC530/ykgDz1o/y/o=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=iny48B7f6uVDHZsyc7vr3a9rDuF38XeUJiyzwY1IXj/vePsUlUBRI9Wi38dStci+B2 a7AeJBj107dXYQAmmk2Xy2vHNp5QLc77PqkSV9kI9xNTTRs84jG/Sn6CuZ92nTalo1sy Ol/aAfknXROVqp944HnX2X2E43kdG1SDD42fC+hVzlsWpdrj/S5qw9ASzXJKPtgnRSnx /PPofgvEAmuFHIQVZBdZkxu4rrUwkbiybvWg3mb5isi6YS1oUa+B/6V0BfoegxLo2WHJ z4xlfezZpA+8CFJf/99+xEfFr4e85fZOTZvrDh1q+RoeCl+WDTZc3NhD5lBZmhXV/4k7 b7og==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=atZqFkFL; 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 d75a77b69052e-4751db5c338si75282871cf.640.2025.03.09.10.55.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Mar 2025 10:55:47 -0700 (PDT) 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=atZqFkFL; 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 1trKpf-0005Gx-AN; Sun, 09 Mar 2025 13:52:59 -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 1trKpb-0005EB-4a for qemu-devel@nongnu.org; Sun, 09 Mar 2025 13:52:55 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1trKpZ-0004rW-IC for qemu-devel@nongnu.org; Sun, 09 Mar 2025 13:52:54 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43cef0f03cfso3865375e9.3 for ; Sun, 09 Mar 2025 10:52:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741542772; x=1742147572; 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=UZBlo3Xf8l3qExmlz56XofEDvMdC530/ykgDz1o/y/o=; b=atZqFkFLZW4jCJfiY3aAQvd7RxhIrS1IQcyXcvRm+Z0QwTmMOwidGqr6BiRpmbbxec DQydYc9h+HMkcuOpWN1R2ZkMaKIPe0Iy90aiyaWVAxcfLscdeQPt8mZ/L1PGB1shfGL5 bdbrVP52G37b0X7iE7KHPNUAshLlL1GYPhW8Npx4DJaSD2fRW3hwla6aufGgDq68263a 0T4v9WD8ZCpLYpHHAqaRU00UVkKlE8kYAIoLpqvp/HMACQZoTuJgTrCAdoRVLmXxQ1Ad 2cujadoyI2lIyd9f+wI+Utb5C7xBYUuiRS1dMopHyFaNnXnozISDD91W9wvVlAKAMvHv at+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741542772; x=1742147572; 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=UZBlo3Xf8l3qExmlz56XofEDvMdC530/ykgDz1o/y/o=; b=DnzoSZXLKv6IieUkSxu9yol9MF4B9GNmv4cc30hq76SeVgIYwsFkUKl/sdtvvXmHkU Mo8g/HNfubRsCnpkrFLdaVmCVMSzA8+D9Gax2aHue28It8M0NtaoZa0gsCM7fxz3LE0x qjjj7cW8ETsp/bOKGNuQ18M1HolCrV+FDsYsL2eaBKGcYVHcOTpCVrwLJhGYWEnGOOBG 1zOVPLo2Qx46h6q952Ne5WFDXOQYzsdOcNxI+kbN34jlSwuWoXydSD7lswAVkdA8kQ0p PlxmtazysznopSNohP3h7o1xIHazSmG1UudUxeI8VNhM7Mbj4zLnw1LcZcs7kTHBBWY6 XHnw== X-Gm-Message-State: AOJu0Yw8unT+FwRRFw1cKylTguYHk9pDKYyiD9xcs+6tVFW0Zbt/G1rI q68LG5uiSyjB9Ku10WejFra+aihFLHvqjf8b/9cwUEQJ0IR9ABZsSqPf0/TylgwDzfT2vrOQS6B gIiQ= X-Gm-Gg: ASbGncvHQ6tG/CG8lDtbTCNoK4Xz+woa9u94yRNRKHeGg9H/4YNsG51MPFYCuiTQe2E v7lETb2N2kWOUbfZouVoQBVq6hXFNFW3tKRBn/0ljct4PzZ7zFHgpzH+L7RYW4e9VYPUa7lzH4N Zm627mlpxCDpk11nW4yP6Xra+afRw51TESaDKi9ixe/exFpqlTmHKrbEKMemQsQ0og34SKGRXMe iuVijmqZPqhkNCam/O6c2L7VP6cn6o30e4c6uoHr+LL7X7xs6Sx8gvwJOzzzuNTrP1OmTekvtpI 3Q73KxaSl30vLRI3o7hBFNCTQV3ONALFbw3d8v8yiXMhIpzGiwuz8DZsWouH5YiyPilyEXRBRT9 hSBwH3ejZWfJepUOUfeU= X-Received: by 2002:a05:600c:548e:b0:43c:f70a:2af0 with SMTP id 5b1f17b1804b1-43cf70a2d2bmr9313615e9.16.1741542771674; Sun, 09 Mar 2025 10:52:51 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd435cc67sm150369935e9.39.2025.03.09.10.52.50 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 09 Mar 2025 10:52:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 09/38] user: Prefer cached CpuClass over CPU_GET_CLASS() macro Date: Sun, 9 Mar 2025 18:51:38 +0100 Message-ID: <20250309175207.43828-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250309175207.43828-1-philmd@linaro.org> References: <20250309175207.43828-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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+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 Message-Id: <20250122093028.52416-7-philmd@linaro.org> --- linux-user/alpha/target_proc.h | 2 +- bsd-user/signal.c | 4 ++-- linux-user/signal.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/linux-user/alpha/target_proc.h b/linux-user/alpha/target_proc.h index dac37dffc9d..da437ee0e56 100644 --- a/linux-user/alpha/target_proc.h +++ b/linux-user/alpha/target_proc.h @@ -15,7 +15,7 @@ static int open_cpuinfo(CPUArchState *cpu_env, int fd) const char *p, *q; int t; - p = object_class_get_name(OBJECT_CLASS(CPU_GET_CLASS(env_cpu(cpu_env)))); + p = object_class_get_name(OBJECT_CLASS(env_cpu(cpu_env)->cc)); q = strchr(p, '-'); t = q - p; assert(t < sizeof(model)); diff --git a/bsd-user/signal.c b/bsd-user/signal.c index ab1d9ddd50f..a8cfcca130e 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -1034,7 +1034,7 @@ void process_pending_signals(CPUArchState *env) void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, MMUAccessType access_type, bool maperr, uintptr_t ra) { - const TCGCPUOps *tcg_ops = CPU_GET_CLASS(cpu)->tcg_ops; + const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; if (tcg_ops->record_sigsegv) { tcg_ops->record_sigsegv(cpu, addr, access_type, maperr, ra); @@ -1050,7 +1050,7 @@ void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, MMUAccessType access_type, uintptr_t ra) { - const TCGCPUOps *tcg_ops = CPU_GET_CLASS(cpu)->tcg_ops; + const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; if (tcg_ops->record_sigbus) { tcg_ops->record_sigbus(cpu, addr, access_type, ra); diff --git a/linux-user/signal.c b/linux-user/signal.c index 4799b79dede..4dafc2c3a29 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -753,7 +753,7 @@ void force_sigsegv(int oldsig) void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, MMUAccessType access_type, bool maperr, uintptr_t ra) { - const TCGCPUOps *tcg_ops = CPU_GET_CLASS(cpu)->tcg_ops; + const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; if (tcg_ops->record_sigsegv) { tcg_ops->record_sigsegv(cpu, addr, access_type, maperr, ra); @@ -769,7 +769,7 @@ void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, MMUAccessType access_type, uintptr_t ra) { - const TCGCPUOps *tcg_ops = CPU_GET_CLASS(cpu)->tcg_ops; + const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; if (tcg_ops->record_sigbus) { tcg_ops->record_sigbus(cpu, addr, access_type, ra);