lkml.org 
[lkml]   [2020]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [RFC v5 11/57] objtool: Abstract alternative special case handling
On Thu, Jan 09, 2020 at 04:02:14PM +0000, Julien Thierry wrote:
> diff --git a/tools/objtool/arch/x86/arch_special.c b/tools/objtool/arch/x86/arch_special.c
> new file mode 100644
> index 000000000000..6dba31f419d0
> --- /dev/null
> +++ b/tools/objtool/arch/x86/arch_special.c
> @@ -0,0 +1,34 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +#include "../../special.h"
> +#include "../../builtin.h"
> +
> +void arch_handle_alternative(unsigned short feature, struct special_alt *alt)
> +{
> + /*
> + * If UACCESS validation is enabled; force that alternative;
> + * otherwise force it the other way.
> + *
> + * What we want to avoid is having both the original and the
> + * alternative code flow at the same time, in that case we can
> + * find paths that see the STAC but take the NOP instead of
> + * CLAC and the other way around.
> + */
That comment ^,

> + switch (feature) {
> + case X86_FEATURE_SMAP:

goes here >

> + if (uaccess)
> + alt->skip_orig = true;
> + else
> + alt->skip_alt = true;
> + break;

> + case X86_FEATURE_POPCNT:
> + /*
> + * It has been requested that we don't validate the !POPCNT
> + * feature path which is a "very very small percentage of
> + * machines".
> + */
> + alt->skip_orig = true;
> + break;
> + default:
> + break;
> + }
> +}

\
 
 \ /
  Last update: 2020-01-20 15:54    [W:0.417 / U:1.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site