lkml.org 
[lkml]   [2016]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH] x86: Make sure verify_cpu has a good stack
    On Wed, Mar 02, 2016 at 01:54:50PM -0800, H. Peter Anvin wrote:
    > A relocating bootloader is one that doesn't load the kernel at
    > CONFIG_PHYSICAL_ADDRESS. The EFI stub is one example.
    >
    > __START_KERNEL_map is not relocated. On x86-64 we do relocation by
    > pointing the page tables at a different address.
    >
    > So I really think we need this to be a leaq, so we take a nonstandard
    > load address into consideration.

    Hmm, but __START_KERNEL_map is a simple macro:

    #define __START_KERNEL_map _AC(0xffffffff80000000, UL)

    Ok, I think you want to do something like this for stack_start too:

    /*
    * Compute the delta between the address I am compiled to run at and the
    * address I am actually running at.
    */
    leaq _text(%rip), %rbp
    subq $_text - __START_KERNEL_map, %rbp
    ...

    in the normal case %rbp is 0, of course.

    --
    Regards/Gruss,
    Boris.

    ECO tip #101: Trim your mails when you reply.

    \
     
     \ /
      Last update: 2016-03-02 23:41    [W:3.589 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site