x86/vmx: Add force-ept command line option
PATCH v4 1/1 x86/vmx: Add force-ept command line option
Add a "force-ept" command line option to allow EPT to be enabled when VMX feature VM_ENTRY_LOAD_GUEST_PAT is not present.
Due to CVE-2013-2212, this feature is required by default as a prerequisite for using EPT. If you are not using PCI Passthrough, or trust the guest administrator who would be using passthrough, then the requirement can be relaxed. This option is particularly useful for nested virtualization, to allow the L1 hypervisor to use EPT even if the L0 hypervisor does not provide VM_ENTRY_LOAD_GUEST_PAT.
---
Changes from version 3:
Update commit and documentation description.
Changes from version 2:
1. Update commit and documentation description.
2. Rename command line option to "force-ept"
Changes from version 1:
1. Fix and update documentation with suggestion from Andrew Cooper.
2. Remove redundant assignment.
--- docs/misc/xen-command-line.markdown | 16 ++++++++++++++++ xen/arch/x86/hvm/vmx/vmx.c | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-)
docs/misc/xen-command-line.markdown +16 -0
@@ -545,6 +545,22 @@ versa. For example to change dom0 without changing domU, use Specify the font size when using the VESA console driver. +### force-ept (Intel) +> `= <boolean>` + +> Default: `false` + +Allow EPT to be enabled when VMX feature VM\_ENTRY\_LOAD\_GUEST\_PAT is not +present. + +*Warning:* +Due to CVE-2013-2212, VMX feature VM\_ENTRY\_LOAD\_GUEST\_PAT is by default +required as a prerequisite for using EPT. If you are not using PCI Passthrough, +or trust the guest administrator who would be using passthrough, then the +requirement can be relaxed. This option is particularly useful for nested +virtualization, to allow the L1 hypervisor to use EPT even if the L0 hypervisor +does not provide VM\_ENTRY\_LOAD\_GUEST\_PAT. + ### gdb > `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
xen/arch/x86/hvm/vmx/vmx.c +4 -1
@@ -58,6 +58,9 @@#include <asm/hvm/nestedhvm.h> #include <asm/event.h> +static bool_t __initdata opt_force_ept; +boolean_param ("force-ept" , opt_force_ept); +enum handler_return { HNDL_done, HNDL_unhandled, HNDL_exception_raised };static void vmx_ctxt_switch_from (struct vcpu *v);
@@ -1724,7 +1727,7 @@ const struct hvm_function_table * __init start_vmx(void)* Do not enable EPT when (!cpu_has_vmx_pat), to prevent security hole * (refer to http://xenbits.xen.org/xsa/advisory-60.html). */ -if ( cpu_has_vmx_ept && cpu_has_vmx_pat ) +if ( cpu_has_vmx_ept && (cpu_has_vmx_pat || opt_force_ept) ) { vmx_function_table.hap_supported =1 ;
Signature · 1 line
1.9.1
Quoted 13 lines
From: Aravindh Puthiyaparambil [mailto:[email protected]]
Sent: Wednesday, April 23, 2014 12:36 AMAdd a "force-ept" command line option to allow EPT to be enabled when VMX feature
VM_ENTRY_LOAD_GUEST_PATis not present.Due to CVE-2013-2212, this feature is required by default as a prerequisite for using EPT. If you are not using PCI Passthrough, or trust the guest administrator who would be using passthrough, then the requirement can be relaxed. This option is particularly useful for nested virtualization, to allow the L1 hypervisor to use EPT even if the L0 hypervisor does not provide
VM_ENTRY_LOAD_GUEST_PAT.
Quoted 5 lines
Signed-off-by Aravindh Puthiyaparambil <[email protected]>Cc Jun Nakajima <[email protected]>Cc Eddie Dong <[email protected]>Cc Kevin Tian <[email protected]>
Quoted 77 lines
---
Changes from version 3:
Update commit and documentation description.Changes from version 2:
1. Update commit and documentation description.
2. Rename command line option to "force-ept"Changes from version 1:
1. Fix and update documentation with suggestion from Andrew Cooper.
2. Remove redundant assignment.--- docs/misc/xen-command-line.markdown | 16 ++++++++++++++++ xen/arch/x86/hvm/vmx/vmx.c | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-)docs/misc/xen-command-line.markdown +0
-0@@ -545,6 +545,22 @@ versa. For example to change dom0 withoutchanging domU, use
Specify the font size when using the VESA console driver.
docs/misc/xen-command-line.markdown +6
-0+### force-ept (Intel) +> `= <boolean>` + +> Default: `false` + +Allow EPT to be enabled when VMX featureVM\_ENTRY\_LOAD\_GUEST\_PAT is not
docs/misc/xen-command-line.markdown +4
-0+present. + +*Warning:* +Due to CVE-2013-2212, VMX feature VM\_ENTRY\_LOAD\_GUEST\_PAT is bydefault
+required as a prerequisite for using EPT. If you are not using PCI Passthrough,docs/misc/xen-command-line.markdown +5
-0+or trust the guest administrator who would be using passthrough, then the +requirement can be relaxed. This option is particularly useful for nested +virtualization, to allow the L1 hypervisor to use EPT even if the L0 hypervisor +does not provide VM\_ENTRY\_LOAD\_GUEST\_PAT. + ### gdb > `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]]| pci | amt ] `
xen/arch/x86/hvm/vmx/vmx.c +3
-0@@ -58,6 +58,9 @@#include <asm/hvm/nestedhvm.h> #include <asm/event.h> +static bool_t __initdata opt_force_ept; +boolean_param ("force-ept" , opt_force_ept); +enum handler_return { HNDL_done, HNDL_unhandled, HNDL_exception_raised };static void
vmx_ctxt_switch_from(struct vcpu *v);xen/arch/x86/hvm/vmx/vmx.c +0
-0@@ -1724,7 +1727,7 @@ const struct hvm_function_table * __initstart_vmx (void) * Do not enable EPT when (!cpu_has_vmx_pat), to prevent securityhole
* (refer to http://xenbits.xen.org/xsa/advisory-60.html).
*/xen/arch/x86/hvm/vmx/vmx.c +1
-2-if ( cpu_has_vmx_ept && cpu_has_vmx_pat ) +if ( cpu_has_vmx_ept && (cpu_has_vmx_pat || opt_force_ept) ) { vmx_function_table.hap_supported =1 ; --1.9.1