[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150317100736.GB19131@chrystal.uk.oracle.com>
Date: Tue, 17 Mar 2015 11:07:36 +0100
From: Quentin Casasnovas <quentin.casasnovas@...cle.com>
To: Borislav Petkov <bp@...e.de>
Cc: Quentin Casasnovas <quentin.casasnovas@...cle.com>,
Oleg Nesterov <oleg@...hat.com>,
Dave Hansen <dave.hansen@...el.com>,
Ingo Molnar <mingo@...nel.org>,
Andy Lutomirski <luto@...capital.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Pekka Riikonen <priikone@....fi>,
Rik van Riel <riel@...hat.com>,
Suresh Siddha <sbsiddha@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
"Yu, Fenghua" <fenghua.yu@...el.com>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH RFC 0/2] x86/fpu: avoid "xstate_fault" in
xsave_user/xrestore_user
On Tue, Mar 17, 2015 at 10:47:50AM +0100, Borislav Petkov wrote:
>
> We can even go a step further and add a static_cpu_has_safe thing which
> checks two features instead of one. The penalty we'd get is a single
> inconditional JMP which in the face of XSAVE* is nothing.
>
What was the argument against adding a check_alternative_input(...) so the
ex_table entry are managed inside the macro directly? It leaves less room
for errors and would still be reable IMO:
err = check_alternative_input_2(XSAVE,
XSAVESOPT, X86_FEATURE_XSAVEOPT
XSAVES, X86_FEATURE_XSAVES,
<inputs>, <outputs>, <clobbers>);
if (err)
do_something();
That hypothetical check_alternative_input_2() would call a rework of
check_insn() supporting an arbitrary numbers of inputs, outputs and
clobbers as drafted in my previous e-mail.
Quentin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists