From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D590C433EF for ; Wed, 1 Jun 2022 13:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j030dWDSLBvUoDCsTU0WVgpvasxt2z1C3RHB03vZxms=; b=DqE+xbOz0obHPn A22FWEuCTetl53+hdOIrY2TfHCZaWRllcbt2viOsZml77Uc+Kw2/7ip4e50T8KlNsSX6BERMxxujg PWyPd+y8tSKGm3ZrO350nN/SRdyv7ee9b1akpmZmkv/U8jYSUyxZqQW979BlRw7v/zRlRXmnnPIuI UOWXPP4zQDv61rh61O34VDEaD7bc6zj3oVY/dz2+1tb/pjN18ISmfm8xyxAqBZAPrE0f2zOkNbbT3 A3j69SGYLWlxqgbQ/ooFZJQaxMTOTIkZSjDrdQj5LFIPkgUQ4I/aQ6v8RelcblbRz8gRExQofqTk1 gA8ZVyGrsQC3lt9wN5qw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwOac-00GJwv-Fm; Wed, 01 Jun 2022 13:40:46 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwOaP-00GJsB-Bt for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2022 13:40:35 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5DF65ED1; Wed, 1 Jun 2022 06:40:25 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1BD893F73D; Wed, 1 Jun 2022 06:40:24 -0700 (PDT) Date: Mon, 30 May 2022 16:05:17 +0100 From: Andre Przywara To: Alexandru Elisei Cc: will@kernel.org, julien.thierry.kdev@gmail.com, maz@kernel.org, suzuki.poulose@arm.com, julien@xen.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, james.morse@arm.com Subject: Re: [PATCH v3 kvmtool 02/13] sizes.h: Make all sizes 64bit Message-ID: <20220530160517.657115f8@donnerap.cambridge.arm.com> In-Reply-To: <20220525112345.121321-3-alexandru.elisei@arm.com> References: <20220525112345.121321-1-alexandru.elisei@arm.com> <20220525112345.121321-3-alexandru.elisei@arm.com> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220601_064033_568130_7AA061E5 X-CRM114-Status: GOOD ( 15.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 25 May 2022 12:23:34 +0100 Alexandru Elisei wrote: Hi, > Append ULL to all of the size definitions to make them 64bit and avoid > overflows. I am not fully convinced this is the best solution, as it deviates from the kernel file, and just papers over issues at the call sites. I acknowledge the pragmatic approach of trying to fix multiple problems at once, but am wondering if we should use -fsanitize=undefined to identify problematic code and fix it (I started doing this, actually). Cheers, Andre > Reported-by: Andre Przywara > Signed-off-by: Alexandru Elisei > --- > include/linux/sizes.h | 64 +++++++++++++++++++++---------------------- > 1 file changed, 32 insertions(+), 32 deletions(-) > > diff --git a/include/linux/sizes.h b/include/linux/sizes.h > index ce3e8150c174..b2b5c457cf1c 100644 > --- a/include/linux/sizes.h > +++ b/include/linux/sizes.h > @@ -8,40 +8,40 @@ > #ifndef __LINUX_SIZES_H__ > #define __LINUX_SIZES_H__ > > -#define SZ_1 0x00000001 > -#define SZ_2 0x00000002 > -#define SZ_4 0x00000004 > -#define SZ_8 0x00000008 > -#define SZ_16 0x00000010 > -#define SZ_32 0x00000020 > -#define SZ_64 0x00000040 > -#define SZ_128 0x00000080 > -#define SZ_256 0x00000100 > -#define SZ_512 0x00000200 > +#define SZ_1 0x00000001ULL > +#define SZ_2 0x00000002ULL > +#define SZ_4 0x00000004ULL > +#define SZ_8 0x00000008ULL > +#define SZ_16 0x00000010ULL > +#define SZ_32 0x00000020ULL > +#define SZ_64 0x00000040ULL > +#define SZ_128 0x00000080ULL > +#define SZ_256 0x00000100ULL > +#define SZ_512 0x00000200ULL > > -#define SZ_1K 0x00000400 > -#define SZ_2K 0x00000800 > -#define SZ_4K 0x00001000 > -#define SZ_8K 0x00002000 > -#define SZ_16K 0x00004000 > -#define SZ_32K 0x00008000 > -#define SZ_64K 0x00010000 > -#define SZ_128K 0x00020000 > -#define SZ_256K 0x00040000 > -#define SZ_512K 0x00080000 > +#define SZ_1K 0x00000400ULL > +#define SZ_2K 0x00000800ULL > +#define SZ_4K 0x00001000ULL > +#define SZ_8K 0x00002000ULL > +#define SZ_16K 0x00004000ULL > +#define SZ_32K 0x00008000ULL > +#define SZ_64K 0x00010000ULL > +#define SZ_128K 0x00020000ULL > +#define SZ_256K 0x00040000ULL > +#define SZ_512K 0x00080000ULL > > -#define SZ_1M 0x00100000 > -#define SZ_2M 0x00200000 > -#define SZ_4M 0x00400000 > -#define SZ_8M 0x00800000 > -#define SZ_16M 0x01000000 > -#define SZ_32M 0x02000000 > -#define SZ_64M 0x04000000 > -#define SZ_128M 0x08000000 > -#define SZ_256M 0x10000000 > -#define SZ_512M 0x20000000 > +#define SZ_1M 0x00100000ULL > +#define SZ_2M 0x00200000ULL > +#define SZ_4M 0x00400000ULL > +#define SZ_8M 0x00800000ULL > +#define SZ_16M 0x01000000ULL > +#define SZ_32M 0x02000000ULL > +#define SZ_64M 0x04000000ULL > +#define SZ_128M 0x08000000ULL > +#define SZ_256M 0x10000000ULL > +#define SZ_512M 0x20000000ULL > > -#define SZ_1G 0x40000000 > -#define SZ_2G 0x80000000 > +#define SZ_1G 0x40000000ULL > +#define SZ_2G 0x80000000ULL > > #endif /* __LINUX_SIZES_H__ */ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel