lkml.org 
[lkml]   [2023]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v2 07/11] x86/percpu/64: Use relative percpu offsets
    On Thu, Oct 26, 2023 at 2:47 PM Uros Bizjak <ubizjak@gmail.com> wrote:
    >
    > On Thu, Oct 26, 2023 at 6:01 PM Brian Gerst <brgerst@gmail.com> wrote:
    > >
    > > The percpu section is currently linked at virtual address 0, because
    > > older compilers hardcoded the stack protector canary value at a fixed
    > > offset from the start of the GS segment. Now that the canary is a
    > > normal percpu variable, the percpu section can be linked normally.
    > > This means that x86-64 will calculate percpu offsets like most other
    > > architectures, as the delta between the initial percpu address and the
    > > dynamically allocated memory.
    >
    > The comments above MSR_GS_BASE setup should be reviewed or removed. I
    > don't think they need to be set up to access stack canary, they are
    > just clearing MSR now.

    GSBASE is deliberately set to zero offset on SMP for boot because we
    want any percpu accesses (including stack protector) to use the
    initial percpu area until the full percpu memory is allocated. It's
    possible that more stack protector checks could sneak back into the
    early boot code, and after the conversion to relative percpu offsets
    they would work properly again. I just didn't reenable them because
    they are unnecessary that early.

    Brian Gerst

    \
     
     \ /
      Last update: 2023-10-27 04:10    [W:3.253 / U:4.344 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site