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=-5.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 43AA3C433DF for ; Thu, 21 May 2020 07:03:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D81362065F for ; Thu, 21 May 2020 07:03:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D81362065F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3F3D480018; Thu, 21 May 2020 03:03:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A57580007; Thu, 21 May 2020 03:03:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2912880018; Thu, 21 May 2020 03:03:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id 0DCE980007 for ; Thu, 21 May 2020 03:03:05 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id BF13F181AEF23 for ; Thu, 21 May 2020 07:03:04 +0000 (UTC) X-FDA: 76839834288.07.sense97_550560500aa5f X-HE-Tag: sense97_550560500aa5f X-Filterd-Recvd-Size: 5197 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Thu, 21 May 2020 07:03:04 +0000 (UTC) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04L6WmZN079417; Thu, 21 May 2020 03:02:19 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 314rxe9rf9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 May 2020 03:02:18 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 04L6ubKD004238; Thu, 21 May 2020 07:02:16 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma04ams.nl.ibm.com with ESMTP id 313xehn46t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 May 2020 07:02:16 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04L72Epe37290034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 May 2020 07:02:14 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 13AF5AE045; Thu, 21 May 2020 07:02:14 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6C07FAE05F; Thu, 21 May 2020 07:02:13 +0000 (GMT) Received: from linux.ibm.com (unknown [9.148.206.2]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 21 May 2020 07:02:13 +0000 (GMT) Date: Thu, 21 May 2020 10:02:11 +0300 From: Mike Rapoport To: Andrew Morton Cc: kbuild test robot , kbuild-all@lists.01.org, Linux Memory Management List , Randy Dunlap Subject: Re: [linux-next:master 10679/10701] arch/x86/mm/pgtable.c:427:2: warning: variable length array 'u_pmds' is used Message-ID: <20200521070211.GO1059226@linux.ibm.com> References: <202005210343.GBNjOjOX%lkp@intel.com> <20200520161101.46deeeaac1cff608573ccec3@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200520161101.46deeeaac1cff608573ccec3@linux-foundation.org> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-21_03:2020-05-20,2020-05-21 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 bulkscore=0 clxscore=1011 cotscore=-2147483648 malwarescore=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 priorityscore=1501 mlxlogscore=999 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005210043 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 Wed, May 20, 2020 at 04:11:01PM -0700, 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. Not really :) Thanks for the fix! Acked-by: Mike Rapoport > --- 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 > _ > -- Sincerely yours, Mike.