Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6684332rdb; Fri, 15 Dec 2023 05:51:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwD2UaBa/eL3HlhUd3zKvn4f/dSpGcnBNjLW4bXPZzbbPlfkoDyBuDkphQTTPJWCGhsOtT X-Received: by 2002:a05:6a20:8f14:b0:18f:f955:1ec8 with SMTP id b20-20020a056a208f1400b0018ff9551ec8mr13553957pzk.51.1702648269219; Fri, 15 Dec 2023 05:51:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702648269; cv=none; d=google.com; s=arc-20160816; b=ifIFfXI5hPrXNc+XOQjdpqpGvqYV1+Qw59MdQ6kTfiT2kWatzrAqLYAG/VIHn6jahR TjIaNcH+V2t3H8AJe+37saLuhtOjPXuBOgrXHycLMTwMh859vyl/wOAVjvPSbt6yK7JD 8MI7SHh61ZiW70s+vw0sZk07ckum1rNJr1YNhEYjYxNPOb88esRR8u/+7A+yC9qfsrjC IMDLkdV/wrLkv+JPEJ1TdhvIlLlrX7eOzYtDNP5PARtnB1E6APpj19czyGHfZB7VVkUY 8cZOZRCL7eJywaXNnTelgCi5oFfXlEDQ85AKoRy+uMYCO8MobMOMqiSHAS4V7PKbg283 bNHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=1HXhZgm2KkUlyu5b8KNlF7ArHnA4+P3oSeWy+Kyy1js=; fh=LrzVOhTAwD+cBo9TSquPJyeKSNG6LE3kkUXvC2SIuio=; b=YUX9qeUym+83MNM5HmmXKBSHrmIZXa94+M2K1PP994/ntco7h4XEdDx2bStKfPhtGc +otiBjOuAFETfKg1125Q6ekx2m8TIBX9jM2EzMPjL3XeYXhcZB288Ohd18zfrqWw1gr/ BxqF6Y2iQuCX+jxwkZPrU/JzvpHE5ssQF2vO15aI3+PxCAswrztP5ULBXl81vgGxrA60 /jQq9/l8uKTqo+eosdOrN/JGQ03uq5Gw1zQVsZ+HfcSFJnyoE8WwYOt4nilspU8wWSjC 0KO8INfleAv3bN8AgHPnClG21ofzQeNgFkn4GYFxvmHNJvVYJ6Qb0SoIf7jdt+d8r3Ht m1hg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1041-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m13-20020a056a00080d00b006d0d83a11a9si4214775pfk.100.2023.12.15.05.51.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 05:51:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-1041-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1041-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 91EE7B21C8F for ; Fri, 15 Dec 2023 13:51:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 194BC2E40B; Fri, 15 Dec 2023 13:50:58 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BDDC92DB88; Fri, 15 Dec 2023 13:50:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ghiti.fr Received: by mail.gandi.net (Postfix) with ESMTPSA id 04DB12000E; Fri, 15 Dec 2023 13:50:47 +0000 (UTC) Message-ID: <0b4f729b-fe97-4a42-b00c-d3e908cb3839@ghiti.fr> Date: Fri, 15 Dec 2023 14:50:47 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 5/5] tools: selftests: riscv: Fix compile warnings in mm tests Content-Language: en-US To: Christoph Muellner , linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , Albert Ou , Shuah Khan Cc: Philipp Tomsich , Andrew Jones , Evan Green , Xiao Wang , Alexandre Ghiti , Andy Chiu , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Charlie Jenkins References: <20231123185821.2272504-1-christoph.muellner@vrull.eu> <20231123185821.2272504-6-christoph.muellner@vrull.eu> From: Alexandre Ghiti In-Reply-To: <20231123185821.2272504-6-christoph.muellner@vrull.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-Sasl: alex@ghiti.fr On 23/11/2023 19:58, Christoph Muellner wrote: > From: Christoph Müllner > > When building the mm tests with a riscv32 compiler, we see a range > of shift-count-overflow errors from shifting 1UL by more than 32 bits > in do_mmaps(). Since, the relevant code is only called from code that > is gated by `__riscv_xlen == 64`, we can just apply the same gating > to do_mmaps(). > > Signed-off-by: Christoph Müllner > --- > tools/testing/selftests/riscv/mm/mmap_test.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/tools/testing/selftests/riscv/mm/mmap_test.h b/tools/testing/selftests/riscv/mm/mmap_test.h > index 9b8434f62f57..2e0db9c5be6c 100644 > --- a/tools/testing/selftests/riscv/mm/mmap_test.h > +++ b/tools/testing/selftests/riscv/mm/mmap_test.h > @@ -18,6 +18,8 @@ struct addresses { > int *on_56_addr; > }; > > +// Only works on 64 bit > +#if __riscv_xlen == 64 > static inline void do_mmaps(struct addresses *mmap_addresses) > { > /* > @@ -50,6 +52,7 @@ static inline void do_mmaps(struct addresses *mmap_addresses) > mmap_addresses->on_56_addr = > mmap(on_56_bits, 5 * sizeof(int), prot, flags, 0, 0); > } > +#endif /* __riscv_xlen == 64 */ > > static inline int memory_layout(void) > { You can add: Reviewed-by: Alexandre Ghiti Thanks! Alex