lkml.org 
[lkml]   [2019]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 08/13] x86/fsgsbase/64: Introduce the FIND_PERCPU_BASE macro
Date

> On Feb 2, 2019, at 09:17, Andy Lutomirski <luto@kernel.org> wrote:
>
> On Fri, Feb 1, 2019 at 12:55 PM Chang S. Bae <chang.seok.bae@intel.com> wrote:
>>
>> +
>> +/*
>> + * CPU/node NR is loaded from the limit (size) field of a special segment
>> + * descriptor entry in GDT.
>> + */
>> +.macro LOAD_CPU_AND_NODE_SEG_LIMIT reg:req
>> + movq $__CPUNODE_SEG, \reg
>> + lsl \reg, \reg
>> +.endm
>> +
>
> Please put the alternative in here instead of in FIND_PERCPU_BASE.

I would like to apply your comment though, build errors will come up due to the
__CPUNODE_SEG. So, still hoping the alternative line below is straightforward enough.
Will send out a revision, that reflects all other comments, shortly.

Chang

>
>> +/*
>> + * Fetch the per-CPU GSBASE value for this processor and put it in @reg.
>> + * We normally use %gs for accessing per-CPU data, but we are setting up
>> + * %gs here and obviously can not use %gs itself to access per-CPU data.
>> + */
>> +.macro FIND_PERCPU_BASE reg:req
>>
>> + ALTERNATIVE \
>> + "LOAD_CPU_AND_NODE_SEG_LIMIT \reg", \
>> + "RDPID \reg", \
>> + X86_FEATURE_RDPID
>> + andq $VDSO_CPUNODE_MASK, \reg
>> + movq __per_cpu_offset(, \reg, 8), \reg
>> +.endm

\
 
 \ /
  Last update: 2019-02-13 19:48    [W:0.053 / U:9.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site