From patchwork Thu Mar 6 16:39:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 870891 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp351697wri; Thu, 6 Mar 2025 08:42:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVctf8BkiQoGzcVvW+y5+wfebsOwhTUQGXnkn9aW93hCl0o1MSWL+ijlajmZNPzocYdf0IVDQ==@linaro.org X-Google-Smtp-Source: AGHT+IFOH6ytDCuHTdWBXDDbNcqlJAjiylF4GyH4EnB4296JVhQgdfKLmjSOERvYNUn1VXzPzpAe X-Received: by 2002:a05:6102:2911:b0:4c1:924e:1a1d with SMTP id ada2fe7eead31-4c2e2969e21mr5234145137.18.1741279352685; Thu, 06 Mar 2025 08:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741279352; cv=none; d=google.com; s=arc-20240605; b=Bk9OcNA3+0qkzldLlXVKV+y98xJuYjj1rct1mZJrCm7WltNqelfXghBLo2yI11ijJY YsCvb5wnsK8fb1ozEZfL32ojqlobUB/Yzvp2dxyqpHLfkbaIXBIS2iivk3hmO89UyI+Y K1ENA1dbkdwTGGxUlvSjsa7z8pqo5bvz03nd4mC+rky0fnnbufPkRVbd4CCe2W3I4HJK nJ4DJ2TVHKQxKXer0PJlH3VT3alJantwidlTIsFZUxhp2QW1x3RVSR+X07Uq+YdKBa5Q 8zM+deDKFmSp4CN+ZlUEg1nbz39aYoUze17vfiNGIX3aQQjXFecvMIjzURkLJP9jCenV 9nNA== 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=drdpohR6Dj+KXd2wNLa0BIt2hP6cDbsQHnby3gMJcxE=; fh=3mRwEHPGBqqR5hazq8axEoqU1xMco4JMBEMS+Wkcu8Y=; b=NRvRI+jmz80Kr2iRHwSHstLl+SOv1eb/V9/ioM+pOtFQ4Jd1IHcMS8fGQ33rQlvsnX +6ExeDvqV3gbu6cqY18b2n8GbBR2KuRcP/FPI9A/5Hw8Q+iWXvh5CypuHtb5JjyXGQG6 k0B5pcJekLRv2CoRJ/SCbHAvXACFxH8TS2FUKy4Rx8Y49e1t/TrQy3hGmb2thLDbzGxR la5EHbSTWSOsBXHWzj4rxHdr1qR/VhvlMGwkgtw7PGiDpn0EAOsVCOXiOH2UJ9oGhSIg bRKnmiGGSztnuiX3bvuD2fgA0y5oeIrKBri/g6djhP6hxm4UTbA7nefazRQm1vZYUMSz nrlQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="GyzJ/WOv"; 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 ada2fe7eead31-4c2fb459e34si383172137.188.2025.03.06.08.42.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Mar 2025 08:42:32 -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="GyzJ/WOv"; 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 1tqEG7-0006rI-CP; Thu, 06 Mar 2025 11:39:43 -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 1tqEG4-0006oz-1C for qemu-devel@nongnu.org; Thu, 06 Mar 2025 11:39:40 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqEG1-0004c5-3j for qemu-devel@nongnu.org; Thu, 06 Mar 2025 11:39:39 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43bc4b1603fso6021925e9.0 for ; Thu, 06 Mar 2025 08:39:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741279175; x=1741883975; 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=drdpohR6Dj+KXd2wNLa0BIt2hP6cDbsQHnby3gMJcxE=; b=GyzJ/WOv8bJzxSkuKfLH+GxrynXPq+CYjXxiVCvrfz21ayLzUEeBu/rP2u4EF9+3fI j6cSUhc5ZRQJWcQvEZYVGmDBTK27TKE89h0jqHOTPaLXJcljQGmDmaxlVjkTb++CRUc8 0TnOWBBGyFeIteegVVuJK2xAjJ4xzPSpQNzK+/bCRfjsKkaWLwE/jQ0imm1bYnXQqtRH w2znJ7ylOrvf38zwvgvmES/X/iBw9mPoFR3+7qBmSEErpWbTzsdr/fAx5bNfnYFfhcy6 UA1+lENcN2nDk5BgxXGMcJrqNlWl7Sls/9ZLaJVDpGgz8m1YQ4CCFzrR3jzxjYj9Mmhc 7A8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741279175; x=1741883975; 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=drdpohR6Dj+KXd2wNLa0BIt2hP6cDbsQHnby3gMJcxE=; b=mQgwYG2K5gaQadc2LBLMCZI+6A/cSxg3Cvl0bBfDZO9TGyuqz/NtHv332p3nD/jbHm gCYyEx0zZhQtQYAJAA34GhH/aEd2y8Bu6unYHaTrym17E7wfab3e2JcDe/5QM9cRq6wU SYsVM8IrbpaFSSfwmVysiZdxPk8AFNAsOUuqeqPQuGKGIIU9KBradRxz9d33RvLbvB3n yzlmTDA9Lc7MRwcshCKguw7hn+v0mEXZAbIfyTP56yltSij6U4mOEB8nsbCxW+0SswrI QpG6uCf44yGYBz5HlKIO3Y6wWx//l3XdgIgYzTZxsDsqTRUJy6I1LLaXo1s/she9TNc1 gn3g== X-Forwarded-Encrypted: i=1; AJvYcCU41bt4FKAac4S3R9/4NgN/qfMnetUDyyK9xMga9v6EqjyeG24+ZVupt5hJ/7vvH1zBUL/tIbdRo/5u@nongnu.org X-Gm-Message-State: AOJu0YxD2NhEkE7l0AsJaEhagH5cdgWzwGJNxjC0Ag3cfIy1TDWUQCvG +UJwgcPJ0kGvvsvlCVyQgsMuUd/5CvCCVf+DzH6k84Z/60iAGT4ozjHl4FFrbrWerkhOwn5J/eA s X-Gm-Gg: ASbGncvKZv/yGkWthwsnfqhE7ar100Yk2tI0CHQE7ECAOh5d6UXQKS230/VgrhGCAlp 6L0OYhZHzxy1Bls0dtJM43YPFD/w363TWlHMUnXxeT4NES/Jncm/zr5HYtGP21w1IZbY67eHh80 dkl4ih4noO6EcGOpO5R7xS0F1uYq1OncLzuN4+34ERCId+ZpAK5mRUYKardjmGYjlaQSi2yodxZ zGKJT9HWbZ+2TR/qMbODlUHbiKBNbYwjfjiII7UNd25OvyssCiu3PRTm/ONviGhKaPD+O1Bq+34 Bni+W6v/DAYDLZWzRg0YvPknPu8b91q4zBtskJfDYcHXkiMKJBk= X-Received: by 2002:a05:600c:358e:b0:43b:cc42:c54f with SMTP id 5b1f17b1804b1-43c5a60eab5mr1862695e9.14.1741279175508; Thu, 06 Mar 2025 08:39:35 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bdd94913fsm23999905e9.37.2025.03.06.08.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Mar 2025 08:39:34 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 09/10] target/arm: Add cpu local variable to exception_return helper Date: Thu, 6 Mar 2025 16:39:23 +0000 Message-ID: <20250306163925.2940297-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250306163925.2940297-1-peter.maydell@linaro.org> References: <20250306163925.2940297-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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 We already call env_archcpu() multiple times within the exception_return helper function, and we're about to want to add another use of the ARMCPU pointer. Add a local variable cpu so we can call env_archcpu() just once. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/tcg/helper-a64.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index 32f0647ca4f..e2bdf07833d 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -631,6 +631,7 @@ static void cpsr_write_from_spsr_elx(CPUARMState *env, void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc) { + ARMCPU *cpu = env_archcpu(env); int cur_el = arm_current_el(env); unsigned int spsr_idx = aarch64_banked_spsr_index(cur_el); uint32_t spsr = env->banked_spsr[spsr_idx]; @@ -682,7 +683,7 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc) } bql_lock(); - arm_call_pre_el_change_hook(env_archcpu(env)); + arm_call_pre_el_change_hook(cpu); bql_unlock(); if (!return_to_aa64) { @@ -710,7 +711,7 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc) int tbii; env->aarch64 = true; - spsr &= aarch64_pstate_valid_mask(&env_archcpu(env)->isar); + spsr &= aarch64_pstate_valid_mask(&cpu->isar); pstate_write(env, spsr); if (!arm_singlestep_active(env)) { env->pstate &= ~PSTATE_SS; @@ -749,7 +750,7 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc) aarch64_sve_change_el(env, cur_el, new_el, return_to_aa64); bql_lock(); - arm_call_el_change_hook(env_archcpu(env)); + arm_call_el_change_hook(cpu); bql_unlock(); return;