From patchwork Fri Sep 13 17:26:49 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: 828210 Delivered-To: patch@linaro.org Received: by 2002:adf:a2d0:0:b0:367:895a:4699 with SMTP id t16csp362555wra; Fri, 13 Sep 2024 10:29:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWwWwfQICu3GzEC3xH3sU8PBlclf8YiNCaGv4yRXp1cBpXrIUnnGUCXuAd55dhKDiaNrNO87w==@linaro.org X-Google-Smtp-Source: AGHT+IHDAZXVfNOuq89ReTJC1ststzPVnAlA5nLcYx+HYqFig4bgTTzn/SWgxD+boSpOJPsfLA4I X-Received: by 2002:a05:6102:3a0b:b0:498:ea30:6bfb with SMTP id ada2fe7eead31-49d414eaaf3mr8991839137.14.1726248584300; Fri, 13 Sep 2024 10:29:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726248584; cv=none; d=google.com; s=arc-20240605; b=UourNGrLWcB/upN8MmWgvbD7hvUrMIuagm3WC7kOZZvJl1ZGkhwrGzSIehhDJxHg1/ AuVkJBfU8VV1L1H0Dh7hC8jpMuGfWKAgrybyW5FWp4kdAHDFOyMGtyO1wZQ58zHxHnq4 jHZ821rmyUi8E8oW9xYFoKaDxpL8I8X8tEo1kuBrt2sLpMHPBkmXYaFYM9ZIqZcpq6nk 9uek9uHDnYuCGFk31geGb5y1roI3xyN9YP4aoW8MYeGp1ufIBH2J2iujsXs4Q1mRQyZp 7GxqI56pYfi/QVsruHjYVjBMb1Z/394sn7x4JXPWnTUgvenZnOggLGJdE6At7CIg4iKY F9kg== 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=nKDdDxN3APIqbfrXr39czdsb/f5XxemGM9ivAMoMPDg=; fh=Yn9Rr5YRWo7nHBEBYPErLs0SzN9tKEIm+tjOgOQtjBE=; b=WNyXubCigGJu4MrAu/5njU/6yPT4Nveixx9Ei0t19YpLPk/st0CphkZzLnsnuj3IG4 /NSBcZlng4MjkN3Glja6i1aftwpkY/W5uWUfp/Z/6IvuKDLBenPfvKp87go3wG6wrtvI oHizPIfDO+PWrqlRGfR9i8zkiSZAr6HI+yH04bqZ74Vk/7v2McXZaFT39VImSEPXpTvc tI1QqRYBcBjvNb754Y3JzS50kWuxknubesEn7zobln4P50Dux84penHeo1LCdJzGCe9m jKFsrotQvKNQRiUsw9rHSr9eGseuGlJ//FONl0m2KznSLslFUTTbx67rVfMeS4mfLupk ce7A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fPBx9TEI; 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-49c16ccddc0si2490961137.197.2024.09.13.10.29.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Sep 2024 10:29:44 -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=fPBx9TEI; 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 1spA4r-00070F-Mi; Fri, 13 Sep 2024 13:27:25 -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 1spA4l-0006Zo-W2 for qemu-devel@nongnu.org; Fri, 13 Sep 2024 13:27:20 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1spA4b-0005wt-SX for qemu-devel@nongnu.org; Fri, 13 Sep 2024 13:27:17 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5c4226a5af8so1034710a12.1 for ; Fri, 13 Sep 2024 10:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726248428; x=1726853228; 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=nKDdDxN3APIqbfrXr39czdsb/f5XxemGM9ivAMoMPDg=; b=fPBx9TEIQb3ACTGpLP9oYdwHqCVs4seMfMKYpSOhyjeo2+HN1x8FFdxZvc/L1z1tZD ogwnA5rdxIVmcY7nqbhR2H6oSCJvAu5eVQfj9JJlo5ilKhzuNTm+RzixJHT673G02XGU +bE7D9Gv9PM/WZqfm1NYJTSfqpfyt1EMdBfJsbejiGfRc5z7YRzDyxIVtu8wdwK3UArE OM2I6JflhWcVqZtMzheE32bgdhLoDRlkvaivv1gmRAPDgOBxkRD+8ZdOoly0M4MELPn3 H6oFBjm33Q5u7pel/Ld+/vYc2mTGWtNpgYkorGncdWFAbCNB4wUvf6wOVOesRWqEU8sk LS2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726248428; x=1726853228; 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=nKDdDxN3APIqbfrXr39czdsb/f5XxemGM9ivAMoMPDg=; b=W3aQGyjgdZTPLmQ9wDk+MtOI47ktZWx/Epwf70XrKuWBhPY3yd9G6VYf3s1zUqAZ0m oue5DOfbqw4N0Pc0kY6v9PUEcOfmgbIRkpra33kXvGxBqPnRwMAe2+5vnYflZ30//owk pIfLYNWA+4xTNci+R5sS8VCqKzF+/hBuFPTRYIxTrf6KzfVs+i+qcM65WwU9qlDspkDA IH/ngVNkrbnt0EBPqcIlw8lwLhdcLEu/KiR55cTcXDWpFf6G+hXKWlCow3LbLe+Pqf2U 5i+SSQUCzDwQdcQsCXQQRIv7FhEQ30oRKlUYInXJGSCeZSEPpI6UIOHlmFEPQS+Z6Bew 3CmQ== X-Gm-Message-State: AOJu0YwxNlDPj1ODpfFV1H7u/FGqcKfEoz1T1qUD0E/fAz24gPFi9qCw EcEEmDvgzVeZGk86ATDu/n7zdhNPBQKJRiklwrPYus2X3lDFu0aBq/6+EKXj0TQ= X-Received: by 2002:aa7:d9c4:0:b0:5c0:903e:963a with SMTP id 4fb4d7f45d1cf-5c413e5367cmr4076130a12.29.1726248427640; Fri, 13 Sep 2024 10:27:07 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c3ebd8cc28sm7886984a12.83.2024.09.13.10.27.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 10:27:06 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 3295C5FA2F; Fri, 13 Sep 2024 18:26:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Richard Henderson , devel@lists.libvirt.org, Thomas Huth , Mahmoud Mandour , Paolo Bonzini , David Hildenbrand , Ilya Leoshkevich , qemu-ppc@nongnu.org, Zhao Liu , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Yanan Wang , Eduardo Habkost , qemu-s390x@nongnu.org, Alexandre Iooss , Pierrick Bouvier , Nicholas Piggin , Daniel Henrique Barboza , Marcel Apfelbaum Subject: [PATCH 11/17] tests/tcg: only read/write 64 bit words on 64 bit systems Date: Fri, 13 Sep 2024 18:26:49 +0100 Message-Id: <20240913172655.173873-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240913172655.173873-1-alex.bennee@linaro.org> References: <20240913172655.173873-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52a.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 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. Message-Id: <20240910140733.4007719-21-alex.bennee@linaro.org> Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée --- tests/tcg/multiarch/system/memory.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/tests/tcg/multiarch/system/memory.c b/tests/tcg/multiarch/system/memory.c index 8f2371975d..680dd4800b 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) {