From patchwork Fri Apr 4 22:35:12 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: 878204 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp4005770wrs; Fri, 4 Apr 2025 15:36:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW7F6hVD/CXcgHenc3xroclLEPSgo5gVEd3aLtsf5i9dlPeYK+pkphSqfvOnueGLuvs6pLTZg==@linaro.org X-Google-Smtp-Source: AGHT+IHpMs9EHTzgx+kFvR4Sje9SuCb2GsVGS+ppGcpcNyu7JGszkhUXtavm3hr+jKU6NKi2lHoH X-Received: by 2002:a05:6214:2608:b0:6e6:68d6:3932 with SMTP id 6a1803df08f44-6f064ae6a0amr67424396d6.40.1743806208673; Fri, 04 Apr 2025 15:36:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743806208; cv=none; d=google.com; s=arc-20240605; b=EH2qCBUcOsVgAy9EAS2kqq5xMGBAsNQcvCtUIBhHspEDBEsVAHixYMYTZ/CtAO7Hfv t8iuPlkitQOhFSIZHrgDhdlgwyexKL8z59z7nL9nDaofo0jJP9QpPbBxHC977/so1r4y S0ByVFh7hnKgX+g8hjhHDZwdCyOF975Tt7K7l+1gb3C2Lo+QmveMmfJH7L4hh6pc+bt6 yGQy9Paj14RZxgMnANkI8QTfZ+tY/iF0yPsLt4KtitVsHQ/E7CUTRw+WhAlUeJ8Y4Kux /OXze7YcKeAr81sopUQYtY5Ozd7TScEQ+kJQrhP6nJOGEXdz5pgcLYw4uIi8qb54Ej6J bjPQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=9ViK4onZQCmZHc18fMKix+clvnP/93dzPnAUQK4f1Vg=; fh=089D9cN8gKCxRQaMV+d8/EwypuoUoS4FPKA8rjpOLh8=; b=H32z0d5kKX9tOAnzkpG1G24Gw8IHCQV04AC4CHRMiW2DQVCO/w9sywm7QfJHVl2eY0 uSjJirjBXIQuPrPHhfe9QxxJmum9l9RlQ2EbgdII7lNSftZP46ETvdYIoGMTbMI/QJo3 ThYgrXhQ6AqyLAog18/xsv+FBRJ9qAZ63LrRbMnbjJj7ZffM8eAmZfSvQ1uj/iOozrcM 681jFOcsYHVJmrOfXBys9UygFgUdKTBDkefbUketlskG8wTxapQJ4wmB+cgAZvRfwJfT mXtDtcgnfclXf0F+bGBnFEku5tez3YwP2OX+SIiwA2pXKkLrnWRSeXsBTAL/csgT7t5z pxaw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MuVy3gbT; 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-6ef0f147246si42095026d6.440.2025.04.04.15.36.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Apr 2025 15:36:48 -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=MuVy3gbT; 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 1u0pdo-0000iG-GX; Fri, 04 Apr 2025 18:36:02 -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 1u0pdU-0000fy-S8 for qemu-devel@nongnu.org; Fri, 04 Apr 2025 18:35:40 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0pdK-0007x7-UN for qemu-devel@nongnu.org; Fri, 04 Apr 2025 18:35:37 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-43cfa7e7f54so15914985e9.1 for ; Fri, 04 Apr 2025 15:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743806126; x=1744410926; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9ViK4onZQCmZHc18fMKix+clvnP/93dzPnAUQK4f1Vg=; b=MuVy3gbT3Yzsibf/knShuo82w75HspRxoAXUpQqlyQ1Uz/ZvUrRPK99HLW0L3Gp2PC dEtMwvSoRc2AVT1Zc3EMwLA9UJtFM3azm8XfWM6u4vRJoT2XSWfG30vFsgGrxt2dZBEH 98T0peYsxz2nWT99wDy9O4PYII9Zcn4ORhiuu9sZ+5RTfNaQnst+pVCMs7rW3tdnRiqe ZodXYnWnj0juAN8u1TQYcWG21MWbtsq8UnvNvIbpuMxMA8fZ//gfkfWhVKgAkHKAPuvW fx/W46eT9r1oBKzGdKOcHandpWRc5eefNn3mvtGMv+RjmgS4oduJquWjNLYufQmyosFd BAEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743806126; x=1744410926; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9ViK4onZQCmZHc18fMKix+clvnP/93dzPnAUQK4f1Vg=; b=ehFBLBW5DFN7czuxmzdj6X3oru5xJLAIRR7zfyXCb8XYb5Vs1cTvzYty9Ufko5jBW/ xJxdpkTIRLYQn4zzUw9BYOeEnvPwttEeqZ/3gMpwwWmbp1NyeYGh3ZRTzDsv/ofVE5kM rfACBEOQduXaD5DY7CQ87G/Bb0Oh2ebWA0bWBBvoqJ3TeenKHj0mVbHx0kqSFO5ln0ar i0Pgw/nWlgpctxNThng7hzKwJ2/B9c+2QdQFjwsCyhKq30WOCfrtFQYjOoRuHHxBF2rf D9bHFfKqNzlCKEpidut572rYx/P/fM+B8pZaLj3NfcOyFiLvYZLjhV+Juar2yxtKo65L Clpw== X-Gm-Message-State: AOJu0YxdL0tZPQj6QJjh7DEcmP23eed+4JhII8q0cyWoNCs8VLu7ZVnr O7qybI9JtVd+YtbBt+beQHfjZAA2LwWXxkivb/gpQ9cIVnmCq9CUbU6C5FmsphUw1d5FeYCuy7V G X-Gm-Gg: ASbGncsENU7hV7CENWyEKlEjmWDmbe7dROuzy7Yep6BCmMJplWNmXc3AhRxqD5D2Sz7 HOeKdcVPNN2FrqFelYvhip/kCmFrdWuKAC+Ltx2VYGQ33sO/ySB8hYnR/ugJ+PRVsPwic2O5clk AuEpU3p4Xq78J4kbPYz/hXESNNFRrmxCUBhJvILQYbU77GoKjss6FJlvmCY+WBZXZrpAPt3RbY2 GROo8DNi5BEQxmkZXKM4Xn+xtBHvybAFAb12BPC4tNIEnObRcKr4dbLwefXX+OcQkxdH5Xa+A/x AN1wZ8Sw40pBa6SZB3z3+RBmXZPsm7iGBiLCgHsjR5jAI8YWCoiM6CqJwCGmJj+41Qx54qNGD/0 ijgDatF0jXV3+2Dnv3pkqsdj6 X-Received: by 2002:a7b:c398:0:b0:43d:5264:3cf0 with SMTP id 5b1f17b1804b1-43ebef8f615mr76695675e9.11.1743806124624; Fri, 04 Apr 2025 15:35:24 -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-43ec16602bbsm59985425e9.9.2025.04.04.15.35.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Apr 2025 15:35:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Gustavo Romero , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.1 0/9] target/arm: Remove some TARGET_AARCH64 uses (MTE & gdbstub) Date: Sat, 5 Apr 2025 00:35:12 +0200 Message-ID: <20250404223521.38781-1-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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=unavailable 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'd like to reduce the use on TARGET_$arch definitions. This series convert few to runtime checks, mostly in MTE and gdbstub. Philippe Mathieu-Daudé (9): target/arm: Remove uses of TARGET_AARCH64 in arch_dump.c target/arm: Remove use of TARGET_AARCH64 in dump.c target/arm: Remove use of TARGET_AARCH64 in arm_cpu_initfn() target/arm/mte: Include missing headers for GETPC() target/arm/mte: Reduce address_with_allocation_tag() scope target/arm/mte: Rename 'mte_helper.h' as generic 'mte.h' target/arm/mte: Restrict MTE declarations linux-user/arm: Implement MTE stubs for 32-bit user emulation target/arm: Build Aarch64 gdbstub helpers indistinctly linux-user/aarch64/mte_user_helper.h | 27 +--- linux-user/arm/mte_user_helper.h | 34 +++++ target/arm/internals.h | 128 +----------------- target/arm/tcg/mte.h | 190 +++++++++++++++++++++++++++ target/arm/tcg/mte_helper.h | 66 ---------- target/arm/tcg/sve_ldst_internal.h | 1 + linux-user/arm/mte_user_helper.c | 13 ++ target/arm/arch_dump.c | 6 - target/arm/cpu.c | 38 +++--- target/arm/gdbstub.c | 4 - target/arm/gdbstub64.c | 2 +- target/arm/tcg/helper-a64.c | 1 + target/arm/tcg/mte.c | 175 ++++++++++++++++++++++++ target/arm/tcg/mte_helper.c | 170 ++---------------------- target/arm/tcg/sve_helper.c | 1 + target/arm/tcg/translate-a64.c | 1 + target/arm/tcg/translate-sve.c | 1 + linux-user/arm/meson.build | 2 + target/arm/meson.build | 2 +- target/arm/tcg/meson.build | 1 + 20 files changed, 450 insertions(+), 413 deletions(-) create mode 100644 linux-user/arm/mte_user_helper.h create mode 100644 target/arm/tcg/mte.h delete mode 100644 target/arm/tcg/mte_helper.h create mode 100644 linux-user/arm/mte_user_helper.c create mode 100644 target/arm/tcg/mte.c