From patchwork Tue Jan 21 11:40:49 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: 858945 Delivered-To: patch@linaro.org Received: by 2002:adf:fb47:0:b0:385:e875:8a9e with SMTP id c7csp148114wrs; Tue, 21 Jan 2025 03:43:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWaC7YiSNh0nXA2w+os9pWz+lRA8eJf9gZgxcKyvw+KI8zQQv/AoPpLrJ3n6/s1u9BtwwBY/g==@linaro.org X-Google-Smtp-Source: AGHT+IEBxB3vQ7zSTB0f42VRXkRFSpFKKnSBwdLHghkcEDjDUfSVwyqHQmewEkPNP+itgtUolu7D X-Received: by 2002:a05:622a:1819:b0:46c:7737:c509 with SMTP id d75a77b69052e-46e12d8ed8dmr226756111cf.4.1737459791075; Tue, 21 Jan 2025 03:43:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737459791; cv=none; d=google.com; s=arc-20240605; b=jqu4cMot9iOevwXCMkSvSPyl8SY71vZAMqu2XbKt6Ncz838+gM5JCDRQe0sVhCnocZ Rb27oTDvsuerIoPZBVP9hEXBVh4VAguU5Z7cbfh6FjteyXlAPDHyYYa1fN2FlHpVP0P0 E8zPUOzEjCxHw/udrsJdQuktdp8FPpiEa6Z6m4Nbc9aFkExyL/ZDOCSwkUGnqfsbHrOG cMv9s8lhYegPTmuMJiCVJQbTQJXao7vmKi4hUmzXBZjh8o7VU2SdBX1sY8TdQIqAfBfU gWL9o1v5JYvVCekAvyiFkVPfa6olOs7v4U9vBXGUTPBqKKohc0JbhO9f162YHcRcnTG7 rxhg== 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=UK2TrLeD2Zn1+uH64aqzpAn7UZ7ZT3zI/v5l0LjGSTY=; fh=B7PgRO6ceoQX9QVqUxwheTZYUs+aKW2naPWg2jE2ats=; b=ijpUGmurFci0L6zNweU4oaMIcP4xpGPYh4gsFfawo3tuWk08k8ptUimOl/Nuw+W1Dq mBS02ZIGKUdXmwxUp7b/81XtxgwnEWWgHHxcbDDF5lb+FfjhG/AltD3Gd+TeQhoJAwNR zuKMO2DvlcJ6YgX9SFhN0EThXeddsNx3s0ZfLmsX8LkhDNCoRt9PvzIa+R8QXRGFcABp Nu0A92pAlLUWNzL9mXseMQKddEaBA6Vhj5//6L9qBn3HEVsYYkXX5Q881YBcTtSVvvDr juczvpZMWy0QO0ysUWPXBtPYZ9elr00BkdbLbCTEQNy76gQaxVHsnkltvSR3vZJF2oVI POzw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CToApptA; 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-46e103069f0si117151281cf.139.2025.01.21.03.43.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Jan 2025 03:43:11 -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=CToApptA; 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 1taCdS-0005M9-SN; Tue, 21 Jan 2025 06:41:34 -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 1taCdP-0005K9-GD for qemu-devel@nongnu.org; Tue, 21 Jan 2025 06:41:31 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taCdG-0003NF-Bn for qemu-devel@nongnu.org; Tue, 21 Jan 2025 06:41:31 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-438a3216fc2so27433875e9.1 for ; Tue, 21 Jan 2025 03:41:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737459676; x=1738064476; 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=UK2TrLeD2Zn1+uH64aqzpAn7UZ7ZT3zI/v5l0LjGSTY=; b=CToApptADlKARC2KiWU1ItmAYUZk/B/+7UhFTecRAYVkFTd+8gEFiLuyjqSsaYaDpt VsY8Xy0pgcjgsc0N7+Yco0QtL9gwVBDX1HNAm8sjiImu4N6f9mET0W93ouXtkdWZLLH4 HGDzOBLyZHRZbszixj3Onu1h5+3CpsJAAhgM9paDDkO6fhuhjOo/bXX2e8i/GBRufj3C q3zQbXgLG49iBVV8tL3b0aQvwNS1e4GIjh+U27qxGyTJ4ZKtvvAoRow1qY+Ogqad5n9H rec8fitlw1kfB9osyTsPsXgKbueMRhXalCh5Fl4ABVbCf0mrRbQHYUxFpL7r6Gh9e0Ys /ZUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737459676; x=1738064476; 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=UK2TrLeD2Zn1+uH64aqzpAn7UZ7ZT3zI/v5l0LjGSTY=; b=JoDqfFNhGS45buuJODURnZRfA3fKVaVOgB18pRhwlGkrBEfzN9tLUt3kIlNP02RvmC 2v23SMt4UkAorkTwF7g6a4oupFHZW143Cl4ffbY3HFO2rK3gqeBVc6rBO2jZo3aCwDFc 0WKBrHPvIhdVDBW0EEWtaf0Rr0AS10x94CSgxr4Pr1p5ZYzL0ZVxVHJBsp4tRaZPx7a3 tPm8KQ4qMAQPPoKqjlhTeXnLXK5Qi3tqFqxKGCh/fVsL7y2QyJNJFv23hou5knwGwxgh Vv1DlTGXtdusfA3JBWBlloR7hCcK2hkHFFCr88+iCQrQd5JJSXrKUoG2WsNaj95KLBQa dcJw== X-Gm-Message-State: AOJu0YzF5Kcj3z/XM0lhLofPRSsPDOqByyf877DHZadVwBhkjxXn0r20 5wM0PVgEdsMjxRq9nQQwnCnV7FdR1UlZRHQg6YvamPVrkKwo5MTeKWWJKv5VnhZ5BfCl0BbU2Mi zKpU= X-Gm-Gg: ASbGncspnAuF3MR3MAZzvbyFRO4uF12z1Kj2OzkkQ3/77/+/TGcE8R5RsLx5E5revwU fYJET1XhyEKBVKoWfngVE5tz66i+APRX8iZgtWufWcRrWT4+wFvKnECXpGNPo4v83MOQ7hvWPpZ nOsLAz+Ojwckgwi1CpEwqr4v8zkMvxTGwlpbgSgQ/6/02NN44KBmyc/iFRzTn3TotLppzXxIDH3 7R+kA3og1GVAdy+IK5PaPEGPsZD4Z/xjT2xprRmxwnGRHdcW1YHnHkfTxnwBve63O+gNUez5LgQ WoXjVctta0IeMJ8uvv/6PN6jMX0dPDHSfLW0o4DXbIcz X-Received: by 2002:a05:6000:2a7:b0:38a:615c:8225 with SMTP id ffacd0b85a97d-38bf577ff42mr16730772f8f.15.1737459676557; Tue, 21 Jan 2025 03:41:16 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf327ded8sm12932429f8f.89.2025.01.21.03.41.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 03:41:16 -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 04/11] user: Prefer cached CpuClass over CPU_GET_CLASS() macro Date: Tue, 21 Jan 2025 12:40:49 +0100 Message-ID: <20250121114056.53949-5-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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 --- 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 b4e1458237a..4e32cd64f18 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -1021,7 +1021,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); @@ -1037,7 +1037,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 087c4d270e4..53b40e82261 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -743,7 +743,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); @@ -759,7 +759,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);