Re: [PATCH v5 08/13] x86/fsgsbase/64: Introduce the FIND_PERCPU_BASE macro

2019-02-13 Thread Bae, Chang Seok
> On Feb 2, 2019, at 09:17, Andy Lutomirski wrote: > > On Fri, Feb 1, 2019 at 12:55 PM Chang S. Bae 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 >> +

Re: [PATCH v5 08/13] x86/fsgsbase/64: Introduce the FIND_PERCPU_BASE macro

2019-02-02 Thread Andy Lutomirski
On Fri, Feb 1, 2019 at 12:55 PM Chang S. Bae wrote: > > GSBASE is used to find per-CPU data in the kernel. But when it is unknown, > the per-CPU base can be found from the per_cpu_offset table with a CPU NR. > The CPU NR is extracted from the limit field of the CPUNODE entry in GDT, > or by the RD

[PATCH v5 08/13] x86/fsgsbase/64: Introduce the FIND_PERCPU_BASE macro

2019-02-01 Thread Chang S. Bae
GSBASE is used to find per-CPU data in the kernel. But when it is unknown, the per-CPU base can be found from the per_cpu_offset table with a CPU NR. The CPU NR is extracted from the limit field of the CPUNODE entry in GDT, or by the RDPID instruction. Also, add the GAS-compatible RDPID macro. Th