Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp240505ybg; Tue, 9 Jun 2020 22:43:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4bu97317IoKCTzz/os4+aAmG43kEM2RlLAZVxYcv4K6ZH4rtOa4t9PFZSPBrGwdpMQJpk X-Received: by 2002:a17:906:5243:: with SMTP id y3mr1902984ejm.193.1591767784328; Tue, 09 Jun 2020 22:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591767784; cv=none; d=google.com; s=arc-20160816; b=YTZkZrcYLZsf/sNYuhVgl/zKex15MXEG3P3KssnW4wbc9y/slTeimFhqD/NGHvChhs hjnREvctY7r081vuJeMLIA8PM4ODl6yvcQ9Ilvtde+vXBefk19Joa7qZ75smRTS7hd4p Uiyui0gdAMJxBH3ndMTcAGbOoRjuNbvt2WXAOQh9h0SAkO9CIRmkjc2tEw38NqIYIWMm vEQSKfU4eU5dtltPMYrrJYymSQToHCJj1PM4L1idfBVq3fmXpIVdrgM+t2trBQIMr3b4 6xFUHTg6Q2qJHmXxoQqV7j3l/yzUO1Ss2oX0pnV76YudIdPCb20IsyvzrDnyCPD2wfzn 3h7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=Be+2Ke3DKJ/ap5oHppZ/DAXciQH4xsJhc0NC4KyHuRw=; b=m9pMo6av7rzlFW0KEH9JMGlpeXPkZ39X6gk5qC8H+IW4adRJNCA8EpO8pwOY8UL6FI ViTgE2NDkAPNAd4mnCIERByekeuMZUkNciCCdsQ3+qcD2E9vkx+duO432BldsXUX4/OJ EeG1KRuA+8UY8r6gz5D097CZ35DAT9CsBSQ+AWgHugzFuT3NooKcBxyiUZeB1goc9VE5 +nDR7mlB5Uj2/En2BJAf6SswPeks71rQwqAbsOT6iFYBJm0UjdP40gqSaFdyaUL7k92D PozmHQXcuEsrcSxEWmP/YnvRskrTvv9jgIBTQJ4UiqzpU1khXVcjasXVNTTtCZVF7Wa2 vMYQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id md12si11162901ejb.431.2020.06.09.22.42.41; Tue, 09 Jun 2020 22:43:04 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726051AbgFJFif (ORCPT + 99 others); Wed, 10 Jun 2020 01:38:35 -0400 Received: from mga17.intel.com ([192.55.52.151]:29874 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725270AbgFJFif (ORCPT ); Wed, 10 Jun 2020 01:38:35 -0400 IronPort-SDR: sEhrUSelEQUOvyCZfD07huhGmoYPIwGVyNgZUomdMIQrZMkTQN6nqYfpbsBDrlBq5ZGVPQwUaL z7l/o6u3GQVA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2020 22:38:33 -0700 IronPort-SDR: Jh98UpqBE+irruJrjuF63PYRxhFGIGJ+//fv6RL8eiITuw1f419WJTlRYg8uEx8FYtwO+2Iw5o W3tLfTt8Gl1Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,494,1583222400"; d="scan'208";a="314403654" Received: from shao2-debian.sh.intel.com (HELO [10.239.13.3]) ([10.239.13.3]) by FMSMGA003.fm.intel.com with ESMTP; 09 Jun 2020 22:38:31 -0700 Subject: Re: [PATCH v7 2/4] lib/test_bitmap.c: Add for_each_set_clump test cases To: Syed Nayyar Waris , Andy Shevchenko Cc: kbuild test robot , Linus Walleij , Andrew Morton , kbuild-all@lists.01.org, William Breathitt Gray , Linux Kernel Mailing List References: <042eddd4b87f0db3588a79d829afe6b23fa8365c.1590017578.git.syednwaris@gmail.com> <202005310310.EOelU2v3%lkp@intel.com> <20200605122428.GD2428291@smile.fi.intel.com> From: Rong Chen Message-ID: Date: Wed, 10 Jun 2020 13:38:03 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/7/20 7:15 AM, Syed Nayyar Waris wrote: > On Fri, Jun 5, 2020 at 5:54 PM Andy Shevchenko > wrote: >> On Fri, Jun 05, 2020 at 02:12:54AM +0530, Syed Nayyar Waris wrote: >>> On Sun, May 31, 2020 at 12:50 AM kbuild test robot wrote: >>>>>> WARNING: modpost: lib/test_bitmap.o(.data+0xe80): Section mismatch in reference from the variable clump_test_data to the variable .init.rodata:clump_exp1 >>>> The variable clump_test_data references >>>> the variable __initconst clump_exp1 >>>> If the reference is valid then annotate the >>>> variable with or __refdata (see linux/init.h) or name the variable: >>>> >>>> -- >>>>>> WARNING: modpost: lib/test_bitmap.o(.data+0xec8): Section mismatch in reference from the variable clump_test_data to the variable .init.rodata:clump_exp2 >>>> The variable clump_test_data references >>>> the variable __initconst clump_exp2 >>>> If the reference is valid then annotate the >>>> variable with or __refdata (see linux/init.h) or name the variable: >>>> >>>> -- >>>>>> WARNING: modpost: lib/test_bitmap.o(.data+0xf10): Section mismatch in reference from the variable clump_test_data to the variable .init.rodata:clump_exp3 >>>> The variable clump_test_data references >>>> the variable __initconst clump_exp3 >>>> If the reference is valid then annotate the >>>> variable with or __refdata (see linux/init.h) or name the variable: >>>> >>>> -- >>>>>> WARNING: modpost: lib/test_bitmap.o(.data+0xf58): Section mismatch in reference from the variable clump_test_data to the variable .init.rodata:clump_exp4 >>>> The variable clump_test_data references >>>> the variable __initconst clump_exp4 >>>> If the reference is valid then annotate the >>>> variable with or __refdata (see linux/init.h) or name the variable: >>> I am unable to reproduce the compilation warning. >> You have to enable section mismatch checker. >> >>> I ran the command: >>> make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' lib/ >>> >>> But the compilation warning didn't show up. Can anyone please point to me >>> what I am doing wrong here? How shall I reproduce the warning? Thanks ! >> You put some data into init section of the object, while you are trying to >> access it from non-init one. It's easy-to-fix issue. >> >> -- >> With Best Regards, >> Andy Shevchenko > Thanks! I have made code changes for the above warning. Actually I am > still unable to reproduce the compilation warning. But I believe the > following code fix will fix the compilation warning: > > In file lib/test_bitmap.c > > @@ -692,7 +692,7 @@ struct clump_test_data_params { > unsigned long const *exp; > }; > > -struct clump_test_data_params clump_test_data[] = > +static struct clump_test_data_params clump_test_data[] __initdata = > { {{0}, 2, 0, 64, 8, clump_exp1}, > {{0}, 8, 2, 240, 24, clump_exp2}, > {{0}, 8, 10, 240, 30, clump_exp3}, > > > > Let me know if I should submit a new patchset (v8) for > 'for_each_set_clump' including above code fix. > > Just to share how I attempted to reproduce the warning (but unsuccessful): > > Step 1: Use the config file in attachment. Download, extract, rename > file to .config at the root of the tree. > Step 2: '$ make lib/' > No warning reproduced after above step 2. > Step 3: '$ make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix > -D__CHECK_ENDIAN__' lib/' > After step 3 I got error in build: > scripts/kconfig/conf --syncconfig Kconfig > CHECK scripts/mod/empty.c > No such file: asan-globals=1 > scripts/Makefile.build:266: recipe for target 'scripts/mod/empty.o' failed > make[1]: *** [scripts/mod/empty.o] Error 1 > Makefile:1147: recipe for target 'prepare0' failed > make: *** [prepare0] Error 2 > > The command in above step 3 was mentioned in the bot mail. > > Regards > Syed Nayyar Waris > Hi Syed Nayyar Waris, We can reproduce the warning with the steps in original report, you may need to build the whole kernel instead of the 'lib'. Best Regards, Rong Chen