From patchwork Fri Mar 14 13:16:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 873440 Delivered-To: patch@linaro.org Received: by 2002:a5d:4308:0:b0:38f:210b:807b with SMTP id h8csp702339wrq; Fri, 14 Mar 2025 06:18:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXX7TsLwFJP9wSpjDbsS7C4oE3k8l4h4s3WoqGGAQGRjOKpFC0HlfLKrZf572MW7rNUVU0j3w==@linaro.org X-Google-Smtp-Source: AGHT+IF+oZoMKSUlajSNM1IHOqUw5783SPWv23hZ83olO8nW1tZOeOtXgZ0ltYUIt2ySQyW7M33d X-Received: by 2002:ac8:5954:0:b0:472:bbb:1bab with SMTP id d75a77b69052e-476c8145813mr31005971cf.24.1741958289926; Fri, 14 Mar 2025 06:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741958289; cv=none; d=google.com; s=arc-20240605; b=DZ9RW574Bsth8aMFroBjS/sm/H+JT0jM+4Bcd4GEsX3qiHdSh397JSQg7Rk4HxVdcb L8R5Jrdn4T2F1czfAHXAOViWq6Wqx41BA7KQYTAjKpBRGzAtLWZ8q/to8qHJTsSWSC9U FMIQMdM4Gsutht0rJ1I9BrqY3fjvP8cTo7wrGOMpLUFdHxg5zawmySNI/Iw+mnn0PgQz 87AFshcjYZ+v7D5+FUdSBrShizH5wsOUbrD1bpPpqSvdxgA+q+N7O4eh71eeNotqB5+s w91j+GzQpU2Xt07f+Y8SZvXrrpp1QOw/r7lyo8PF/Kpwb/+ZKzpEz9NFZGP2hF5VIuQm Pv4g== 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=5P8dI0LglzsFCzU+xe5Ql8suIL1Ju80i0bFOQatlqoo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=dolYZ7ethwGJ0oO1E9qd4dX6AhhiBjvf+eijUhK3ygwJblifxW3VFsDYqUpkHGKZuX m/5DFSH2dpQUSeCxUvQxB4+rLR5bdqMCzYu8Xxvqtyh9loojcYUKjjJ+27h2ABkYyujG fHMfzZ8AWSZxgfp5+PwsF6UE/EpWBp4xjor/4EKv+RwRJADsgGOcDa8+qGXg4KkeQmEt gzOtYHgLBmCxem0dJSoEwBHIH8A0h38nY2H2G7johNdFgPLmF0qKZZG92QJcMACd76Xw yC2jc/Zt34w5gB3UndsTSF7XVAdsvZfDyUPb8Vyo+YQA97V7Txv1zTUT550h62Ga3U4s yNgQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CQrpiDW8; 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-476bb7e1cd0si40495911cf.328.2025.03.14.06.18.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Mar 2025 06:18:09 -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=CQrpiDW8; 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 1tt4u8-00057Y-Er; Fri, 14 Mar 2025 09:16:48 -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 1tt4u7-000574-4x for qemu-devel@nongnu.org; Fri, 14 Mar 2025 09:16:47 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tt4u5-00013Z-Ds for qemu-devel@nongnu.org; Fri, 14 Mar 2025 09:16:46 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43cfebc343dso13290185e9.2 for ; Fri, 14 Mar 2025 06:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741958204; x=1742563004; 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=5P8dI0LglzsFCzU+xe5Ql8suIL1Ju80i0bFOQatlqoo=; b=CQrpiDW8ySkM8T7K4el0Rh0kasmyLBTefy+py52VN09NqLUguHvN+L3GT1VHztSKhP HN3vO/kOY368PkJ+4Ni//02ItkBQ9GPmDZl0s1Z6EGj/c6QMhiJTcKafTjZEaqhIu5sw lu/KaDOpAir6MOIYHqqFB7fjWYB6gOjFkqrTvaOjSOipBqXOo7KLAKgES6qB0fCT6Jy5 ARFn6vsJgtGCfXCNZZkxmGijzljYY5Iyw2OoDDsF4gCs98yH0y0OVnMPRdb77tadCnnt JRvrWK/7Cf1PBMw9O9pUwYrdAxPbKLpxxGeaKFh+btq2oCQKgi7fnrkLSPC9c2iW1cEK kk4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741958204; x=1742563004; 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=5P8dI0LglzsFCzU+xe5Ql8suIL1Ju80i0bFOQatlqoo=; b=CKi0BfjdsBYQc1hmY3xA4FEMUJrYMOtc52UhhnpDFBNFyKI9ND+udOuoc/0UkSiNHQ /xrJm+d6+EqKQFu+hzSe5jb5xGxCxV4nbI6llcZOfcSyWH9/TxSJX/MH8p0NtCJMt5AG VR1bfadrdWHyf7XDLTdNfBW+YU0ryfQoMaCHggp9/EW6u1xskCz5tFQjcHuYRGUeHaUG GuFVe87giJTVu0FWWOYmXIp6IcFs67i4jqDRWVxP4w5xstAfSZd9qcMobwOJ1VqxrU5h uSie5WQx08OopZDDmuq76N0PohNqAHBZi0w2usxZ42zmSdDQYXkV/eEiqGw7mzNLKpoF tZgQ== X-Gm-Message-State: AOJu0YyQI+szSfFdfHFjY/74UmvSd7xL5ztBycqnZkHdB12FwYzYEo6D RKpfPhdfbFbI3elUbG3L/yfo9RW3V6dZ+Zk+lcvHwO8txhh1EmnZPeB+QW9UXzQlPbu3YNxX07V L X-Gm-Gg: ASbGnctssegS5LvwenaXSZ/042Gm8cEzYBJUXSzx7v+2x0o54gKGpvwl245Xwd+eQB9 KJiLRBgwB+Ed8CEONWC1D+AXoE9pwYC/bwPrHZdTN1SC2JFax2b6c+TKAdk4vLTMA0yDOCYElvE NYpyfpPWKE6bQogpXwkCUGYKTLuUwaEkPXuqMKjhTHdpwf18czj/J+CxKuWwCutAuzhZTrUiWte 5sE+U/uOV5w06A1ki2C/tjzCphzakvwpNisEMGmtvx5V1PJ5d8HV/kTqri4t5obN/gA5I7Urw0+ W1xKpFko+wuROAtv1zIqGRNGfTe+12JBCCerrXRTDw0SBssjye4= X-Received: by 2002:a5d:588c:0:b0:391:47d8:de3a with SMTP id ffacd0b85a97d-3971f7f6c9cmr2880347f8f.53.1741958203799; Fri, 14 Mar 2025 06:16:43 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-395cb7eb93csm5437923f8f.86.2025.03.14.06.16.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 06:16:43 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/17] linux-user/arm: Remove unused get_put_user macros Date: Fri, 14 Mar 2025 13:16:24 +0000 Message-ID: <20250314131637.371866-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250314131637.371866-1-peter.maydell@linaro.org> References: <20250314131637.371866-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.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 In linux-user/arm/cpu_loop.c we define a full set of get/put macros for both code and data (since the endianness handling is different between the two). However the only one we actually use is get_user_code_u32(). Remove the rest. We leave a comment noting how data-side accesses should be handled for big-endian, because that's a subtle point and we just removed the macros that were effectively documenting it. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- linux-user/arm/cpu_loop.c | 43 ++++----------------------------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c index 10d8561f9b9..7416e3216ea 100644 --- a/linux-user/arm/cpu_loop.c +++ b/linux-user/arm/cpu_loop.c @@ -36,45 +36,10 @@ __r; \ }) -#define get_user_code_u16(x, gaddr, env) \ - ({ abi_long __r = get_user_u16((x), (gaddr)); \ - if (!__r && bswap_code(arm_sctlr_b(env))) { \ - (x) = bswap16(x); \ - } \ - __r; \ - }) - -#define get_user_data_u32(x, gaddr, env) \ - ({ abi_long __r = get_user_u32((x), (gaddr)); \ - if (!__r && arm_cpu_bswap_data(env)) { \ - (x) = bswap32(x); \ - } \ - __r; \ - }) - -#define get_user_data_u16(x, gaddr, env) \ - ({ abi_long __r = get_user_u16((x), (gaddr)); \ - if (!__r && arm_cpu_bswap_data(env)) { \ - (x) = bswap16(x); \ - } \ - __r; \ - }) - -#define put_user_data_u32(x, gaddr, env) \ - ({ typeof(x) __x = (x); \ - if (arm_cpu_bswap_data(env)) { \ - __x = bswap32(__x); \ - } \ - put_user_u32(__x, (gaddr)); \ - }) - -#define put_user_data_u16(x, gaddr, env) \ - ({ typeof(x) __x = (x); \ - if (arm_cpu_bswap_data(env)) { \ - __x = bswap16(__x); \ - } \ - put_user_u16(__x, (gaddr)); \ - }) +/* + * Note that if we need to do data accesses here, they should do a + * bswap if arm_cpu_bswap_data() returns true. + */ /* * Similar to code in accel/tcg/user-exec.c, but outside the execution loop.