* [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs
@ 2022-06-22 16:44 Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 01/10] KVM: VMX: Move CPU_BASED_CR8_{LOAD,STORE}_EXITING filtering out of setup_vmcs_config() Vitaly Kuznetsov
` (10 more replies)
0 siblings, 11 replies; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-22 16:44 UTC (permalink / raw)
To: kvm, Paolo Bonzini, Anirudh Rayabharam, Sean Christopherson
Cc: Wanpeng Li, Jim Mattson, Maxim Levitsky, linux-hyperv,
linux-kernel
vmcs_config is a sanitized version of host VMX MSRs where some controls are
filtered out (e.g. when Enlightened VMCS is enabled, some know bugs are
discovered, some inconsistencies in controls are detected,...) but
nested_vmx_setup_ctls_msrs() uses raw host MSRs instead. This may end up
in exposing undesired controls to L1. Switch to using vmcs_config instead.
RFC part: vmcs_config's sanitization now is a mix of "what can't be enabled"
and "what KVM doesn't want" and we need to separate these as for nested VMX
MSRs only the first category makes sense. This gives vmcs_config a slightly
different meaning "controls which can be (theoretically) used". An alternative
approach would be to store sanitized host MSRs values separately, sanitize
them and and use in nested_vmx_setup_ctls_msrs() but currently I don't see
any benefits. Comments welcome!
Very lightly tested with KVM selftests / kvm-unit-tests.
Vitaly Kuznetsov (10):
KVM: VMX: Move CPU_BASED_CR8_{LOAD,STORE}_EXITING filtering out of
setup_vmcs_config()
KVM: VMX: Add missing CPU based VM execution controls to vmcs_config
KVM: VMX: Move CPU_BASED_{CR3_LOAD,CR3_STORE,INVLPG}_EXITING filtering
out of setup_vmcs_config()
KVM: VMX: Add missing VMEXIT controls to vmcs_config
KVM: VMX: Add missing VMENTRY controls to vmcs_config
KVM: nVMX: Use sanitized allowed-1 bits for VMX control MSRs
KVM: VMX: Store required-1 VMX controls in vmcs_config
KVM: nVMX: Use sanitized required-1 bits for VMX control MSRs
KVM: VMX: Cache MSR_IA32_VMX_MISC in vmcs_config
KVM: nVMX: Use cached host MSR_IA32_VMX_MISC value for setting up
nested MSR
arch/x86/kvm/vmx/capabilities.h | 16 +++---
arch/x86/kvm/vmx/nested.c | 37 +++++---------
arch/x86/kvm/vmx/nested.h | 2 +-
arch/x86/kvm/vmx/vmx.c | 91 +++++++++++++++++++++++++--------
4 files changed, 94 insertions(+), 52 deletions(-)
--
2.35.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH RFC v1 01/10] KVM: VMX: Move CPU_BASED_CR8_{LOAD,STORE}_EXITING filtering out of setup_vmcs_config()
2022-06-22 16:44 [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Vitaly Kuznetsov
@ 2022-06-22 16:44 ` Vitaly Kuznetsov
2022-06-24 0:09 ` Sean Christopherson
2022-06-22 16:44 ` [PATCH RFC v1 02/10] KVM: VMX: Add missing CPU based VM execution controls to vmcs_config Vitaly Kuznetsov
` (9 subsequent siblings)
10 siblings, 1 reply; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-22 16:44 UTC (permalink / raw)
To: kvm, Paolo Bonzini, Anirudh Rayabharam, Sean Christopherson
Cc: Wanpeng Li, Jim Mattson, Maxim Levitsky, linux-hyperv,
linux-kernel
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/vmx/vmx.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 5e14e4c40007..24da9e93bdab 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2490,11 +2490,6 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_PROCBASED_CTLS,
&_cpu_based_exec_control) < 0)
return -EIO;
-#ifdef CONFIG_X86_64
- if (_cpu_based_exec_control & CPU_BASED_TPR_SHADOW)
- _cpu_based_exec_control &= ~CPU_BASED_CR8_LOAD_EXITING &
- ~CPU_BASED_CR8_STORE_EXITING;
-#endif
if (_cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS) {
min2 = 0;
opt2 = SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
@@ -4285,6 +4280,12 @@ static u32 vmx_exec_control(struct vcpu_vmx *vmx)
{
u32 exec_control = vmcs_config.cpu_based_exec_ctrl;
+#ifdef CONFIG_X86_64
+ if (exec_control & CPU_BASED_TPR_SHADOW)
+ exec_control &= ~CPU_BASED_CR8_LOAD_EXITING &
+ ~CPU_BASED_CR8_STORE_EXITING;
+#endif
+
if (vmx->vcpu.arch.switch_db_regs & KVM_DEBUGREG_WONT_EXIT)
exec_control &= ~CPU_BASED_MOV_DR_EXITING;
--
2.35.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH RFC v1 02/10] KVM: VMX: Add missing CPU based VM execution controls to vmcs_config
2022-06-22 16:44 [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 01/10] KVM: VMX: Move CPU_BASED_CR8_{LOAD,STORE}_EXITING filtering out of setup_vmcs_config() Vitaly Kuznetsov
@ 2022-06-22 16:44 ` Vitaly Kuznetsov
2022-06-24 0:12 ` Sean Christopherson
2022-06-22 16:44 ` [PATCH RFC v1 03/10] KVM: VMX: Move CPU_BASED_{CR3_LOAD,CR3_STORE,INVLPG}_EXITING filtering out of setup_vmcs_config() Vitaly Kuznetsov
` (8 subsequent siblings)
10 siblings, 1 reply; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-22 16:44 UTC (permalink / raw)
To: kvm, Paolo Bonzini, Anirudh Rayabharam, Sean Christopherson
Cc: Wanpeng Li, Jim Mattson, Maxim Levitsky, linux-hyperv,
linux-kernel
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/vmx/vmx.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 24da9e93bdab..01294a2fc1c1 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2483,8 +2483,14 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
CPU_BASED_INVLPG_EXITING |
CPU_BASED_RDPMC_EXITING;
- opt = CPU_BASED_TPR_SHADOW |
+ opt = CPU_BASED_INTR_WINDOW_EXITING |
+ CPU_BASED_RDTSC_EXITING |
+ CPU_BASED_TPR_SHADOW |
+ CPU_BASED_NMI_WINDOW_EXITING |
+ CPU_BASED_USE_IO_BITMAPS |
+ CPU_BASED_MONITOR_TRAP_FLAG |
CPU_BASED_USE_MSR_BITMAPS |
+ CPU_BASED_PAUSE_EXITING |
CPU_BASED_ACTIVATE_SECONDARY_CONTROLS |
CPU_BASED_ACTIVATE_TERTIARY_CONTROLS;
if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_PROCBASED_CTLS,
@@ -4280,6 +4286,13 @@ static u32 vmx_exec_control(struct vcpu_vmx *vmx)
{
u32 exec_control = vmcs_config.cpu_based_exec_ctrl;
+ exec_control &= ~(CPU_BASED_INTR_WINDOW_EXITING |
+ CPU_BASED_RDTSC_EXITING |
+ CPU_BASED_NMI_WINDOW_EXITING |
+ CPU_BASED_USE_IO_BITMAPS |
+ CPU_BASED_MONITOR_TRAP_FLAG |
+ CPU_BASED_PAUSE_EXITING);
+
#ifdef CONFIG_X86_64
if (exec_control & CPU_BASED_TPR_SHADOW)
exec_control &= ~CPU_BASED_CR8_LOAD_EXITING &
--
2.35.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH RFC v1 03/10] KVM: VMX: Move CPU_BASED_{CR3_LOAD,CR3_STORE,INVLPG}_EXITING filtering out of setup_vmcs_config()
2022-06-22 16:44 [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 01/10] KVM: VMX: Move CPU_BASED_CR8_{LOAD,STORE}_EXITING filtering out of setup_vmcs_config() Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 02/10] KVM: VMX: Add missing CPU based VM execution controls to vmcs_config Vitaly Kuznetsov
@ 2022-06-22 16:44 ` Vitaly Kuznetsov
2022-06-24 0:04 ` Sean Christopherson
2022-06-22 16:44 ` [PATCH RFC v1 04/10] KVM: VMX: Add missing VMEXIT controls to vmcs_config Vitaly Kuznetsov
` (7 subsequent siblings)
10 siblings, 1 reply; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-22 16:44 UTC (permalink / raw)
To: kvm, Paolo Bonzini, Anirudh Rayabharam, Sean Christopherson
Cc: Wanpeng Li, Jim Mattson, Maxim Levitsky, linux-hyperv,
linux-kernel
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/vmx/vmx.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 01294a2fc1c1..4583de7f0324 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -4293,6 +4293,16 @@ static u32 vmx_exec_control(struct vcpu_vmx *vmx)
CPU_BASED_MONITOR_TRAP_FLAG |
CPU_BASED_PAUSE_EXITING);
+ if (vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_ENABLE_EPT) {
+ /*
+ * CR3 accesses and invlpg don't need to cause VM Exits when EPT
+ * enabled.
+ */
+ exec_control &= ~(CPU_BASED_CR3_LOAD_EXITING |
+ CPU_BASED_CR3_STORE_EXITING |
+ CPU_BASED_INVLPG_EXITING);
+ }
+
#ifdef CONFIG_X86_64
if (exec_control & CPU_BASED_TPR_SHADOW)
exec_control &= ~CPU_BASED_CR8_LOAD_EXITING &
--
2.35.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH RFC v1 04/10] KVM: VMX: Add missing VMEXIT controls to vmcs_config
2022-06-22 16:44 [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Vitaly Kuznetsov
` (2 preceding siblings ...)
2022-06-22 16:44 ` [PATCH RFC v1 03/10] KVM: VMX: Move CPU_BASED_{CR3_LOAD,CR3_STORE,INVLPG}_EXITING filtering out of setup_vmcs_config() Vitaly Kuznetsov
@ 2022-06-22 16:44 ` Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 05/10] KVM: VMX: Add missing VMENTRY " Vitaly Kuznetsov
` (6 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-22 16:44 UTC (permalink / raw)
To: kvm, Paolo Bonzini, Anirudh Rayabharam, Sean Christopherson
Cc: Wanpeng Li, Jim Mattson, Maxim Levitsky, linux-hyperv,
linux-kernel
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/vmx/vmx.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 4583de7f0324..829d66ab6956 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2582,8 +2582,11 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
#endif
opt = VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
+ VM_EXIT_SAVE_IA32_PAT |
VM_EXIT_LOAD_IA32_PAT |
+ VM_EXIT_SAVE_IA32_EFER |
VM_EXIT_LOAD_IA32_EFER |
+ VM_EXIT_SAVE_VMX_PREEMPTION_TIMER |
VM_EXIT_CLEAR_BNDCFGS |
VM_EXIT_PT_CONCEAL_PIP |
VM_EXIT_CLEAR_IA32_RTIT_CTL;
@@ -4246,6 +4249,9 @@ static u32 vmx_vmexit_ctrl(void)
{
u32 vmexit_ctrl = vmcs_config.vmexit_ctrl;
+ vmexit_ctrl &= ~(VM_EXIT_SAVE_IA32_PAT | VM_EXIT_SAVE_IA32_EFER |
+ VM_EXIT_SAVE_VMX_PREEMPTION_TIMER);
+
if (vmx_pt_mode_is_system())
vmexit_ctrl &= ~(VM_EXIT_PT_CONCEAL_PIP |
VM_EXIT_CLEAR_IA32_RTIT_CTL);
--
2.35.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH RFC v1 05/10] KVM: VMX: Add missing VMENTRY controls to vmcs_config
2022-06-22 16:44 [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Vitaly Kuznetsov
` (3 preceding siblings ...)
2022-06-22 16:44 ` [PATCH RFC v1 04/10] KVM: VMX: Add missing VMEXIT controls to vmcs_config Vitaly Kuznetsov
@ 2022-06-22 16:44 ` Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 06/10] KVM: nVMX: Use sanitized allowed-1 bits for VMX control MSRs Vitaly Kuznetsov
` (5 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-22 16:44 UTC (permalink / raw)
To: kvm, Paolo Bonzini, Anirudh Rayabharam, Sean Christopherson
Cc: Wanpeng Li, Jim Mattson, Maxim Levitsky, linux-hyperv,
linux-kernel
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/vmx/vmx.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 829d66ab6956..7aab9225c4c3 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2608,7 +2608,10 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
_pin_based_exec_control &= ~PIN_BASED_POSTED_INTR;
min = VM_ENTRY_LOAD_DEBUG_CONTROLS;
- opt = VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL |
+ opt = VM_ENTRY_IA32E_MODE |
+ VM_ENTRY_SMM |
+ VM_ENTRY_DEACT_DUAL_MONITOR |
+ VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL |
VM_ENTRY_LOAD_IA32_PAT |
VM_ENTRY_LOAD_IA32_EFER |
VM_ENTRY_LOAD_BNDCFGS |
@@ -4237,6 +4240,9 @@ static u32 vmx_vmentry_ctrl(void)
{
u32 vmentry_ctrl = vmcs_config.vmentry_ctrl;
+ vmentry_ctrl &= ~(VM_ENTRY_IA32E_MODE | VM_ENTRY_SMM |
+ VM_ENTRY_DEACT_DUAL_MONITOR);
+
if (vmx_pt_mode_is_system())
vmentry_ctrl &= ~(VM_ENTRY_PT_CONCEAL_PIP |
VM_ENTRY_LOAD_IA32_RTIT_CTL);
--
2.35.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH RFC v1 06/10] KVM: nVMX: Use sanitized allowed-1 bits for VMX control MSRs
2022-06-22 16:44 [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Vitaly Kuznetsov
` (4 preceding siblings ...)
2022-06-22 16:44 ` [PATCH RFC v1 05/10] KVM: VMX: Add missing VMENTRY " Vitaly Kuznetsov
@ 2022-06-22 16:44 ` Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 07/10] KVM: VMX: Store required-1 VMX controls in vmcs_config Vitaly Kuznetsov
` (4 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-22 16:44 UTC (permalink / raw)
To: kvm, Paolo Bonzini, Anirudh Rayabharam, Sean Christopherson
Cc: Wanpeng Li, Jim Mattson, Maxim Levitsky, linux-hyperv,
linux-kernel
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/vmx/nested.c | 34 ++++++++++++++++------------------
arch/x86/kvm/vmx/nested.h | 2 +-
arch/x86/kvm/vmx/vmx.c | 5 ++---
3 files changed, 19 insertions(+), 22 deletions(-)
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 7d8cd0ebcc75..8cc2187b5556 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -6549,8 +6549,13 @@ static u64 nested_vmx_calc_vmcs_enum_msr(void)
* bit in the high half is on if the corresponding bit in the control field
* may be on. See also vmx_control_verify().
*/
-void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps)
+void nested_vmx_setup_ctls_msrs(struct vmcs_config *vmcs_conf, u32 ept_caps)
{
+ struct nested_vmx_msrs *msrs = &vmcs_conf->nested;
+
+ /* Take the allowed-1 bits from KVM's sanitized VMCS configuration. */
+ u32 ignore_high;
+
/*
* Note that as a general rule, the high half of the MSRs (bits in
* the control fields which may be 1) should be initialized by the
@@ -6567,11 +6572,11 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps)
*/
/* pin-based controls */
- rdmsr(MSR_IA32_VMX_PINBASED_CTLS,
- msrs->pinbased_ctls_low,
- msrs->pinbased_ctls_high);
+ rdmsr(MSR_IA32_VMX_PINBASED_CTLS, msrs->pinbased_ctls_low, ignore_high);
msrs->pinbased_ctls_low |=
PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR;
+
+ msrs->pinbased_ctls_high = vmcs_conf->pin_based_exec_ctrl;
msrs->pinbased_ctls_high &=
PIN_BASED_EXT_INTR_MASK |
PIN_BASED_NMI_EXITING |
@@ -6582,12 +6587,10 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps)
PIN_BASED_VMX_PREEMPTION_TIMER;
/* exit controls */
- rdmsr(MSR_IA32_VMX_EXIT_CTLS,
- msrs->exit_ctls_low,
- msrs->exit_ctls_high);
msrs->exit_ctls_low =
VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR;
+ msrs->exit_ctls_high = vmcs_conf->vmexit_ctrl;
msrs->exit_ctls_high &=
#ifdef CONFIG_X86_64
VM_EXIT_HOST_ADDR_SPACE_SIZE |
@@ -6603,11 +6606,10 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps)
msrs->exit_ctls_low &= ~VM_EXIT_SAVE_DEBUG_CONTROLS;
/* entry controls */
- rdmsr(MSR_IA32_VMX_ENTRY_CTLS,
- msrs->entry_ctls_low,
- msrs->entry_ctls_high);
msrs->entry_ctls_low =
VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR;
+
+ msrs->entry_ctls_high = vmcs_conf->vmentry_ctrl;
msrs->entry_ctls_high &=
#ifdef CONFIG_X86_64
VM_ENTRY_IA32E_MODE |
@@ -6621,11 +6623,10 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps)
msrs->entry_ctls_low &= ~VM_ENTRY_LOAD_DEBUG_CONTROLS;
/* cpu-based controls */
- rdmsr(MSR_IA32_VMX_PROCBASED_CTLS,
- msrs->procbased_ctls_low,
- msrs->procbased_ctls_high);
msrs->procbased_ctls_low =
CPU_BASED_ALWAYSON_WITHOUT_TRUE_MSR;
+
+ msrs->procbased_ctls_high = vmcs_conf->cpu_based_exec_ctrl;
msrs->procbased_ctls_high &=
CPU_BASED_INTR_WINDOW_EXITING |
CPU_BASED_NMI_WINDOW_EXITING | CPU_BASED_USE_TSC_OFFSETTING |
@@ -6659,12 +6660,9 @@ void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps)
* depend on CPUID bits, they are added later by
* vmx_vcpu_after_set_cpuid.
*/
- if (msrs->procbased_ctls_high & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)
- rdmsr(MSR_IA32_VMX_PROCBASED_CTLS2,
- msrs->secondary_ctls_low,
- msrs->secondary_ctls_high);
-
msrs->secondary_ctls_low = 0;
+
+ msrs->secondary_ctls_high = vmcs_conf->cpu_based_2nd_exec_ctrl;
msrs->secondary_ctls_high &=
SECONDARY_EXEC_DESC |
SECONDARY_EXEC_ENABLE_RDTSCP |
diff --git a/arch/x86/kvm/vmx/nested.h b/arch/x86/kvm/vmx/nested.h
index c92cea0b8ccc..fae047c6204b 100644
--- a/arch/x86/kvm/vmx/nested.h
+++ b/arch/x86/kvm/vmx/nested.h
@@ -17,7 +17,7 @@ enum nvmx_vmentry_status {
};
void vmx_leave_nested(struct kvm_vcpu *vcpu);
-void nested_vmx_setup_ctls_msrs(struct nested_vmx_msrs *msrs, u32 ept_caps);
+void nested_vmx_setup_ctls_msrs(struct vmcs_config *vmcs_conf, u32 ept_caps);
void nested_vmx_hardware_unsetup(void);
__init int nested_vmx_hardware_setup(int (*exit_handlers[])(struct kvm_vcpu *));
void nested_vmx_set_vmcs_shadowing_bitmap(void);
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 7aab9225c4c3..37d5c5bc4cd2 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -7368,7 +7368,7 @@ static int __init vmx_check_processor_compat(void)
if (setup_vmcs_config(&vmcs_conf, &vmx_cap) < 0)
return -EIO;
if (nested)
- nested_vmx_setup_ctls_msrs(&vmcs_conf.nested, vmx_cap.ept);
+ nested_vmx_setup_ctls_msrs(&vmcs_conf, vmx_cap.ept);
if (memcmp(&vmcs_config, &vmcs_conf, sizeof(struct vmcs_config)) != 0) {
printk(KERN_ERR "kvm: CPU %d feature inconsistency!\n",
smp_processor_id());
@@ -8330,8 +8330,7 @@ static __init int hardware_setup(void)
setup_default_sgx_lepubkeyhash();
if (nested) {
- nested_vmx_setup_ctls_msrs(&vmcs_config.nested,
- vmx_capability.ept);
+ nested_vmx_setup_ctls_msrs(&vmcs_config, vmx_capability.ept);
r = nested_vmx_hardware_setup(kvm_vmx_exit_handlers);
if (r)
--
2.35.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH RFC v1 07/10] KVM: VMX: Store required-1 VMX controls in vmcs_config
2022-06-22 16:44 [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Vitaly Kuznetsov
` (5 preceding siblings ...)
2022-06-22 16:44 ` [PATCH RFC v1 06/10] KVM: nVMX: Use sanitized allowed-1 bits for VMX control MSRs Vitaly Kuznetsov
@ 2022-06-22 16:44 ` Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 08/10] KVM: nVMX: Use sanitized required-1 bits for VMX control MSRs Vitaly Kuznetsov
` (3 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-22 16:44 UTC (permalink / raw)
To: kvm, Paolo Bonzini, Anirudh Rayabharam, Sean Christopherson
Cc: Wanpeng Li, Jim Mattson, Maxim Levitsky, linux-hyperv,
linux-kernel
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/vmx/capabilities.h | 5 +++++
arch/x86/kvm/vmx/vmx.c | 28 +++++++++++++++++++++-------
2 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kvm/vmx/capabilities.h b/arch/x86/kvm/vmx/capabilities.h
index 069d8d298e1d..2e223440e7ed 100644
--- a/arch/x86/kvm/vmx/capabilities.h
+++ b/arch/x86/kvm/vmx/capabilities.h
@@ -60,11 +60,16 @@ struct vmcs_config {
u32 basic_cap;
u32 revision_id;
u32 pin_based_exec_ctrl;
+ u32 pin_based_exec_ctrl_req1;
u32 cpu_based_exec_ctrl;
+ u32 cpu_based_exec_ctrl_req1;
u32 cpu_based_2nd_exec_ctrl;
+ u32 cpu_based_2nd_exec_ctrl_req1;
u64 cpu_based_3rd_exec_ctrl;
u32 vmexit_ctrl;
+ u32 vmexit_ctrl_req1;
u32 vmentry_ctrl;
+ u32 vmentry_ctrl_req1;
struct nested_vmx_msrs nested;
};
extern struct vmcs_config vmcs_config;
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 37d5c5bc4cd2..05a9919a2fec 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2411,7 +2411,7 @@ static bool cpu_has_sgx(void)
}
static __init int adjust_vmx_controls(u32 ctl_min, u32 ctl_opt,
- u32 msr, u32 *result)
+ u32 msr, u32 *result_high, u32 *result_low)
{
u32 vmx_msr_low, vmx_msr_high;
u32 ctl = ctl_min | ctl_opt;
@@ -2425,7 +2425,8 @@ static __init int adjust_vmx_controls(u32 ctl_min, u32 ctl_opt,
if (ctl_min & ~ctl)
return -EIO;
- *result = ctl;
+ *result_high = ctl;
+ *result_low = vmx_msr_low;
return 0;
}
@@ -2449,6 +2450,11 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
u64 _cpu_based_3rd_exec_control = 0;
u32 _vmexit_control = 0;
u32 _vmentry_control = 0;
+ u32 _pin_based_exec_control_low = 0;
+ u32 _cpu_based_exec_control_low = 0;
+ u32 _cpu_based_2nd_exec_control_low = 0;
+ u32 _vmexit_control_low = 0;
+ u32 _vmentry_control_low = 0;
int i;
/*
@@ -2494,7 +2500,8 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
CPU_BASED_ACTIVATE_SECONDARY_CONTROLS |
CPU_BASED_ACTIVATE_TERTIARY_CONTROLS;
if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_PROCBASED_CTLS,
- &_cpu_based_exec_control) < 0)
+ &_cpu_based_exec_control,
+ &_cpu_based_exec_control_low) < 0)
return -EIO;
if (_cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS) {
min2 = 0;
@@ -2526,7 +2533,8 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
opt2 |= SECONDARY_EXEC_ENCLS_EXITING;
if (adjust_vmx_controls(min2, opt2,
MSR_IA32_VMX_PROCBASED_CTLS2,
- &_cpu_based_2nd_exec_control) < 0)
+ &_cpu_based_2nd_exec_control,
+ &_cpu_based_2nd_exec_control_low) < 0)
return -EIO;
}
#ifndef CONFIG_X86_64
@@ -2591,14 +2599,15 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
VM_EXIT_PT_CONCEAL_PIP |
VM_EXIT_CLEAR_IA32_RTIT_CTL;
if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_EXIT_CTLS,
- &_vmexit_control) < 0)
+ &_vmexit_control, &_vmexit_control_low) < 0)
return -EIO;
min = PIN_BASED_EXT_INTR_MASK | PIN_BASED_NMI_EXITING;
opt = PIN_BASED_VIRTUAL_NMIS | PIN_BASED_POSTED_INTR |
PIN_BASED_VMX_PREEMPTION_TIMER;
if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_PINBASED_CTLS,
- &_pin_based_exec_control) < 0)
+ &_pin_based_exec_control,
+ &_pin_based_exec_control_low) < 0)
return -EIO;
if (cpu_has_broken_vmx_preemption_timer())
@@ -2618,7 +2627,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
VM_ENTRY_PT_CONCEAL_PIP |
VM_ENTRY_LOAD_IA32_RTIT_CTL;
if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_ENTRY_CTLS,
- &_vmentry_control) < 0)
+ &_vmentry_control, &_vmentry_control_low) < 0)
return -EIO;
for (i = 0; i < ARRAY_SIZE(vmcs_entry_exit_pairs); i++) {
@@ -2684,11 +2693,16 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
vmcs_conf->revision_id = vmx_msr_low;
vmcs_conf->pin_based_exec_ctrl = _pin_based_exec_control;
+ vmcs_conf->pin_based_exec_ctrl_req1 = _pin_based_exec_control_low;
vmcs_conf->cpu_based_exec_ctrl = _cpu_based_exec_control;
+ vmcs_conf->cpu_based_exec_ctrl_req1 = _cpu_based_exec_control_low;
vmcs_conf->cpu_based_2nd_exec_ctrl = _cpu_based_2nd_exec_control;
+ vmcs_conf->cpu_based_2nd_exec_ctrl_req1 = _cpu_based_2nd_exec_control_low;
vmcs_conf->cpu_based_3rd_exec_ctrl = _cpu_based_3rd_exec_control;
vmcs_conf->vmexit_ctrl = _vmexit_control;
+ vmcs_conf->vmexit_ctrl_req1 = _vmexit_control_low;
vmcs_conf->vmentry_ctrl = _vmentry_control;
+ vmcs_conf->vmentry_ctrl_req1 = _vmentry_control_low;
#if IS_ENABLED(CONFIG_HYPERV)
if (enlightened_vmcs)
--
2.35.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH RFC v1 08/10] KVM: nVMX: Use sanitized required-1 bits for VMX control MSRs
2022-06-22 16:44 [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Vitaly Kuznetsov
` (6 preceding siblings ...)
2022-06-22 16:44 ` [PATCH RFC v1 07/10] KVM: VMX: Store required-1 VMX controls in vmcs_config Vitaly Kuznetsov
@ 2022-06-22 16:44 ` Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 09/10] KVM: VMX: Cache MSR_IA32_VMX_MISC in vmcs_config Vitaly Kuznetsov
` (2 subsequent siblings)
10 siblings, 0 replies; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-22 16:44 UTC (permalink / raw)
To: kvm, Paolo Bonzini, Anirudh Rayabharam, Sean Christopherson
Cc: Wanpeng Li, Jim Mattson, Maxim Levitsky, linux-hyperv,
linux-kernel
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/vmx/nested.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 8cc2187b5556..ede6314a641e 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -6553,9 +6553,6 @@ void nested_vmx_setup_ctls_msrs(struct vmcs_config *vmcs_conf, u32 ept_caps)
{
struct nested_vmx_msrs *msrs = &vmcs_conf->nested;
- /* Take the allowed-1 bits from KVM's sanitized VMCS configuration. */
- u32 ignore_high;
-
/*
* Note that as a general rule, the high half of the MSRs (bits in
* the control fields which may be 1) should be initialized by the
@@ -6572,8 +6569,7 @@ void nested_vmx_setup_ctls_msrs(struct vmcs_config *vmcs_conf, u32 ept_caps)
*/
/* pin-based controls */
- rdmsr(MSR_IA32_VMX_PINBASED_CTLS, msrs->pinbased_ctls_low, ignore_high);
- msrs->pinbased_ctls_low |=
+ msrs->pinbased_ctls_low = vmcs_conf->pin_based_exec_ctrl_req1 |
PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR;
msrs->pinbased_ctls_high = vmcs_conf->pin_based_exec_ctrl;
--
2.35.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH RFC v1 09/10] KVM: VMX: Cache MSR_IA32_VMX_MISC in vmcs_config
2022-06-22 16:44 [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Vitaly Kuznetsov
` (7 preceding siblings ...)
2022-06-22 16:44 ` [PATCH RFC v1 08/10] KVM: nVMX: Use sanitized required-1 bits for VMX control MSRs Vitaly Kuznetsov
@ 2022-06-22 16:44 ` Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 10/10] KVM: nVMX: Use cached host MSR_IA32_VMX_MISC value for setting up nested MSR Vitaly Kuznetsov
2022-06-24 0:31 ` [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Sean Christopherson
10 siblings, 0 replies; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-22 16:44 UTC (permalink / raw)
To: kvm, Paolo Bonzini, Anirudh Rayabharam, Sean Christopherson
Cc: Wanpeng Li, Jim Mattson, Maxim Levitsky, linux-hyperv,
linux-kernel
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/vmx/capabilities.h | 11 +++--------
arch/x86/kvm/vmx/vmx.c | 8 +++++---
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/arch/x86/kvm/vmx/capabilities.h b/arch/x86/kvm/vmx/capabilities.h
index 2e223440e7ed..9a73087c8314 100644
--- a/arch/x86/kvm/vmx/capabilities.h
+++ b/arch/x86/kvm/vmx/capabilities.h
@@ -70,6 +70,7 @@ struct vmcs_config {
u32 vmexit_ctrl_req1;
u32 vmentry_ctrl;
u32 vmentry_ctrl_req1;
+ u64 misc;
struct nested_vmx_msrs nested;
};
extern struct vmcs_config vmcs_config;
@@ -229,11 +230,8 @@ static inline bool cpu_has_vmx_vmfunc(void)
static inline bool cpu_has_vmx_shadow_vmcs(void)
{
- u64 vmx_msr;
-
/* check if the cpu supports writing r/o exit information fields */
- rdmsrl(MSR_IA32_VMX_MISC, vmx_msr);
- if (!(vmx_msr & MSR_IA32_VMX_MISC_VMWRITE_SHADOW_RO_FIELDS))
+ if (!(vmcs_config.misc & MSR_IA32_VMX_MISC_VMWRITE_SHADOW_RO_FIELDS))
return false;
return vmcs_config.cpu_based_2nd_exec_ctrl &
@@ -375,10 +373,7 @@ static inline bool cpu_has_vmx_invvpid_global(void)
static inline bool cpu_has_vmx_intel_pt(void)
{
- u64 vmx_msr;
-
- rdmsrl(MSR_IA32_VMX_MISC, vmx_msr);
- return (vmx_msr & MSR_IA32_VMX_MISC_INTEL_PT) &&
+ return (vmcs_config.misc & MSR_IA32_VMX_MISC_INTEL_PT) &&
(vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_PT_USE_GPA) &&
(vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_IA32_RTIT_CTL);
}
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 05a9919a2fec..9d1896184729 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2455,6 +2455,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
u32 _cpu_based_2nd_exec_control_low = 0;
u32 _vmexit_control_low = 0;
u32 _vmentry_control_low = 0;
+ u64 misc_msr;
int i;
/*
@@ -2687,6 +2688,8 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
if (((vmx_msr_high >> 18) & 15) != 6)
return -EIO;
+ rdmsrl(MSR_IA32_VMX_MISC, misc_msr);
+
vmcs_conf->size = vmx_msr_high & 0x1fff;
vmcs_conf->basic_cap = vmx_msr_high & ~0x1fff;
@@ -2703,6 +2706,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
vmcs_conf->vmexit_ctrl_req1 = _vmexit_control_low;
vmcs_conf->vmentry_ctrl = _vmentry_control;
vmcs_conf->vmentry_ctrl_req1 = _vmentry_control_low;
+ vmcs_conf->misc = misc_msr;
#if IS_ENABLED(CONFIG_HYPERV)
if (enlightened_vmcs)
@@ -8305,11 +8309,9 @@ static __init int hardware_setup(void)
if (enable_preemption_timer) {
u64 use_timer_freq = 5000ULL * 1000 * 1000;
- u64 vmx_msr;
- rdmsrl(MSR_IA32_VMX_MISC, vmx_msr);
cpu_preemption_timer_multi =
- vmx_msr & VMX_MISC_PREEMPTION_TIMER_RATE_MASK;
+ vmcs_config.misc & VMX_MISC_PREEMPTION_TIMER_RATE_MASK;
if (tsc_khz)
use_timer_freq = (u64)tsc_khz * 1000;
--
2.35.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH RFC v1 10/10] KVM: nVMX: Use cached host MSR_IA32_VMX_MISC value for setting up nested MSR
2022-06-22 16:44 [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Vitaly Kuznetsov
` (8 preceding siblings ...)
2022-06-22 16:44 ` [PATCH RFC v1 09/10] KVM: VMX: Cache MSR_IA32_VMX_MISC in vmcs_config Vitaly Kuznetsov
@ 2022-06-22 16:44 ` Vitaly Kuznetsov
2022-06-24 0:31 ` [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Sean Christopherson
10 siblings, 0 replies; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-22 16:44 UTC (permalink / raw)
To: kvm, Paolo Bonzini, Anirudh Rayabharam, Sean Christopherson
Cc: Wanpeng Li, Jim Mattson, Maxim Levitsky, linux-hyperv,
linux-kernel
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/vmx/nested.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index ede6314a641e..97d0c9fa4444 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -6738,10 +6738,7 @@ void nested_vmx_setup_ctls_msrs(struct vmcs_config *vmcs_conf, u32 ept_caps)
msrs->secondary_ctls_high |= SECONDARY_EXEC_ENCLS_EXITING;
/* miscellaneous data */
- rdmsr(MSR_IA32_VMX_MISC,
- msrs->misc_low,
- msrs->misc_high);
- msrs->misc_low &= VMX_MISC_SAVE_EFER_LMA;
+ msrs->misc_low = (u32)vmcs_conf->misc & VMX_MISC_SAVE_EFER_LMA;
msrs->misc_low |=
MSR_IA32_VMX_MISC_VMWRITE_SHADOW_RO_FIELDS |
VMX_MISC_EMULATED_PREEMPTION_TIMER_RATE |
--
2.35.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH RFC v1 03/10] KVM: VMX: Move CPU_BASED_{CR3_LOAD,CR3_STORE,INVLPG}_EXITING filtering out of setup_vmcs_config()
2022-06-22 16:44 ` [PATCH RFC v1 03/10] KVM: VMX: Move CPU_BASED_{CR3_LOAD,CR3_STORE,INVLPG}_EXITING filtering out of setup_vmcs_config() Vitaly Kuznetsov
@ 2022-06-24 0:04 ` Sean Christopherson
0 siblings, 0 replies; 17+ messages in thread
From: Sean Christopherson @ 2022-06-24 0:04 UTC (permalink / raw)
To: Vitaly Kuznetsov
Cc: kvm, Paolo Bonzini, Anirudh Rayabharam, Wanpeng Li, Jim Mattson,
Maxim Levitsky, linux-hyperv, linux-kernel
On Wed, Jun 22, 2022, Vitaly Kuznetsov wrote:
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
> arch/x86/kvm/vmx/vmx.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index 01294a2fc1c1..4583de7f0324 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -4293,6 +4293,16 @@ static u32 vmx_exec_control(struct vcpu_vmx *vmx)
> CPU_BASED_MONITOR_TRAP_FLAG |
> CPU_BASED_PAUSE_EXITING);
>
> + if (vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_ENABLE_EPT) {
> + /*
> + * CR3 accesses and invlpg don't need to cause VM Exits when EPT
> + * enabled.
> + */
> + exec_control &= ~(CPU_BASED_CR3_LOAD_EXITING |
> + CPU_BASED_CR3_STORE_EXITING |
> + CPU_BASED_INVLPG_EXITING);
> + }
No need to clear them based on support, just invert the logic so that KVM leaves
them set in the base config and then cleares them if EPT is enabled (instead of
clearing them if EPT is supported and then restoring them if EPT is disabled via
module param).
--
From: Sean Christopherson <seanjc@google.com>
Date: Thu, 23 Jun 2022 17:00:58 -0700
Subject: [PATCH] KVM: VMX: Clear controls obsoleted by EPT at runtime, not
setup
Clear the CR3 and INVLPG interception controls at runtime based on
whether or not EPT is being _used_, as opposed to clearing the bits at
setup if EPT is _supported_ in hardware, and then restoring them when EPT
is not used. Not mucking with the base config will allow using the base
config as the starting point for emulating the VMX capability MSRs.
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
arch/x86/kvm/vmx/vmx.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 5d8f28b5d6ca..f39af86a6c50 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -2550,13 +2550,8 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
rdmsr_safe(MSR_IA32_VMX_EPT_VPID_CAP,
&vmx_cap->ept, &vmx_cap->vpid);
- if (_cpu_based_2nd_exec_control & SECONDARY_EXEC_ENABLE_EPT) {
- /* CR3 accesses and invlpg don't need to cause VM Exits when EPT
- enabled */
- _cpu_based_exec_control &= ~(CPU_BASED_CR3_LOAD_EXITING |
- CPU_BASED_CR3_STORE_EXITING |
- CPU_BASED_INVLPG_EXITING);
- } else if (vmx_cap->ept) {
+ if (!(_cpu_based_2nd_exec_control & SECONDARY_EXEC_ENABLE_EPT) &&
+ vmx_cap->ept) {
pr_warn_once("EPT CAP should not exist if not support "
"1-setting enable EPT VM-execution control\n");
@@ -4320,10 +4315,12 @@ static u32 vmx_exec_control(struct vcpu_vmx *vmx)
CPU_BASED_CR8_LOAD_EXITING;
#endif
}
- if (!enable_ept)
- exec_control |= CPU_BASED_CR3_STORE_EXITING |
- CPU_BASED_CR3_LOAD_EXITING |
- CPU_BASED_INVLPG_EXITING;
+
+ /* No need to intercept CR3 access or INVPLG when using EPT. */
+ if (enable_ept)
+ exec_control &= ~(CPU_BASED_CR3_LOAD_EXITING |
+ CPU_BASED_CR3_STORE_EXITING |
+ CPU_BASED_INVLPG_EXITING);
if (kvm_mwait_in_guest(vmx->vcpu.kvm))
exec_control &= ~(CPU_BASED_MWAIT_EXITING |
CPU_BASED_MONITOR_EXITING);
base-commit: d365a92177bda6629885401d44fbe912106b3df6
--
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH RFC v1 01/10] KVM: VMX: Move CPU_BASED_CR8_{LOAD,STORE}_EXITING filtering out of setup_vmcs_config()
2022-06-22 16:44 ` [PATCH RFC v1 01/10] KVM: VMX: Move CPU_BASED_CR8_{LOAD,STORE}_EXITING filtering out of setup_vmcs_config() Vitaly Kuznetsov
@ 2022-06-24 0:09 ` Sean Christopherson
0 siblings, 0 replies; 17+ messages in thread
From: Sean Christopherson @ 2022-06-24 0:09 UTC (permalink / raw)
To: Vitaly Kuznetsov
Cc: kvm, Paolo Bonzini, Anirudh Rayabharam, Wanpeng Li, Jim Mattson,
Maxim Levitsky, linux-hyperv, linux-kernel
On Wed, Jun 22, 2022, Vitaly Kuznetsov wrote:
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
> arch/x86/kvm/vmx/vmx.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index 5e14e4c40007..24da9e93bdab 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -2490,11 +2490,6 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
> if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_PROCBASED_CTLS,
> &_cpu_based_exec_control) < 0)
> return -EIO;
> -#ifdef CONFIG_X86_64
> - if (_cpu_based_exec_control & CPU_BASED_TPR_SHADOW)
> - _cpu_based_exec_control &= ~CPU_BASED_CR8_LOAD_EXITING &
> - ~CPU_BASED_CR8_STORE_EXITING;
Eww, who does a double "~" with an "&"?
> -#endif
> if (_cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS) {
> min2 = 0;
> opt2 = SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
> @@ -4285,6 +4280,12 @@ static u32 vmx_exec_control(struct vcpu_vmx *vmx)
> {
> u32 exec_control = vmcs_config.cpu_based_exec_ctrl;
>
> +#ifdef CONFIG_X86_64
> + if (exec_control & CPU_BASED_TPR_SHADOW)
> + exec_control &= ~CPU_BASED_CR8_LOAD_EXITING &
> + ~CPU_BASED_CR8_STORE_EXITING;
If you shove this done a few lines, then you can have a single set of #ifdefs,
and avoid restoring the controls a few lines later if it turns out KVM isn't
enabling the TPR shadow, e.g. (with fixup to use the more canonical ~(x | y)
pattern).
if (!cpu_need_tpr_shadow(&vmx->vcpu))
exec_control &= ~CPU_BASED_TPR_SHADOW;
#ifdef CONFIG_X86_64
if (exec_control & CPU_BASED_TPR_SHADOW)
exec_control &= ~(CPU_BASED_CR8_LOAD_EXITING |
CPU_BASED_CR8_STORE_EXITING);
else
exec_control |= CPU_BASED_CR8_STORE_EXITING |
CPU_BASED_CR8_LOAD_EXITING;
#endif
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH RFC v1 02/10] KVM: VMX: Add missing CPU based VM execution controls to vmcs_config
2022-06-22 16:44 ` [PATCH RFC v1 02/10] KVM: VMX: Add missing CPU based VM execution controls to vmcs_config Vitaly Kuznetsov
@ 2022-06-24 0:12 ` Sean Christopherson
2022-06-27 15:12 ` Vitaly Kuznetsov
0 siblings, 1 reply; 17+ messages in thread
From: Sean Christopherson @ 2022-06-24 0:12 UTC (permalink / raw)
To: Vitaly Kuznetsov
Cc: kvm, Paolo Bonzini, Anirudh Rayabharam, Wanpeng Li, Jim Mattson,
Maxim Levitsky, linux-hyperv, linux-kernel
Maybe say "dynamically enabled" or so instead of "missing"?
On Wed, Jun 22, 2022, Vitaly Kuznetsov wrote:
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
> arch/x86/kvm/vmx/vmx.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index 24da9e93bdab..01294a2fc1c1 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -2483,8 +2483,14 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
> CPU_BASED_INVLPG_EXITING |
> CPU_BASED_RDPMC_EXITING;
>
> - opt = CPU_BASED_TPR_SHADOW |
> + opt = CPU_BASED_INTR_WINDOW_EXITING |
> + CPU_BASED_RDTSC_EXITING |
> + CPU_BASED_TPR_SHADOW |
> + CPU_BASED_NMI_WINDOW_EXITING |
> + CPU_BASED_USE_IO_BITMAPS |
> + CPU_BASED_MONITOR_TRAP_FLAG |
> CPU_BASED_USE_MSR_BITMAPS |
> + CPU_BASED_PAUSE_EXITING |
> CPU_BASED_ACTIVATE_SECONDARY_CONTROLS |
> CPU_BASED_ACTIVATE_TERTIARY_CONTROLS;
> if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_PROCBASED_CTLS,
> @@ -4280,6 +4286,13 @@ static u32 vmx_exec_control(struct vcpu_vmx *vmx)
> {
> u32 exec_control = vmcs_config.cpu_based_exec_ctrl;
>
> + exec_control &= ~(CPU_BASED_INTR_WINDOW_EXITING |
> + CPU_BASED_RDTSC_EXITING |
> + CPU_BASED_NMI_WINDOW_EXITING |
> + CPU_BASED_USE_IO_BITMAPS |
> + CPU_BASED_MONITOR_TRAP_FLAG |
> + CPU_BASED_PAUSE_EXITING);
> +
> #ifdef CONFIG_X86_64
> if (exec_control & CPU_BASED_TPR_SHADOW)
> exec_control &= ~CPU_BASED_CR8_LOAD_EXITING &
> --
> 2.35.3
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs
2022-06-22 16:44 [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Vitaly Kuznetsov
` (9 preceding siblings ...)
2022-06-22 16:44 ` [PATCH RFC v1 10/10] KVM: nVMX: Use cached host MSR_IA32_VMX_MISC value for setting up nested MSR Vitaly Kuznetsov
@ 2022-06-24 0:31 ` Sean Christopherson
2022-06-27 16:06 ` Vitaly Kuznetsov
10 siblings, 1 reply; 17+ messages in thread
From: Sean Christopherson @ 2022-06-24 0:31 UTC (permalink / raw)
To: Vitaly Kuznetsov
Cc: kvm, Paolo Bonzini, Anirudh Rayabharam, Wanpeng Li, Jim Mattson,
Maxim Levitsky, linux-hyperv, linux-kernel
On Wed, Jun 22, 2022, Vitaly Kuznetsov wrote:
> vmcs_config is a sanitized version of host VMX MSRs where some controls are
> filtered out (e.g. when Enlightened VMCS is enabled, some know bugs are
> discovered, some inconsistencies in controls are detected,...) but
> nested_vmx_setup_ctls_msrs() uses raw host MSRs instead. This may end up
> in exposing undesired controls to L1. Switch to using vmcs_config instead.
>
> RFC part: vmcs_config's sanitization now is a mix of "what can't be enabled"
> and "what KVM doesn't want" and we need to separate these as for nested VMX
> MSRs only the first category makes sense. This gives vmcs_config a slightly
> different meaning "controls which can be (theoretically) used". An alternative
> approach would be to store sanitized host MSRs values separately, sanitize
> them and and use in nested_vmx_setup_ctls_msrs() but currently I don't see
> any benefits. Comments welcome!
I like the idea overall, even though it's a decent amount of churn. It seems
easier to maintain than separate paths for nested. The alternative would be to
add common helpers to adjust the baseline configurations, but I don't see any
way to programmatically make that approach more robust.
An idea to further harden things. Or: an excuse to extend macro shenanigans :-)
If we throw all of the "opt" and "min" lists into macros, e.g. KVM_REQUIRED_*
and KVM_OPTIONAL_*, and then use those to define a KVM_KNOWN_* field, we can
prevent using the mutators to set/clear unknown bits at runtime via BUILD_BUG_ON().
The core builders, e.g. vmx_exec_control(), can still set unknown bits, i.e. set
bits that aren't enumerated to L1, but that's easier to audit and this would catch
regressions for the issues fixed in patches.
It'll required making add_atomic_switch_msr_special() __always_inline (or just
open code it), but that's not a big deal.
E.g. if we have
#define KVM_REQUIRED_CPU_BASED_VM_EXEC_CONTROL <blah blah blah>
#define KVM_OPTIONAL_CPU_BASED_VM_EXEC_CONTROL <blah blah blah>
Then the builders for the controls shadows can do:
diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h
index 286c88e285ea..5eb75822a09e 100644
--- a/arch/x86/kvm/vmx/vmx.h
+++ b/arch/x86/kvm/vmx/vmx.h
@@ -468,6 +468,8 @@ static inline u8 vmx_get_rvi(void)
}
#define BUILD_CONTROLS_SHADOW(lname, uname, bits) \
+#define KVM_KNOWN_ ## uname \
+ (KVM_REQUIRED_ ## uname | KVM_OPTIONAL_ ## uname) \
static inline void lname##_controls_set(struct vcpu_vmx *vmx, u##bits val) \
{ \
if (vmx->loaded_vmcs->controls_shadow.lname != val) { \
@@ -485,10 +487,12 @@ static inline u##bits lname##_controls_get(struct vcpu_vmx *vmx) \
} \
static inline void lname##_controls_setbit(struct vcpu_vmx *vmx, u##bits val) \
{ \
+ BUILD_BUG_ON(!(val & KVM_KNOWN_ ## uname)); \
lname##_controls_set(vmx, lname##_controls_get(vmx) | val); \
} \
static inline void lname##_controls_clearbit(struct vcpu_vmx *vmx, u##bits val) \
{ \
+ BUILD_BUG_ON(!(val & KVM_KNOWN_ ## uname)); \
lname##_controls_set(vmx, lname##_controls_get(vmx) & ~val); \
}
BUILD_CONTROLS_SHADOW(vm_entry, VM_ENTRY_CONTROLS, 32)
Handling the controls that are restricted to CONFIG_X86_64=y will be midly annoying,
but adding a base set isn't too bad, e.g.
#define __KVM_REQUIRED_CPU_BASED_VM_EXEC_CONTROL <blah blah blah>
#ifdef CONFIG_X86_64
#define KVM_REQUIRED_CPU_BASED_VM_EXEC_CONTROL (__KVM_REQUIRED_CPU_BASED_VM_EXEC_CONTROL | \
CPU_BASED_CR8_LOAD_EXITING | \
CPU_BASED_CR8_STORE_EXITING)
#else
#define KVM_REQUIRED_CPU_BASED_VM_EXEC_CONTROL __KVM_REQUIRED_CPU_BASED_VM_EXEC_CONTROL
#endif
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH RFC v1 02/10] KVM: VMX: Add missing CPU based VM execution controls to vmcs_config
2022-06-24 0:12 ` Sean Christopherson
@ 2022-06-27 15:12 ` Vitaly Kuznetsov
0 siblings, 0 replies; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-27 15:12 UTC (permalink / raw)
To: Sean Christopherson
Cc: kvm, Paolo Bonzini, Anirudh Rayabharam, Wanpeng Li, Jim Mattson,
Maxim Levitsky, linux-hyperv, linux-kernel
Sean Christopherson <seanjc@google.com> writes:
> Maybe say "dynamically enabled" or so instead of "missing"?
>
...
> On Wed, Jun 22, 2022, Vitaly Kuznetsov wrote:
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> ---
>> arch/x86/kvm/vmx/vmx.c | 15 ++++++++++++++-
>> 1 file changed, 14 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
>> index 24da9e93bdab..01294a2fc1c1 100644
>> --- a/arch/x86/kvm/vmx/vmx.c
>> +++ b/arch/x86/kvm/vmx/vmx.c
>> @@ -2483,8 +2483,14 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf,
>> CPU_BASED_INVLPG_EXITING |
>> CPU_BASED_RDPMC_EXITING;
>>
>> - opt = CPU_BASED_TPR_SHADOW |
>> + opt = CPU_BASED_INTR_WINDOW_EXITING |
>> + CPU_BASED_RDTSC_EXITING |
>> + CPU_BASED_TPR_SHADOW |
>> + CPU_BASED_NMI_WINDOW_EXITING |
>> + CPU_BASED_USE_IO_BITMAPS |
>> + CPU_BASED_MONITOR_TRAP_FLAG |
>> CPU_BASED_USE_MSR_BITMAPS |
>> + CPU_BASED_PAUSE_EXITING |
>> CPU_BASED_ACTIVATE_SECONDARY_CONTROLS |
>> CPU_BASED_ACTIVATE_TERTIARY_CONTROLS;
CPU_BASED_INTR_WINDOW_EXITING and CPU_BASED_NMI_WINDOW_EXITING are
actually "dynamically enabled" but CPU_BASED_RDTSC_EXITING/
CPU_BASED_USE_IO_BITMAPS/ CPU_BASED_MONITOR_TRAP_FLAG /
CPU_BASED_PAUSE_EXITING are not (and I found the first two immediately
after implementing 'macro shananigans' you suggested, of course :-), KVM
just doesn't use them for L1. So this is going to get splitted in two
patches.
--
Vitaly
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs
2022-06-24 0:31 ` [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Sean Christopherson
@ 2022-06-27 16:06 ` Vitaly Kuznetsov
0 siblings, 0 replies; 17+ messages in thread
From: Vitaly Kuznetsov @ 2022-06-27 16:06 UTC (permalink / raw)
To: Sean Christopherson
Cc: kvm, Paolo Bonzini, Anirudh Rayabharam, Wanpeng Li, Jim Mattson,
Maxim Levitsky, linux-hyperv, linux-kernel
Sean Christopherson <seanjc@google.com> writes:
> On Wed, Jun 22, 2022, Vitaly Kuznetsov wrote:
>> vmcs_config is a sanitized version of host VMX MSRs where some controls are
>> filtered out (e.g. when Enlightened VMCS is enabled, some know bugs are
>> discovered, some inconsistencies in controls are detected,...) but
>> nested_vmx_setup_ctls_msrs() uses raw host MSRs instead. This may end up
>> in exposing undesired controls to L1. Switch to using vmcs_config instead.
>>
>> RFC part: vmcs_config's sanitization now is a mix of "what can't be enabled"
>> and "what KVM doesn't want" and we need to separate these as for nested VMX
>> MSRs only the first category makes sense. This gives vmcs_config a slightly
>> different meaning "controls which can be (theoretically) used". An alternative
>> approach would be to store sanitized host MSRs values separately, sanitize
>> them and and use in nested_vmx_setup_ctls_msrs() but currently I don't see
>> any benefits. Comments welcome!
>
> I like the idea overall, even though it's a decent amount of churn. It seems
> easier to maintain than separate paths for nested. The alternative would be to
> add common helpers to adjust the baseline configurations, but I don't see any
> way to programmatically make that approach more robust.
>
> An idea to further harden things. Or: an excuse to extend macro shenanigans :-)
>
> If we throw all of the "opt" and "min" lists into macros, e.g. KVM_REQUIRED_*
> and KVM_OPTIONAL_*, and then use those to define a KVM_KNOWN_* field, we can
> prevent using the mutators to set/clear unknown bits at runtime via BUILD_BUG_ON().
> The core builders, e.g. vmx_exec_control(), can still set unknown bits, i.e. set
> bits that aren't enumerated to L1, but that's easier to audit and this would catch
> regressions for the issues fixed in patches.
>
> It'll required making add_atomic_switch_msr_special() __always_inline (or just
> open code it), but that's not a big deal.
>
> E.g. if we have
>
> #define KVM_REQUIRED_CPU_BASED_VM_EXEC_CONTROL <blah blah blah>
> #define KVM_OPTIONAL_CPU_BASED_VM_EXEC_CONTROL <blah blah blah>
>
> Then the builders for the controls shadows can do:
>
> diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h
> index 286c88e285ea..5eb75822a09e 100644
> --- a/arch/x86/kvm/vmx/vmx.h
> +++ b/arch/x86/kvm/vmx/vmx.h
> @@ -468,6 +468,8 @@ static inline u8 vmx_get_rvi(void)
> }
>
> #define BUILD_CONTROLS_SHADOW(lname, uname, bits) \
> +#define KVM_KNOWN_ ## uname \
> + (KVM_REQUIRED_ ## uname | KVM_OPTIONAL_ ## uname) \
I'm certainly not a macro jedi and I failed to make this compile as gcc
hates when I put '#define's in macros but I made a simpler version with
(presumeably) the same outcome. v1 is out, thanks for the suggestion!
> static inline void lname##_controls_set(struct vcpu_vmx *vmx, u##bits val) \
> { \
> if (vmx->loaded_vmcs->controls_shadow.lname != val) { \
> @@ -485,10 +487,12 @@ static inline u##bits lname##_controls_get(struct vcpu_vmx *vmx) \
> } \
> static inline void lname##_controls_setbit(struct vcpu_vmx *vmx, u##bits val) \
> { \
> + BUILD_BUG_ON(!(val & KVM_KNOWN_ ## uname)); \
> lname##_controls_set(vmx, lname##_controls_get(vmx) | val); \
> } \
> static inline void lname##_controls_clearbit(struct vcpu_vmx *vmx, u##bits val) \
> { \
> + BUILD_BUG_ON(!(val & KVM_KNOWN_ ## uname)); \
> lname##_controls_set(vmx, lname##_controls_get(vmx) & ~val); \
> }
> BUILD_CONTROLS_SHADOW(vm_entry, VM_ENTRY_CONTROLS, 32)
>
>
>
> Handling the controls that are restricted to CONFIG_X86_64=y will be midly annoying,
> but adding a base set isn't too bad, e.g.
>
> #define __KVM_REQUIRED_CPU_BASED_VM_EXEC_CONTROL <blah blah blah>
> #ifdef CONFIG_X86_64
> #define KVM_REQUIRED_CPU_BASED_VM_EXEC_CONTROL (__KVM_REQUIRED_CPU_BASED_VM_EXEC_CONTROL | \
> CPU_BASED_CR8_LOAD_EXITING | \
> CPU_BASED_CR8_STORE_EXITING)
> #else
> #define KVM_REQUIRED_CPU_BASED_VM_EXEC_CONTROL __KVM_REQUIRED_CPU_BASED_VM_EXEC_CONTROL
> #endif
>
--
Vitaly
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2022-06-27 16:06 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-22 16:44 [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 01/10] KVM: VMX: Move CPU_BASED_CR8_{LOAD,STORE}_EXITING filtering out of setup_vmcs_config() Vitaly Kuznetsov
2022-06-24 0:09 ` Sean Christopherson
2022-06-22 16:44 ` [PATCH RFC v1 02/10] KVM: VMX: Add missing CPU based VM execution controls to vmcs_config Vitaly Kuznetsov
2022-06-24 0:12 ` Sean Christopherson
2022-06-27 15:12 ` Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 03/10] KVM: VMX: Move CPU_BASED_{CR3_LOAD,CR3_STORE,INVLPG}_EXITING filtering out of setup_vmcs_config() Vitaly Kuznetsov
2022-06-24 0:04 ` Sean Christopherson
2022-06-22 16:44 ` [PATCH RFC v1 04/10] KVM: VMX: Add missing VMEXIT controls to vmcs_config Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 05/10] KVM: VMX: Add missing VMENTRY " Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 06/10] KVM: nVMX: Use sanitized allowed-1 bits for VMX control MSRs Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 07/10] KVM: VMX: Store required-1 VMX controls in vmcs_config Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 08/10] KVM: nVMX: Use sanitized required-1 bits for VMX control MSRs Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 09/10] KVM: VMX: Cache MSR_IA32_VMX_MISC in vmcs_config Vitaly Kuznetsov
2022-06-22 16:44 ` [PATCH RFC v1 10/10] KVM: nVMX: Use cached host MSR_IA32_VMX_MISC value for setting up nested MSR Vitaly Kuznetsov
2022-06-24 0:31 ` [PATCH RFC v1 00/10] KVM: nVMX: Use vmcs_config for setting up nested VMX MSRs Sean Christopherson
2022-06-27 16:06 ` Vitaly Kuznetsov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).