Re: [PATCH 6/8] x86: Enumerate kernel FSGS capability in AT_HWCAP2

From: Andi Kleen
Date: Fri Apr 10 2015 - 19:07:59 EST


> > +++ b/arch/x86/include/uapi/asm/hwcap.h
> > @@ -0,0 +1,7 @@
> > +#ifndef _ASM_HWCAP_H
> > +#define _ASM_HWCAP_H 1
> > +
> > +#define HWCAP2_FSGSBASE (1 << 0) /* Kernel enabled RD/WR FS/GS BASE */
>
> BIT()

We cannot use BIT in uapi headers for obvious reasons.

> > cpumask_var_t cpu_initialized_mask;
> > cpumask_var_t cpu_callout_mask;
> > @@ -958,8 +961,10 @@ static void identify_cpu(struct cpuinfo_x86 *c)
> > numa_add_cpu(smp_processor_id());
> > #endif
> >
> > - if (cpu_has(c, X86_FEATURE_FSGSBASE))
> > + if (cpu_has(c, X86_FEATURE_FSGSBASE)) {
>
> static_cpu_has_safe()

That checks the boot cpu? We want to check the current CPU.

-Andi


--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/