]> xenbits.xensource.com Git - xen.git/commit
VMX: disable SMEP feature when guest is in non-paging mode
authorDongxiao Xu <dongxiao.xu@intel.com>
Tue, 9 Apr 2013 14:26:29 +0000 (16:26 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 9 Apr 2013 14:26:29 +0000 (16:26 +0200)
commita625c40e553907d581aa9fbbab762b64841e2741
treec0d9b8f3685a5ce6ad291c90400c4bddc826bdc3
parentda7e3cdf0a1c2440886383e0e7f826c88796b8ca
VMX: disable SMEP feature when guest is in non-paging mode

SMEP is disabled if CPU is in non-paging mode in hardware.
However Xen always uses paging mode to emulate guest non-paging
mode with HAP. To emulate this behavior, SMEP needs to be manually
disabled when guest switches to non-paging mode.

We met an issue that, SMP Linux guest with recent kernel (enable
SMEP support, for example, 3.5.3) would crash with triple fault if
setting unrestricted_guest=0 in grub. This is because Xen uses an
identity mapping page table to emulate the non-paging mode, where
the page table is set with USER flag. If SMEP is still enabled in
this case, guest will meet unhandlable page fault and then crash.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
master commit: e7dda8ec9fc9020e4f53345cdbb18a2e82e54a65
master date: 2013-01-30 09:17:30 -0800
xen/arch/x86/hvm/vmx/vmx.c