x86/sm{e, a}p: do not enable SMEP/SMAP in PV shim by default on AMD
authorIgor Druzhinin <igor.druzhinin@citrix.com>
Thu, 5 Mar 2020 10:30:38 +0000 (11:30 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 5 Mar 2020 10:30:38 +0000 (11:30 +0100)
commit888a7da8c9ed6adb763acc5800adcc6f548abcd7
treeed510ceb8e7a1eb134994fc81c26d573fb6e0791
parent06adda76b680f741ea1a3517adddb11bf93536d5
x86/sm{e, a}p: do not enable SMEP/SMAP in PV shim by default on AMD

Due to AMD and Hygon being unable to selectively trap CR4 bit modifications
running 32-bit PV guest inside PV shim comes with significant performance
hit. Moreover, for SMEP in particular every time CR4.SMEP changes on context
switch to/from 32-bit PV guest, it gets trapped by L0 Xen which then
tries to perform global TLB invalidation for PV shim domain. This usually
results in eventual hang of a PV shim with at least several vCPUs.

Since the overall security risk is generally lower for shim Xen as it being
there more of a defense-in-depth mechanism, choose to disable SMEP/SMAP in
it by default on AMD and Hygon unless a user chose otherwise.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: b05ec9263e56ef0784da766e829cfe08569d1d88
master date: 2020-01-17 16:18:20 +0100
docs/misc/xen-command-line.markdown
xen/arch/x86/setup.c