<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10362</bug_id>
          
          <creation_ts>2016-10-03 15:54:55 +0000</creation_ts>
          <short_desc>yocto-bsp: several config fragments yield multiple warnings when building virtual/kernel&apos;s</short_desc>
          <delta_ts>2017-05-24 21:57:17 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</reporter>
          <assigned_to name="Alejandro Hernandez">alejandro.hernandez</assigned_to>
          <cc>bruce.ashfield</cc>
    
    <cc>juan.m.cruz.alcaraz</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66807</commentid>
    <comment_count>0</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2016-10-03 15:54:55 +0000</bug_when>
    <thetext>When creating a BSP with the tool yocto-bsp and selecting SMP, the fragment smp.scc is included into KERNEL_FEATURES. However, when compiling, the following warning is shown on console:

Config: CONFIG_NR_CPUS
From:
/home/lsandov1/poky/build/tmp/work-shared/a/kernel-source/.kernel-meta/configs/standard/a/a.cfg
/home/lsandov1/poky/build/tmp/work-shared/a/kernel-source/.kernel-meta/configs/standard/a/standard/a/a.cfg
/home/lsandov1/poky/build/tmp/work-shared/a/kernel-source/.kernel-meta/configs/standard/a/standard/a/cfg/smp.cfg

Requested value:  CONFIG_NR_CPUS=64
Actual value:     CONFIG_NR_CPUS=8

Config &apos;NR_CPUS&apos; has the following conditionals:
  !SMP (value: &quot;n&quot;)
MAXSMP (value: &quot;n&quot;)
SMP &amp;&amp; X86_BIGSMP (value: &quot;n&quot;)
SMP &amp;&amp; X86_32 (value: &quot;y&quot;)
SMP (value: &quot;y&quot;)
SMP &amp;&amp; !MAXSMP (value: &quot;y&quot;)
Dependency values are:
  CPUMASK_OFFSTACK [n] X86_BIGSMP [n] 512 [512] 8192 [8192] X86_64 [n] 8
[8] X86_32 [y] MAXSMP [n] 2 [2] SMP [y]

According to Bruce A. the problem comes that the corresponding fragment is applied after all fragments since KERNEL_FEATURES have always been last.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66808</commentid>
    <comment_count>1</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2016-10-03 15:57:04 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; When creating a BSP with the tool yocto-bsp and selecting SMP, the fragment
&gt; smp.scc is included into KERNEL_FEATURES. However, when compiling, the
&gt; following warning is shown on console:
&gt; 
&gt; Config: CONFIG_NR_CPUS
&gt; From:
&gt; /home/lsandov1/poky/build/tmp/work-shared/a/kernel-source/.kernel-meta/
&gt; configs/standard/a/a.cfg
&gt; /home/lsandov1/poky/build/tmp/work-shared/a/kernel-source/.kernel-meta/
&gt; configs/standard/a/standard/a/a.cfg
&gt; /home/lsandov1/poky/build/tmp/work-shared/a/kernel-source/.kernel-meta/
&gt; configs/standard/a/standard/a/cfg/smp.cfg
&gt; 
&gt; Requested value:  CONFIG_NR_CPUS=64
&gt; Actual value:     CONFIG_NR_CPUS=8
&gt; 
&gt; Config &apos;NR_CPUS&apos; has the following conditionals:
&gt;   !SMP (value: &quot;n&quot;)
&gt; MAXSMP (value: &quot;n&quot;)
&gt; SMP &amp;&amp; X86_BIGSMP (value: &quot;n&quot;)
&gt; SMP &amp;&amp; X86_32 (value: &quot;y&quot;)
&gt; SMP (value: &quot;y&quot;)
&gt; SMP &amp;&amp; !MAXSMP (value: &quot;y&quot;)
&gt; Dependency values are:
&gt;   CPUMASK_OFFSTACK [n] X86_BIGSMP [n] 512 [512] 8192 [8192] X86_64 [n] 8
&gt; [8] X86_32 [y] MAXSMP [n] 2 [2] SMP [y]
&gt; 
&gt; According to Bruce A. the problem comes that the corresponding fragment is
&gt; applied after all fragments since KERNEL_FEATURES have always been last.

And the fix is as I described in email, either make a kernel feature that 
turns off SMP, or in the BSP, don&apos;t add the smp kernel feature at all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66839</commentid>
    <comment_count>2</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2016-10-03 20:48:59 +0000</bug_when>
    <thetext>There are much more warnings on the ARM architecture that should be considered. In general a full review of the virtual/kernel templates should be done during 2.3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66840</commentid>
    <comment_count>3</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2016-10-03 20:51:34 +0000</bug_when>
    <thetext>Changing the title, so it is at least more general.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67890</commentid>
    <comment_count>4</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2016-11-03 12:48:05 +0000</bug_when>
    <thetext>I see this ended up assigned to Richard.

Unless there&apos;s a special plan for it, I can take the bug. Feel free to re-assign to me if that&apos;s the case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71712</commentid>
    <comment_count>5</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-03-24 17:01:59 +0000</bug_when>
    <thetext>The steps to reproduce this issue are not clear, so providing them this time:

1 yocto-bsp create myqemu qemu
2 chose all defaults
3 change MACHINE to myqemu and include the new layer into bblayers.conf
4 bitbake virtual/kernel

then the output mentioned on comment 1 is observed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71714</commentid>
    <comment_count>6</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-03-24 17:03:35 +0000</bug_when>
    <thetext>Alex, passing this issue to you. I think you are the right person to tackle kernel cfg issues. Let me know if you need help from me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72875</commentid>
    <comment_count>7</comment_count>
    <who name="Alejandro Hernandez">alejandro.hernandez</who>
    <bug_when>2017-04-26 20:42:32 +0000</bug_when>
    <thetext>Following the same process as in bug #10425, I was able to see that our selected config values are in fact set on the merged config list, but once conf (from kconfig) is executed, the kernel disregards our values.

After diving on the kconfig code, I was able to check that indeed this is caused by a dependency issue:

Adding some debugging code to kconfig shows the following output

Validating config NR_CPUS
Current value  64 
Final value  8

In this case this is validated on the vaidate_range function from kconfig, which checks dependencies and corrects the valid range on values a certain config may be set to.

For this value the dependency that its missing is 

CONFIG_X86_BIGSMP=n

We don&apos;t set this value anywhere on kernel-meta, so we have no default value for it, but since we execute make with --allnoconfig, it ends up being set to &apos;n&apos;.

According to Kconfig we have the following descriptions:

config NR_CPUS
        int &quot;Maximum number of CPUs&quot;
config X86_BIGSMP
        bool &quot;Support for big SMP systems with more than 8 CPUs&quot;

So basically we need to set CONFIG_X86_BIGSMP=y if we want NR_CPUS to be able to be &gt; 8.

A patch to kernel-meta will be submitted to fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73487</commentid>
    <comment_count>8</comment_count>
    <who name="Alejandro Hernandez">alejandro.hernandez</who>
    <bug_when>2017-05-24 21:57:17 +0000</bug_when>
    <thetext>Fixed:
http://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-cache/commit/?h=yocto-4.9&amp;id=5fd0435f4d40c03bc5a06389d22dbafd5086e7ab</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>