From patchwork Fri Jun 20 17:27:44 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: 898404 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f54:0:b0:3a4:ee3f:8f15 with SMTP id cm20csp1563043wrb; Fri, 20 Jun 2025 15:28:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWmzjwmSbghxcivY1w91YmzCjhX1zGcOEKIvrP3kk81VJpZl1sEC4LMWoqp4DIVOulHqk/UTQ==@linaro.org X-Google-Smtp-Source: AGHT+IEyC17TVYVBlroN7QWw2eGZoe/gLfpDMPZBtNngn+6C4HR5ywleIXQk8lKpD/Iza+7PTxx7 X-Received: by 2002:a05:6214:529b:b0:6fa:edb8:b343 with SMTP id 6a1803df08f44-6fd0c87cc3emr58616746d6.2.1750458534782; Fri, 20 Jun 2025 15:28:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750458534; cv=none; d=google.com; s=arc-20240605; b=QeYUotcAJiQZZsKeADfublMlgGtzAnJ7L3BudsCoJy/5MZImIZauvCLzq8AmIg4dU1 wCbfgcja5aPiQKElXXUWMKgRXrKKtUKZbW9N745ym2p9zUmv/isAJcw1tLRwdZrcRCeW 4EX5zA9M8n7nFK/oh+C2hZD2ObXXvT5xlrV/KvckSdvake+wg/elcECPrOu3dKZOyFoo JLYQj5AmgREWK77vZhsWlqKBFH68i11IuTNMz4T4LNsEhQYhyuzu+adUA3g+gejV8y5N oQuRIQbHovNnvMXpzToFAwBZb76zphnwjxFGyu25MeYlch3vBdSO0Lo+J/BbleE0A1+T sjZw== 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=hN1JtRTCerNnjO9no3SYtbEkkfImhiND1eA7k0roPkM=; fh=AyzBWpdZKvTUKIe2KsNBcRb7uNXo8uS2i+VtImaSwe4=; b=ZzzoRIdflKTKCmUTazfeYRIg4twnU4edM/NDajsk/ZO6Comwr9/CizZYwDNn+zErVL jIg/gRB0mcUKmmiQCTScGu2zXlgyZ3eflaqv4V1YdHVAk0aW0fg4pU8KmXvvU73iou6i w1DnlX99XSgX7569RRw5vhT1hYHfQS+B7z3KseMPBJtcByeacQPP3AM2jMufW9GV6f2N WS7K8dG8hy/RJJJZ9uGPTdHRhnxpjzP79zE20fljOXMe8K5JrP739VKmsw6Cm+l/E6sz HWTF2K11bQcPNqKL6KwWn2lPoi4kG2P0YKjBH7/6aVFB/R+jR5RVyqNyPPahb+XrfmEg obXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Egd+suXd; 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 6a1803df08f44-6fd095328b1si28824486d6.237.2025.06.20.15.28.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jun 2025 15:28:54 -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=Egd+suXd; 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 1uSk4X-0000tO-BK; Fri, 20 Jun 2025 18:18:58 -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 1uSfc0-00081d-Nc for qemu-devel@nongnu.org; Fri, 20 Jun 2025 13:33:12 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uSfby-0006eQ-Qc for qemu-devel@nongnu.org; Fri, 20 Jun 2025 13:33:12 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-451d3f72391so19974525e9.3 for ; Fri, 20 Jun 2025 10:33:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1750440784; x=1751045584; 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=hN1JtRTCerNnjO9no3SYtbEkkfImhiND1eA7k0roPkM=; b=Egd+suXdfNAUAr1YhlKSr6q4JL85663lZ4gxrL4UsXeMSj4Gn86rBla5UM/VtdMx1u Lf4wAP1Ars2aNpIrhlH7pAhocBHg/fODi1ePXBlRN8VOCqBsviWMEoKxrCm21lRVRF5W W6eewnpHr7FU37nJXWZng08++acL1QZam7ptbbmzW76p4L1Q6uP45bU5Uf36ZL0x2lMS t0oEgMneGaZ1d7L7EDOPT87OYia9miWYMZFSQmremn64QWEBuMDp/c+PGUYbP88TdFw7 OWmrdRq078rQSHGh2GXBaDs4+gBeje4AsZK8gnBdUTX7fMCYsVtsgnkGFtwWcxZ4/f2Y uGUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750440784; x=1751045584; 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=hN1JtRTCerNnjO9no3SYtbEkkfImhiND1eA7k0roPkM=; b=AERCC/1fVxQEYaPQInbm8OUeFXyVMXf2wP2yKOpaDA7LeKG/i9cilUXgYUP3jp/Lmf IsXC4dkHEBN9Pc63YQSMPd0v7vg00YeWLhZDbwCneey3sUAd9JgZiRsY7+l4O4uF65FB glPdlsbB1AomX6eaYlIIjno5fKHT5vgIxnynXNZdhpJDjMfHks9cmZOERBqT0oqsoI0l iJchAQ6uDwouX2fUgQf6gcKNx3OQvQ2MCiGbm0Cv4DraLq7qXaVP7HhaAu7ztFoG9g4G zpRlpDNR2ov2aVQ3ul4Wlw4dmvEuMIE56/Vqe2wLFYGwd73kaJefOeGLCpAztz4cpMll Enig== X-Gm-Message-State: AOJu0YzkBAxFdqKIy0aqmFmRJzNlt5X0U/Rp9bZ60urTfID6uaiJOUyv /lOE+wukBJrdi7+QdBHNEiFta+M6wtd4ahFl6XGkWAimwlrHeiBOY1CgquW+O4SMBGCRi9NNTCr vettp7meJgQ== X-Gm-Gg: ASbGncuwK/LQVKDZBM70ANsYkBAFEJ033LGmZdLVNh5JBnXk5yjFXTCoK60B7O33StA TbIIdpmsyWzxFVicgnrDhwif1rsh82D+jI+PTqMHTp68Twk7reVaM9yiO1SG97qsfzx2sUzj6HX bJ9zX9iPI1bk/ljRuuR3eqGTSNL8Wvvys0fTvQufkkNr3s9WUZ3+Esid2RyuMGtXi/iAlBPM1he 2AgThteJtEBVgb9+IZYlC/OcefqPD6pQjkcw4reN4jiRpoBg1XranLp6xB1gy/KhzLCC0sfZLes evJJ9Tvwor+ZNfEjN7lMw1TLKBZSMKWjA3sWm2WtBOpvCRxegyaWztXQP3TDCkac698CTCH9G6u 3CdW8ZMycmVk7H3SBDQT8vXGuNih1YEeb1pmrTmfkmMWNJXW/E1J1w/I9 X-Received: by 2002:a05:600c:458b:b0:43c:ea36:9840 with SMTP id 5b1f17b1804b1-453659ef74bmr36392285e9.22.1750440784183; Fri, 20 Jun 2025 10:33:04 -0700 (PDT) Received: from localhost.localdomain (101.red-95-127-63.dynamicip.rima-tde.net. [95.127.63.101]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4535ef6edbesm63351955e9.20.2025.06.20.10.33.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Jun 2025 10:33:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alexander Graf , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Peter Maydell , Julian Armistead , Cameron Esfahani , Mark Burton , Thomas Huth , "Edgar E. Iglesias" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [RFC PATCH RESEND 36/42] target/arm: Have ERET switch to hw accel for EL0/EL1 Date: Fri, 20 Jun 2025 19:27:44 +0200 Message-ID: <20250620172751.94231-37-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250620172751.94231-1-philmd@linaro.org> References: <20250620172751.94231-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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 When hardware accelerator available, use it to directly run EL0 and EL1. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/tcg/helper-a64.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index 4f618ae390e..5962cff4e7a 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -29,6 +29,7 @@ #include "internals.h" #include "qemu/crc32c.h" #include "exec/cpu-common.h" +#include "system/hw_accel.h" #include "accel/tcg/cpu-ldst.h" #include "accel/tcg/helper-retaddr.h" #include "accel/tcg/probe.h" @@ -761,6 +762,14 @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc) arm_call_el_change_hook(cpu); bql_unlock(); + if (new_el < 2 && hwaccel_enabled()) { + CPUState *cs = env_cpu(env); + + cs->exception_index = EXCP_HWACCEL; + cs->exit_request = 1; + cpu_loop_exit(cs); + /* never returns */ + } return; illegal_return: