From patchwork Tue Jan 21 11:40:54 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: 858942 Delivered-To: patch@linaro.org Received: by 2002:adf:fb47:0:b0:385:e875:8a9e with SMTP id c7csp147868wrs; Tue, 21 Jan 2025 03:42:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUE3EcR5GyX0bgRdEnkmkTU+OmB2KckkbxWkkgSNl8WlZIVdoNW7Ky434zSx8by7yBxyWrNnA==@linaro.org X-Google-Smtp-Source: AGHT+IHMwQRqFbA6ySZ/6qRTsHT3yyFnJrszPVABE3t6MyE8mI/tw37sJQRJTp5cN4XqGv0suhor X-Received: by 2002:ac8:7e93:0:b0:467:86c0:4bff with SMTP id d75a77b69052e-46e12b96e26mr214334821cf.51.1737459745568; Tue, 21 Jan 2025 03:42:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737459745; cv=none; d=google.com; s=arc-20240605; b=QfSkP7EdxD/OtFs+tOx2i3DjCUR35FEHDJsvYmUFPCpLkUwiohWoZW2mDxt1xGQvzK UmVmPgSk2eT3tT7Xe+LTc0kIItUjk66hz9QF6d+u2hP/iQvASz7+31HiIY1bamh1vh3c MSXYQ3+aUHhQoczIKDCo5g4MSkZ1KpPmIGXoEga27I1vl2/5FPaX8KTtn4WgctxRKbSy Ezbqpbo08tY7SzP/8NbV3SaZBfnXuijDbi2n/TK3VmkqP/uQ8BbZJHREMHkY7STqgZUN jAtY2k9skKNp6AV3ELF56iccJlQ0BYOga7WO0H839HkTm/UCVOU6dGNPinPCK09Xzj/b L7sQ== 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=sbmqBhov6nOW5WRBICFiiuCzE2uEl3xQcd3ZviTByWc=; fh=B7PgRO6ceoQX9QVqUxwheTZYUs+aKW2naPWg2jE2ats=; b=bvRibVVbne7nzhWROK206OQSQ3VdHXyMyAfW+++l77PbXfWDifN9OkjgOOXFxrFf/+ j54oQKrFptG4ecI89lfGbjh/4hOZmdAqDKFFJorT1A89Cp47L6bVRZIrNMa6Q00eluBU YQyMQOPHiuJWztMOxWOJK+9ZNwOKn2N+LMDKQ3QL1Q8WqHnWuSbB9vB1oihdNp+AGGD0 ybrNFkgSBbz8Skx4avWpBubkJvgKGFBerBJjRpnBrqqWmdKUHc3Mp/zRI9UN+lXAC+Y8 id5zikZ+j8MuX2qbkeZFIrVGJsOzyQLgb3IYIR7Eeo5IJlJeA5tsztWInUwf7ilqT0f8 Jcdw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dsnDzGPk; 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-46e103077b3si127974151cf.184.2025.01.21.03.42.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Jan 2025 03:42: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=dsnDzGPk; 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 1taCdr-0005px-PO; Tue, 21 Jan 2025 06:41:59 -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 1taCdi-0005gg-Em for qemu-devel@nongnu.org; Tue, 21 Jan 2025 06:41:50 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taCda-0003RU-V3 for qemu-devel@nongnu.org; Tue, 21 Jan 2025 06:41:50 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4362bae4d7dso39752305e9.1 for ; Tue, 21 Jan 2025 03:41:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737459699; x=1738064499; 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=sbmqBhov6nOW5WRBICFiiuCzE2uEl3xQcd3ZviTByWc=; b=dsnDzGPke5MdZwrS83aUUy8aE0nfygNv4So3jBELCOgnquQVI/tzUc4w+8uJs0kRbN gBjMThm094Vq+r9yxP5m7BHYPx3gVxHNO7rjSipUSN5zhW5zh34CZQXM42az/bn547Qt hUKbN80fpWs2SkbHfLTT3un7OcFtEh9Roh0MIAF7ARWp0EiJI1pQVhpElnkuaTB/7big POaawaOAvkhBCKCcG70nCdNSyEe5ON7d2ndkumxIeY6r3LwQKHmjywomR1ktkbsEWISy vTOfYgrUO15ppGbBI3K10ZENd1ZPfnjLbaMAQ2km5z9AiYpicD857lQiuhWNmTa6LPSr 8BzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737459699; x=1738064499; 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=sbmqBhov6nOW5WRBICFiiuCzE2uEl3xQcd3ZviTByWc=; b=ZFxexqUmW7gdFCLDh16F4oIrdp5rMURBviVi8bYLpTkyOHNgHN2Z6/KKV24DM9bpjO zwIfofffZsWFCPrgaHBkAqEHwm3/GpxLcL8FhwBQNCVFK2cQW1dXZW1BWCZfxp2wAg5t GnBTX2aD6CBppRjLreNc9DFMQ2OsI9I5RsuxpwXNLnIcB1H0QgAo6hL5u/NLSEpApztw 0UkGhifQNlNmNg71FU9ngj/y7w3jDXIV0Szjz9tHCiqRoZm1KpaPkPAEzbmZaP38VQyS urMy7etN3pdekY7M1aDA9WDXygGCDIbZP9h8COwH3KUCR4o96uW+MjPQensj4tMgOwXA ntqQ== X-Gm-Message-State: AOJu0YyxYF49j8QnPdiH6vEfHVn5gnKnRvfBM/hclQIsTWcIuM8KvuaX tURLHXfWSuhfUqFYAP44roqqCRipcr9M8zTd+LxeBnL4Gwzm1zjjScNZ+oGP9rEr5FKvEoDivXW eyas= X-Gm-Gg: ASbGncs5ytloeeBZ1jOUDe99fszUw+hXXnAUGMphMLh/yKjoj3aJ+mGcEK+u1HjN7oA 6D8Ba2VboeqcwFf8R5V0SHgt2z39+v33/gH2LpTXOIcEChVfS/7fhTY2bgbqdVamxX89mG0TDAz lhocced2Ew2pYGioK8eWfmVzwszo7hTkggEchKCpp069Bv4idKSi66Z7rQGa918I34wS7vBIh7D nB9cA0vaJKJrM1wMiVI0/TQk6Xd5yt+mEGf0okGASeCJdOUKAN5VWZ/Z6tDNuStpfrGIxpD9txp 12aOxjAyXnvCMIiJZx4IjtRf1/fn/8cMAen1iOuUg1o8 X-Received: by 2002:a05:600c:4ece:b0:434:f609:1afa with SMTP id 5b1f17b1804b1-438913c6787mr153654015e9.4.1737459699396; Tue, 21 Jan 2025 03:41:39 -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-38bf3221b70sm12914454f8f.26.2025.01.21.03.41.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 03:41:38 -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 09/11] target/arm: Prefer cached CpuClass over CPU_GET_CLASS() macro Date: Tue, 21 Jan 2025 12:40:54 +0100 Message-ID: <20250121114056.53949-10-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::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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: Alex Bennée --- target/arm/cpu.c | 3 +-- target/arm/tcg/cpu-v7m.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index dc0231233a6..048b825a006 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -846,7 +846,6 @@ static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx, static bool arm_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { - CPUClass *cc = CPU_GET_CLASS(cs); CPUARMState *env = cpu_env(cs); uint32_t cur_el = arm_current_el(env); bool secure = arm_is_secure(env); @@ -946,7 +945,7 @@ static bool arm_cpu_exec_interrupt(CPUState *cs, int interrupt_request) found: cs->exception_index = excp_idx; env->exception.target_el = target_el; - cc->tcg_ops->do_interrupt(cs); + cs->cc->tcg_ops->do_interrupt(cs); return true; } diff --git a/target/arm/tcg/cpu-v7m.c b/target/arm/tcg/cpu-v7m.c index 03acdf83e00..d2d0b94b630 100644 --- a/target/arm/tcg/cpu-v7m.c +++ b/target/arm/tcg/cpu-v7m.c @@ -19,7 +19,6 @@ static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { - CPUClass *cc = CPU_GET_CLASS(cs); ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; bool ret = false; @@ -35,7 +34,7 @@ static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) if (interrupt_request & CPU_INTERRUPT_HARD && (armv7m_nvic_can_take_pending_exception(env->nvic))) { cs->exception_index = EXCP_IRQ; - cc->tcg_ops->do_interrupt(cs); + cs->cc->tcg_ops->do_interrupt(cs); ret = true; } return ret;