@@ -2222,6 +2222,7 @@ static void prepare_vmcs02_early_rare(struct vcpu_vmx *vmx,
static void prepare_vmcs02_early(struct vcpu_vmx *vmx, struct vmcs12 *vmcs12)
{
u32 exec_control;
+ u64 vmcs02_ter_exec_ctrl;
u64 guest_efer = nested_vmx_calc_efer(vmx, vmcs12);
if (vmx->nested.dirty_vmcs12 || vmx->nested.hv_evmcs)
@@ -2344,6 +2345,18 @@ static void prepare_vmcs02_early(struct vcpu_vmx *vmx, struct vmcs12 *vmcs12)
vm_entry_controls_set(vmx, exec_control);
/*
+ * Tertiary EXEC CONTROLS
+ */
+ if (cpu_has_tertiary_exec_ctrls()) {
+ vmcs02_ter_exec_ctrl = vmx->tertiary_exec_control;
+ if (nested_cpu_has(vmcs12,
+ CPU_BASED_ACTIVATE_TERTIARY_CONTROLS))
+ vmcs02_ter_exec_ctrl |= vmcs12->tertiary_vm_exec_control;
+
+ tertiary_exec_controls_set(vmx, vmcs02_ter_exec_ctrl);
+ }
+
+ /*
* EXIT CONTROLS
*
* L2->L1 exit controls are emulated - the hardware exit is to L0 so
Signed-off-by: Robert Hoo <robert.hu@linux.intel.com> --- arch/x86/kvm/vmx/nested.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)