Re: [PATCH 3/3] x86, cpu: Enable/disable SMEP

From: Andi Kleen
Date: Wed May 11 2011 - 18:36:56 EST


"Fenghua Yu" <fenghua.yu@xxxxxxxxx> writes:

> +static int disable_smep;

If you add a __initdata here the whole thing will completely disappear
after boot.

> @@ -867,6 +886,8 @@ static void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
> /* Init Machine Check Exception if available. */
> mcheck_cpu_init(c);
>
> + setup_smep(c);

My feeling is you're setting this too late. In theory there could be
early overflows. Better use a early_param and set it as early
as possible, directly after the cpuid flags are set up in early
initialization.

-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/