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=-7.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 1475DC433DF for ; Wed, 20 May 2020 23:51:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C1B20207C4 for ; Wed, 20 May 2020 23:51:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="uQXjL/0B" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1B20207C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4BCFB8000A; Wed, 20 May 2020 19:51:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 46DED80009; Wed, 20 May 2020 19:51:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 384218000A; Wed, 20 May 2020 19:51:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id 1C84E80009 for ; Wed, 20 May 2020 19:51:07 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D1529499614 for ; Wed, 20 May 2020 23:51:06 +0000 (UTC) X-FDA: 76838745732.19.hate99_6093c53603c2a X-HE-Tag: hate99_6093c53603c2a X-Filterd-Recvd-Size: 3932 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Wed, 20 May 2020 23:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=fub61ZzBl3YyrE3lUArpQ6sPTF/Cr0pVpAo+AF2WL2o=; b=uQXjL/0BJJTmUJxxZ5n6NZslxG xDAPQP2mCOO9iaLY/os4moKJK9kWieW8dmkERbrtWLdbrb980X2EAYqIqWMXJvXA9aM+xyTHF0sVw JodptmIfInsLyH5YXqyS+QyOdatWixCb1mQB1MDQzVFpfnDjnZuwVBT5xfTe5zcFXFusRPh/PwJOl V/frk34RUbSOAXO7cs1/X7O5pgbN/DdmW4J1N1+ZOViQuvezHT3s0x+NuQY+SSlKFILgTN/YICd5f 0MAQPZpMx8F879jsQJDE9P6RIZp1RBEkpxqRZ4m0tVg9VpOSegGchtmNKbGNKpkggnrfk2PvIAC3M srRM8fYg==; Received: from [2601:1c0:6280:3f0::19c2] by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbYUH-0000q0-Q4; Wed, 20 May 2020 23:51:02 +0000 Subject: Re: [linux-next:master 10679/10701] arch/x86/mm/pgtable.c:427:2: warning: variable length array 'u_pmds' is used To: Andrew Morton , kbuild test robot Cc: Mike Rapoport , kbuild-all@lists.01.org, Linux Memory Management List References: <202005210343.GBNjOjOX%lkp@intel.com> <20200520161101.46deeeaac1cff608573ccec3@linux-foundation.org> From: Randy Dunlap Message-ID: <87db3e54-5d09-d09a-fb30-51feea8d7821@infradead.org> Date: Wed, 20 May 2020 16:50:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200520161101.46deeeaac1cff608573ccec3@linux-foundation.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 5/20/20 4:11 PM, Andrew Morton wrote: > On Thu, 21 May 2020 03:56:53 +0800 kbuild test robot wrote: > >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master >> head: fb57b1fabcb28f358901b2df90abd2b48abc1ca8 >> commit: 0e19fc1c40bd7516d5a30a459db4f49d48910847 [10679/10701] mm: consolidate pgd_index() and pgd_offset{_k}() definitions >> config: i386-randconfig-a005-20200520 (attached as .config) >> compiler: gcc-4.9 (Ubuntu 4.9.3-13ubuntu2) 4.9.3 >> reproduce: >> git checkout 0e19fc1c40bd7516d5a30a459db4f49d48910847 >> # save the attached .config to linux build tree >> make ARCH=i386 >> >> If you fix the issue, kindly add following tag as appropriate >> Reported-by: kbuild test robot >> >> All warnings (new ones prefixed by >>, old ones prefixed by <<): >> >> arch/x86/mm/pgtable.c: In function 'pgd_alloc': >>>> arch/x86/mm/pgtable.c:427:2: warning: variable length array 'u_pmds' is used [-Wvla] >> pmd_t *u_pmds[MAX_PREALLOCATED_USER_PMDS]; >> ^ >>>> arch/x86/mm/pgtable.c:428:2: warning: variable length array 'pmds' is used [-Wvla] >> pmd_t *pmds[MAX_PREALLOCATED_PMDS]; >> ^ > > Thanks. This works for me - perhaps Mike can come up with something smarter. Works for me too. Thanks. Acked-by: Randy Dunlap # build-tested > --- a/include/linux/pgtable.h~mm-consolidate-pgd_index-and-pgd_offset_k-definitions-fix > +++ a/include/linux/pgtable.h > @@ -62,11 +62,8 @@ static inline unsigned long pud_index(un > #endif > > #ifndef pgd_index > -static inline unsigned long pgd_index(unsigned long address) > -{ > - return ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)); > -} > -#define pgd_index pgd_index > +/* Must be a compile-time constant, so implement it as a macro */ > +#define pgd_index(a) (((a) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) > #endif > > #ifndef pte_offset_kernel > _ > > -- ~Randy