Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp3263495ybg; Sat, 6 Jun 2020 16:18:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/XVTVMKGTzIxj96Wla5znMlOEKu845aF7HVBJjDbJ3ZyXe2vE5np4c+wS3gLvO3cbIQBH X-Received: by 2002:a05:6402:228a:: with SMTP id cw10mr15046479edb.147.1591485522558; Sat, 06 Jun 2020 16:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591485522; cv=none; d=google.com; s=arc-20160816; b=HApSUVrP+h+9mA6dBnhLLBXFWTlkmTrR3DL0JCVINJAljL3WTQ/OzXkXGE3S0qlPlc nyX7n8uYYRW2KDMd9LHXR6kl5pPkC7y/opQjVXr/f1H5TlEfQZNU0oQY+eS0RzoozTYn pOD18sdJ6Ab93hj37G31rIUcG07lbIO6ESORPSGjPxUhqDw9Ce8cnDJSQ7O/Lf0y3jW+ LxTR4QbsNJb0Py1fck+mmuOnSgZkbpreV2JIEFT5zNBRL2V0hxLfWGYLG68WdV+OWbiC hGJg3/mIwzs/6cD7CFnUc0YbI7E/rh4jO/TUE6EFt5w15mj1V/+ah00Gbg/JstSFTMdY DX1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=8JwwA28kFEr2K+hwz3o2CYavppFRtw92oMBlKZ9y8AI=; b=StGuR+JXktb/XylGdEed2Wg1SS3f/ppCjqLfVF8GdYXsM0UQhcg354BEaK6R1yMZ8V mG4JlT0IMXkUAiKV2V8kY8KQ31i+FyYHlsIQICoHjsJuc/54/2NtgX4mnyt3ARlVCT6Y o0UWKRvWi5hNSmrhfFJ3br0e2uG27tTdMg5i6CYSt1BBFh+Lfx2tINv1zGtBf0YTKPIG q71XTGZvzBNLhAdBiS5FUAme6QH1XM/U7P7bwg6dQnNWDFOza3B8iQtMK8oYd1GNvRlm yQ5TmGWCSu1Eubxcj+phVV/4Azpsr1IGzsA0a24II8zsykexQUC8irxJdwdttMmystHt h8Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LQY+qCqg; 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 cc25si6409374edb.467.2020.06.06.16.18.19; Sat, 06 Jun 2020 16:18:42 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LQY+qCqg; 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 S1728821AbgFFXPd (ORCPT + 99 others); Sat, 6 Jun 2020 19:15:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728479AbgFFXPd (ORCPT ); Sat, 6 Jun 2020 19:15:33 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AE5AC03E96A for ; Sat, 6 Jun 2020 16:15:32 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id p20so14530921iop.11 for ; Sat, 06 Jun 2020 16:15:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8JwwA28kFEr2K+hwz3o2CYavppFRtw92oMBlKZ9y8AI=; b=LQY+qCqgDdWGF48D01HaAcNl+szEzhD/WznXKmRktd/679xIRT9UKnJitNpkdGCLoz +SHPCuoI4znTJVjEbaF5vDqzr2Nfre8/nWn/SJOT9dBCTLJHp6kCLLPQ2I4ldwvW6rem LbxR0EYHErz9/9OvgMaB+4lvUMpPO3AUL47U0cwH+eMzqRkq15/V69bTZpL4dutoB570 vbc8zBe4gnSE6hx5UwncoZvIXlo+QGxDvEcSu5M1g9/5i9V8GSgb94QhV8RA/gMfd36W FhhNnGiPfWioSbqKRYkcL7Sakj88AmyMCMBFDh8K1TmWyVXnbV2XjME3YunH2+8zLvzH blKA== 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:from:date :message-id:subject:to:cc; bh=8JwwA28kFEr2K+hwz3o2CYavppFRtw92oMBlKZ9y8AI=; b=PCSnQoCYoSnzCff8wd+YeTUEyPg85xCKf+w7eSim1kVTrSA7s/9dngN8I6siOdy5Gi E2pxUqQkHXKghGKAzz2Cdkwaw4JK2EHYKQKLpBlSfqgnONhci+imo32QvXqPguUn3nPJ UHlr/P4dKmiKjTvdKfN7526yMYSTgYTZv8CTYo1bNFveeBkJO9RM1P/rarlPs/btjGNM ATTIhEZicYQQ+J4fVPLKTvBWXN/02YbJGtmDFaCrd31GbW+uedxCSJodAZNAZr9JUjKw GVKK/A2fmffK79lduuvrVg0ovUgbCHnAalo5664jSSqi2L7Z3Psyx4QRy+Vj5aQ5giZM QY4A== X-Gm-Message-State: AOAM530+TppCYSed3ScQyFUtbCNsqlBVPTWrremsrbBUByU6x3wm2C68 MJgB8M5QBbZ6lIdvNvceBwN1Jw8Czz8x8aCzvHA= X-Received: by 2002:a02:390b:: with SMTP id l11mr15291247jaa.54.1591485331321; Sat, 06 Jun 2020 16:15:31 -0700 (PDT) MIME-Version: 1.0 References: <042eddd4b87f0db3588a79d829afe6b23fa8365c.1590017578.git.syednwaris@gmail.com> <202005310310.EOelU2v3%lkp@intel.com> <20200605122428.GD2428291@smile.fi.intel.com> In-Reply-To: <20200605122428.GD2428291@smile.fi.intel.com> From: Syed Nayyar Waris Date: Sun, 7 Jun 2020 04:45:19 +0530 Message-ID: Subject: Re: [PATCH v7 2/4] lib/test_bitmap.c: Add for_each_set_clump test cases To: Andy Shevchenko Cc: kbuild test robot , Linus Walleij , Andrew Morton , kbuild-all@lists.01.org, William Breathitt Gray , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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