Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3312201pxb; Tue, 12 Jan 2021 11:19:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzOD721xdT/eYJfNRx/YcGFOjavFkCrByDpgnTSRsLu0JOZ44gL/eIDGb5x5upGFDDIb0j X-Received: by 2002:a17:906:94c5:: with SMTP id d5mr209816ejy.427.1610479192509; Tue, 12 Jan 2021 11:19:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610479192; cv=none; d=google.com; s=arc-20160816; b=VBs1kU7IwuLVTCqbqjayOvpO3du3jjZ2l7/DlV/zwRozJeNBhoavsHyJp9Nuqhalef ofNXzipVVN8Z74ABU5vgv82YGWGLWE6ssZ6k7YMpjS3LLWK+TBmpXXQnM5+kiU87QsNq u/I/+w9/NfSAu4hhFhndezf73wLuBt/TjpU4jKYC2r7kKJ1jLyIJ/joG9y8tOMS2pyuz hqqDHJRENTZIVySeoY1RHTrZ2VJjdekIJihDHEOvGaE4UWfLPV/IHvnuqmLEL0NMHKsY SlU084uOq+E+zcVEs56KYNXL2aHHG2M6vOcw2gnLwoVlswKDE5Wiz/2kjHE3iKPizgGn N6Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=o1zIRVvlIdRblMLiKBkvOC2xTqqgWEYJWublDCntGKI=; b=T9JgiIgtRU/VfmrzFQB6Vhx8LMcGSOl4QwbHvNYO2Um4k2Yx+/Hi7IcxgpyxDW26kB dkbE59NXZyM7+voTX4j47+BbSwj4d1mA8cHs083vsw/rXd1GMw2AsZium9n5CQ0E79Vw SQucMeX4wuZqQc5oTo11nwAYhqMovz5aUt0PdIVB654EauCObDh73ONf2ktE8eIFSC9L 0dOKGN2me62oOBpwcrZ/HskT7/9iLqdBApxQmt1F6drnbk4dg7EeozG65fER3RevoUxI yt4x4p4ZIZLSLgeeTj/TQ5sndU60ILb0AFf/sg2M+7sCAavU3p9FmpGUON2begpchlNp Z1cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Da7TPxsZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f5si1767658eds.162.2021.01.12.11.19.28; Tue, 12 Jan 2021 11:19:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Da7TPxsZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406700AbhALTRS (ORCPT + 99 others); Tue, 12 Jan 2021 14:17:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727474AbhALTRR (ORCPT ); Tue, 12 Jan 2021 14:17:17 -0500 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50866C061786 for ; Tue, 12 Jan 2021 11:16:37 -0800 (PST) Received: by mail-qk1-x729.google.com with SMTP id 19so2903865qkm.8 for ; Tue, 12 Jan 2021 11:16:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=o1zIRVvlIdRblMLiKBkvOC2xTqqgWEYJWublDCntGKI=; b=Da7TPxsZbAydOXbhtG7CUOIg2Nm2ArteVZzps33I+QYA88IXOvrAcZmBfOvgKZHrW2 5xKm4Fv17nGR2q7lW9z4dwal24qzwZvB0fa+wGXd9xUmAwIloOeTyaOiarW8n4P0VQNh XQ6nUtz2ZM+af8kIE4paLbqqDdM1UoHefYEcRJjyhw4JQ/M0h5SiddnSe7a+By8xuP2o /03u6z1c91MeNGL1yCzIA/UHTVEJBuH+GTh2XntKVLpnCWoTXMXeQE9Oc65ORn4h3otx 9F+46jMS3FGHED3ZQEuqbG9jDWrOW9imstwH46H9sxdyewZZIeWLuiENVHhglc5mKMxN fcPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=o1zIRVvlIdRblMLiKBkvOC2xTqqgWEYJWublDCntGKI=; b=EdN9ml2H2D+BDkMfjlAT5mltd1cs+1wL3RTjqldT7Lj11PAGwevROougCN1sV7w9cm eSh+E8dbjMTFj9PBNygWLwIvqpHVBZMtGk35ZTXe7rP0O+IiY9Ol1dp/778vKf+wCZP4 ihtk8wDCIp5n9CjssFRDeOGoD0tgjzsvJ7eUkIRGJEbIcj5SYp3S/wuZerXtw7Qp76gz 45CQ9kzYIHNmdBovBIsbWSHVgT4NYthgorrti7qyrZiZsnO0X8aGmU/SpE8M1bV/IImW gsAxmkmGiCSxlM//Aqfl/E6IR0WBWPiWHl6Lwx0jATfIl9bCEGB2es92aTBj3mCYYjPp BU0w== X-Gm-Message-State: AOAM531BMiFbUM2ZEBwabkWNUVZAsFJ63JVJWIGzLa0SXr+2QYYUlJ/0 +wQE+12I0xmsMBfxVlfGjoG4kGMc3TOWkA== X-Received: by 2002:a05:620a:983:: with SMTP id x3mr885878qkx.231.1610478996551; Tue, 12 Jan 2021 11:16:36 -0800 (PST) Received: from ubuntu-m3-large-x86 ([2604:1380:45f1:1d00::1]) by smtp.gmail.com with ESMTPSA id h26sm1694864qtc.81.2021.01.12.11.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 11:16:35 -0800 (PST) Date: Tue, 12 Jan 2021 12:16:34 -0700 From: Nathan Chancellor To: Arnd Bergmann Cc: 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@googlegroups.com Subject: Re: [PATCH] mm/mremap: fix BUILD_BUG_ON() error in get_extent Message-ID: <20210112191634.GA1587546@ubuntu-m3-large-x86> References: <20201230154104.522605-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201230154104.522605-1-arnd@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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