]> xenbits.xensource.com Git - xen.git/commit
x86: use optimal NOPs to fill the SMEP/SMAP placeholders
authorJan Beulich <jbeulich@suse.com>
Fri, 27 May 2016 12:47:08 +0000 (14:47 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 27 May 2016 12:47:08 +0000 (14:47 +0200)
commit8d1e55944b8391fbf4aafe7880f5c66de60b3adc
treea6ddcbeb6b0d96747a3b87df03ab33a9d8b7b5cd
parentf3325975e2cdfd85aa6b49280897f4683f6aa896
x86: use optimal NOPs to fill the SMEP/SMAP placeholders

Alternatives patching code picks the most suitable NOPs for the
running system, so simply use it to replace the pre-populated ones.

Use an arbitrary, always available feature to key off from, but
hide this behind the new X86_FEATURE_ALWAYS.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
x86/compat: correct SMEP/SMAP NOPs patching

Correct the number of single byte NOPs we want to be replaced in case
neither SMEP nor SMAP are available.

Also simplify the expression adding these NOPs - at that location .
equals .Lcr4_orig, and removing that part of the expression fixes a
bogus ".space or fill with negative value, ignored" warning by very old
gas (which actually is what made me look at those constructs again).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 01a0bd0a7d72be638a359db3f8cf551123467d29
master date: 2016-05-13 18:15:55 +0100
master commit: f5610009529628314c9d1d52b00715fe855fcf06
master date: 2016-05-26 17:26:24 +0100
xen/arch/x86/x86_64/compat/entry.S
xen/include/asm-x86/asm_defns.h
xen/include/asm-x86/cpufeature.h