From patchwork Wed Sep 18 21:07:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 829416 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp35629wrn; Wed, 18 Sep 2024 14:07:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUtwtS5PaV5hPhNDivwf9+vPeUK4+ZJnCu8JhP2RPw0FC/y23Nkr2rtnAIg3iBnyUtplkd8eA==@linaro.org X-Google-Smtp-Source: AGHT+IHKEneyn2qYZUPns55IhzPVdbuaENMOdDxfeHYc++Y0dVbZGgzLtxJHTRCz8+HtkAAtbbgs X-Received: by 2002:a05:620a:45a5:b0:7a7:f989:58c7 with SMTP id af79cd13be357-7a9e5efa0f5mr3077934685a.17.1726693654520; Wed, 18 Sep 2024 14:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726693654; cv=none; d=google.com; s=arc-20240605; b=deVqjI7q4hg4lJJp5O7dJ5MK3217Y5Cg8QEKqwCUNMyv622fjKEBIXgXrkXSN2u3OO kOdhb9IyxmnLTW04rU+QV7vVNXNESqRwFNivuVh5lSwr/Nby+zHzxgOohQsyo+MrVBDm Vv/npNf2+NDHiMhfqy2tuQpBkgYpGQwxTbZqaEu/eSnytOs0foMzNZRo0HSoD9f8UTbN TR83rfBHMENNGbxGjSZbgmT2wTzso9xBAnRz2SIyALusMyh3Y8Z6+RUeEYIUFcTJ3KHO LPQy/k33+a9k9HEHOpPgvzYc+wFF3jwxRTzqRXa1M/9i3Jy4Gatfcj2ACQ9D+8Y40x1o hEBQ== 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=0gcAPVufwlARI8k9tEcW8Q+w96+wb8gfpJ78TxPW758=; fh=Gx9DtyNvQGBGx72Z12no3KggLYwBGD0Je53Cblw8uQs=; b=PZwTp2H4ZMi5CKu3X4Aw9Xo1TMFiKkx9+kr2k1fi/Wp37E6XYFOBhCVpiOuU2RO2Eg IwWmosbj/aV15scNRvCBZzWCz1wbR6ppT+rN1AD58eOmXEETcg7YSkYsaUNV6/figdKI uS6xVRwXXXx+IaxvkNF8xu+vpmhrTz5w9cQVZBtdHxTj2+ayXQvl3tKU9t+Fun65kP7o mmXVFPeIvVYr4Ynlelb3cMKPGmPJhuOA60ECHjCoJu8PbuiabYH7u73xW59WR++D3oJK fWZgUcBu03aThDyddgNXKXS8by4S8wF3atS3lTJF6E7QMY0MkCi3RJrHA8tswsdN3Qr/ EuOQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A8EXm7xe; 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 af79cd13be357-7acb08178f0si29988585a.201.2024.09.18.14.07.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Sep 2024 14:07:34 -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=A8EXm7xe; 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 1sr1tW-0005Fn-RR; Wed, 18 Sep 2024 17:07:26 -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 1sr1tV-0005AU-Ew for qemu-devel@nongnu.org; Wed, 18 Sep 2024 17:07:25 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sr1tT-0001ds-Rx for qemu-devel@nongnu.org; Wed, 18 Sep 2024 17:07:25 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a8a7cdfdd80so14217166b.0 for ; Wed, 18 Sep 2024 14:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726693642; x=1727298442; 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=0gcAPVufwlARI8k9tEcW8Q+w96+wb8gfpJ78TxPW758=; b=A8EXm7xev3SU5LCSyM53jaU6iAQ54gAk+wpy1jNf5qzJLtogzkVaF2ZiBHMXBb6P9x TvMKKLp7gakCmYXR2bYBPcAwF4gemIedMMIFiOl0C/V2mhPvfKBv+EvpqzuT3Dojpk8d dEzaQt+ndpe9bhLdeJUJazW4G83igfPtO7nGtVH6m20I4R53R/hG6cUK9odrhs9bWF1r IGnHfNrdC9Y8nGsqlyHjSu+eEDOp2Qn64xaW6Ose+KtarfAXckHSolYNHpNARAztX9Ej cAEoOpjx6Cjv3vHBqti3Z/rEN52pI2rhGKgQ7ZNMVdS8s60hBovqCqouWvUlcnxJKItQ FW6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726693642; x=1727298442; 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=0gcAPVufwlARI8k9tEcW8Q+w96+wb8gfpJ78TxPW758=; b=wU0Jwlk+gMrRMXzUiAkuEELlg2ySqcfeoHKzFije1msAWCh+8am0RBKYzw0Xs/Mm1D 2bO/ZelIt1QcoLaXBqElkRaa52EoVaaJzElTx6bbkbUwAax4VMtriGV324TzZXYHh9Bd NxXT1/lcw8UDk2c4Vu7LKL4Wge29psAC3imrp8ACsXu51/0QiEPl+fZMKK31SQyStm+P pRxt4ARRcdNau0X5uiNYdLYKbXZZ0z90N7bgsjsbt5uJgtmmytOOg+gn7jtIltqUxSJC kBlBuIuuh3j077fVNQFxiOEEjdBnUxIcRsdfUTkdvvwQQbF3cwii629DhD5hE8RnbPh9 S9Jg== X-Gm-Message-State: AOJu0Yz1piezIiB4rs3oOkETGK5rnEPqWcbFtoR5uENiYKNYOv9B8iOI JpnFuP7L6z04WvJ0tMnWybsUKa3+zUK6ENAjcDJMWo2/BN65NzVpyyUvyB9Ub+4= X-Received: by 2002:a17:906:794a:b0:a8a:8c8e:f5e6 with SMTP id a640c23a62f3a-a9048108fe6mr2110191066b.49.1726693642099; Wed, 18 Sep 2024 14:07:22 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9060f39a8fsm636426366b.0.2024.09.18.14.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 14:07:16 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 510BF5F94D; Wed, 18 Sep 2024 22:07:13 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier Subject: [PULL 11/18] tests/tcg: only read/write 64 bit words on 64 bit systems Date: Wed, 18 Sep 2024 22:07:05 +0100 Message-Id: <20240918210712.2336854-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20240918210712.2336854-1-alex.bennee@linaro.org> References: <20240918210712.2336854-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62e.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 While the compilers will generally happily synthesise a 64 bit value for you on 32 bit systems it doesn't exercise anything on QEMU. It also makes it hard to accurately compare the accesses to test_data when instrumenting. Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20240916085400.1046925-12-alex.bennee@linaro.org> diff --git a/tests/tcg/multiarch/system/memory.c b/tests/tcg/multiarch/system/memory.c index 8f2371975d..28080767b2 100644 --- a/tests/tcg/multiarch/system/memory.c +++ b/tests/tcg/multiarch/system/memory.c @@ -163,6 +163,7 @@ static void init_test_data_u32(int offset) ml_printf("done %d @ %p\n", i, ptr); } +#if __SIZEOF_POINTER__ >= 8 static void init_test_data_u64(int offset) { uint8_t count = 0; @@ -187,6 +188,7 @@ static void init_test_data_u64(int offset) } ml_printf("done %d @ %p\n", i, ptr); } +#endif static bool read_test_data_u16(int offset) { @@ -254,6 +256,7 @@ static bool read_test_data_u32(int offset) return true; } +#if __SIZEOF_POINTER__ >= 8 static bool read_test_data_u64(int offset) { uint64_t word, *ptr = (uint64_t *)&test_data[offset]; @@ -307,11 +310,16 @@ static bool read_test_data_u64(int offset) ml_printf("done %d @ %p\n", i, ptr); return true; } +#endif /* Read the test data and verify at various offsets */ -read_ufn read_ufns[] = { read_test_data_u16, - read_test_data_u32, - read_test_data_u64 }; +read_ufn read_ufns[] = { + read_test_data_u16, + read_test_data_u32, +#if __SIZEOF_POINTER__ >= 8 + read_test_data_u64 +#endif +}; bool do_unsigned_reads(int start_off) { @@ -476,10 +484,14 @@ bool do_signed_reads(bool neg_first) return ok; } -init_ufn init_ufns[] = { init_test_data_u8, - init_test_data_u16, - init_test_data_u32, - init_test_data_u64 }; +init_ufn init_ufns[] = { + init_test_data_u8, + init_test_data_u16, + init_test_data_u32, +#if __SIZEOF_POINTER__ >= 8 + init_test_data_u64 +#endif +}; int main(void) {