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 X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B50AC433DB for ; Tue, 12 Jan 2021 20:19:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AF51322EBE for ; Tue, 12 Jan 2021 20:19:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF51322EBE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 032B76B00C9; Tue, 12 Jan 2021 15:19:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F24916B00CA; Tue, 12 Jan 2021 15:19:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E13446B00CB; Tue, 12 Jan 2021 15:19:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id CB5D66B00C9 for ; Tue, 12 Jan 2021 15:19:51 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 91C84824556B for ; Tue, 12 Jan 2021 20:19:51 +0000 (UTC) X-FDA: 77698238982.21.coat64_4e12dbc27518 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 6F899180442C2 for ; Tue, 12 Jan 2021 20:19:51 +0000 (UTC) X-HE-Tag: coat64_4e12dbc27518 X-Filterd-Recvd-Size: 5538 Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 Jan 2021 20:19:50 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id q137so6777501iod.9 for ; Tue, 12 Jan 2021 12:19:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=hqBhnD/YzU63I8fHxCwq5RnpR9+xGyHPmW1V90kKSXE=; b=WvjLszQeGk0CFa474M0yChwiiM3glOYsxHTou4p63gbdsVL6cS5rlyO4XY3k5pfXiL QVhejmGASkdxp4uwpIeHitUR2rtAOGEvhHAeEB+evGPrFcNiUUG9YA0sKgTuNZOarUZx UV+mew40rVFnMSiVod6kUwe7EOYvFD4y2bK+ymv4UOV6T4OrgC81qqLPK0d04F+qBzbQ 3Z/G7EbYwFAgH86Iau6up4H2BfCoBafQAALka6NcJlEE5W3S98L7OnnsVDZMEhXSTLCs nvJavo0EydXQcHyadE8NxnIow5uG2M6goFfuexczgJ0RUyHXoi23O8aKDVE6yhUCvSc2 PjjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=hqBhnD/YzU63I8fHxCwq5RnpR9+xGyHPmW1V90kKSXE=; b=YY2YOOVioOfh1Hq/hrsgFJKA0TYdHFaHyR5Zh6JOZIPrwPShwPw90FKKAKvRkRj6DO 96Y6RAkoQI7GqnhVRMw6wlG8Y3GvRrpeJsHGW5vsest/Er+0QXEVZufoiX4b8oRARVwK sf8PwE0S4PlnfxuLPp4a1I7apzk4orTC4nlI6EcH42E/cHLXE5JAI3x7+nljnZWxzMzT vzQD3Foz9Y14vUxaxkmYjMJuulsrPSqC735UGg46r91By5bPNyj0MtTZfuiQiuP7iRwy gbJU1Ql0116saoB2eujRIHHJ6K7BJjTR4elNAlB7GW5VObttBHZorvw7vFO6Ad7mhxuL 5v3g== X-Gm-Message-State: AOAM5328Z7Xf3og0+kDcn1Sj2Dh8FqeezATRc7ms5a16GCwbTeenqAzG StIxN/2PzqAcgsNFCjoBXculyF9fUFuy45u+1to= X-Google-Smtp-Source: ABdhPJyPeblMR/1wzzZ8m4nFrXKaJGmWrubgj6M4b44eeTcXk49LIQoTeKzdkjYkdbT+y2h/KicOo1C6QtyZwIQDJPg= X-Received: by 2002:a92:c002:: with SMTP id q2mr849018ild.186.1610482790007; Tue, 12 Jan 2021 12:19:50 -0800 (PST) MIME-Version: 1.0 References: <20201230154104.522605-1-arnd@kernel.org> <20210112191634.GA1587546@ubuntu-m3-large-x86> In-Reply-To: <20210112191634.GA1587546@ubuntu-m3-large-x86> Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Tue, 12 Jan 2021 21:19:38 +0100 Message-ID: Subject: Re: [PATCH] mm/mremap: fix BUILD_BUG_ON() error in get_extent To: Nathan Chancellor Cc: Arnd Bergmann , Andrew Morton , Nick Desaulniers , "Kirill A. Shutemov" , Wei Yang , Arnd Bergmann , Vlastimil Babka , Dmitry Safonov <0x7f454c46@gmail.com>, Brian Geffon , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Clang-Built-Linux ML Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Jan 12, 2021 at 8:16 PM Nathan Chancellor wrote: > > On Wed, Dec 30, 2020 at 04:40:40PM +0100, Arnd Bergmann wrote: > > From: Arnd Bergmann > > > > clang cannt evaluate this function argument at compile time > > when the function is not inlined, which leads to a link > > time failure: > > > > ld.lld: error: undefined symbol: __compiletime_assert_414 > > >>> referenced by mremap.c > > >>> mremap.o:(get_extent) in archive mm/built-in.a > > > > Mark the function as __always_inline to avoid it. > > > > Fixes: 9ad9718bfa41 ("mm/mremap: calculate extent in one place") > > Signed-off-by: Arnd Bergmann > > I would like to see some movement on getting this fixed in 5.11. As it > stands, this is one of three __compiletime_assert references with > CONFIG_UBSAN_UNSIGNED_OVERFLOW. If we want to keep the BUILD_BUG() > around, I think this is fine. Alternatively, turning it into a runtime > check would be fine too. > > Reviewed-by: Nathan Chancellor > I have this patch in my custom 5.11 queue. Feel free to add my: Tested-by: Sedat Dilek - Sedat - > > --- > > mm/mremap.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/mm/mremap.c b/mm/mremap.c > > index c5590afe7165..1cb464a07184 100644 > > --- a/mm/mremap.c > > +++ b/mm/mremap.c > > @@ -336,8 +336,9 @@ enum pgt_entry { > > * valid. Else returns a smaller extent bounded by the end of the source and > > * destination pgt_entry. > > */ > > -static unsigned long get_extent(enum pgt_entry entry, unsigned long old_addr, > > - unsigned long old_end, unsigned long new_addr) > > +static __always_inline unsigned long get_extent(enum pgt_entry entry, > > + unsigned long old_addr, unsigned long old_end, > > + unsigned long new_addr) > > { > > unsigned long next, extent, mask, size; > > > > -- > > 2.29.2 > > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20210112191634.GA1587546%40ubuntu-m3-large-x86.