<div dir="ltr"><div><span class="" title="arch/x86/kernel/head_32.S">hello,<br><br>arch/x86/kernel/head_32.S:<br><br>#define pa(X) ((X) - __PAGE_OFFSET)<br><br></span><table class=""><tbody><tr><td class=""> __HEAD</td>
    </tr>

    <tr>
        

        

      <td class=""> ENTRY(startup_32)</td>
    </tr>

    <tr>
        

        

      <td class="">+        movl pa(stack_start),%ecx</td></tr></tbody></table>...<br><table class=""><tbody><tr><td class="">+        movl %eax,%ss</td>
    </tr>

    <tr>
        

        

      <td class=""> 2:</td>
    </tr>

    <tr>
        

        

      <td class="">+        leal -__PAGE_OFFSET(%ecx),%esp<br></td></tr></tbody></table><br>I am confused by `leal -__PAGE_OFFSET(%ecx),%esp`.<br>`pa(stack_start)` have convert `stack_start` to physicall address. <br>why we need `-__PAGE_OFFSET(%ecx)` instead of `%ecx`?<br><br><br>I have found the commit in github:<br><br><a href="https://github.com/torvalds/linux/commit/11d4c3f9b671720e80353dd7e433ff2bf65e9500#diff-3910cf85e24534430413b7133160d0ba">https://github.com/torvalds/linux/commit/11d4c3f9b671720e80353dd7e433ff2bf65e9500#diff-3910cf85e24534430413b7133160d0ba</a><br><br></div><br><div>
            
          
          <div class="">
              

                


          </div>
        </div></div>