lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 13 Feb 2019 18:46:59 +0000
From:   "Bae, Chang Seok" <chang.seok.bae@...el.com>
To:     Andy Lutomirski <luto@...nel.org>
CC:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...nel.org>,
        "H . Peter Anvin" <hpa@...or.com>, Andi Kleen <ak@...ux.intel.com>,
        "Metzger, Markus T" <markus.t.metzger@...el.com>,
        "Shankar, Ravi V" <ravi.v.shankar@...el.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH v5 08/13] x86/fsgsbase/64: Introduce the
 FIND_PERCPU_BASE macro


> On Feb 2, 2019, at 09:17, Andy Lutomirski <luto@...nel.org> wrote:
> 
> On Fri, Feb 1, 2019 at 12:55 PM Chang S. Bae <chang.seok.bae@...el.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ