lkml.org 
[lkml]   [2021]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 13/15] kvm/vmx/nested: Support Tertiary VM-Exec control in vmcs02
Date
Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
---
arch/x86/kvm/vmx/nested.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index b04184b..f5ec215 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -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
--
1.8.3.1
\
 
 \ /
  Last update: 2021-06-01 10:50    [W:0.048 / U:0.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site