lkml.org 
[lkml]   [2018]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [RFC 2/2] x86/pti/64: Remove the SYSCALL64 entry trampoline
    From
    Date
    On 07/22/2018 10:45 AM, Andy Lutomirski wrote:
    > static void __init pti_clone_user_shared(void)
    > {
    > + unsigned cpu;
    > +
    > pti_clone_p4d(CPU_ENTRY_AREA_BASE);
    > +
    > + for_each_possible_cpu(cpu) {
    > + /*
    > + * The SYSCALL64 entry code needs to be able to find the
    > + * thread stack and needs one word of scratch space in which
    > + * to spill a register. All of this lives in the TSS, in
    > + * the sp1 and sp2 slots.
    > + */

    I had to remind myself about the r/o cpu_entry_area alias here. Should
    we maybe call it out explicitly?

    /*
    * The TSS is also mapped read-only into the cpu_entry_area.
    * The cpu_entry_area copy is used r/o by the hardware for the
    * hardware stack switching, like interrupt entry.
    *
    * The copies being mapped here are the normal r/w per-cpu
    * areas. We need r/w because we spill a register here.
    */

    BTW, since we have this alias, do we still *need* the r/o cpu_entry_area
    alias? Or do we still get some value from keeping the thing referenced
    by hardware r/o?

    \
     
     \ /
      Last update: 2018-07-23 15:00    [W:4.022 / U:0.568 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site