public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Cleanup VMFUNC handling in KVM.
@ 2022-11-09  7:54 Yu Zhang
  2022-11-09  7:54 ` [PATCH v2 1/2] KVM: VMX: Do not trap VMFUNC instructions for L1 guests Yu Zhang
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Yu Zhang @ 2022-11-09  7:54 UTC (permalink / raw)
  To: pbonzini, seanjc, kvm; +Cc: linux-kernel

Since VMFUNC is not supported for non-nested guests, and executing VMFUNC
can cause a #UD directly, if the “enable VM functions” VM-execution control
is 0, KVM can just disable it in VM-exectution control, instead of taking
pains to trap it and emulate the #UD for L1 guests.

Also, simplified the process of setting SECONDARY_EXEC_ENABLE_VMFUNC for
nested VMX MSR configurations.

Change log:
==========
v1->v2
- Split the patch into two pieces.
- Use KVM_BUG_ON() for unexpected VM Exits.
- Comments changes.
- Commit message changes, trying to better illustrate the reason.

Yu Zhang (2):
  KVM: VMX: Do not trap VMFUNC instructions for L1 guests.
  KVM: nVMX: Simplify the setting of SECONDARY_EXEC_ENABLE_VMFUNC for
    nested.

 arch/x86/kvm/vmx/nested.c | 26 ++++++++++----------------
 arch/x86/kvm/vmx/vmx.c    |  7 ++++++-
 2 files changed, 16 insertions(+), 17 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-08  6:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-09  7:54 [PATCH v2 0/2] Cleanup VMFUNC handling in KVM Yu Zhang
2022-11-09  7:54 ` [PATCH v2 1/2] KVM: VMX: Do not trap VMFUNC instructions for L1 guests Yu Zhang
2022-11-09  7:54 ` [PATCH v2 2/2] KVM: nVMX: Simplify the setting of SECONDARY_EXEC_ENABLE_VMFUNC for nested Yu Zhang
2022-11-17  9:55 ` [PATCH v2 0/2] Cleanup VMFUNC handling in KVM Yu Zhang
2023-02-08  2:02 ` Sean Christopherson
2023-02-08  6:28   ` Yu Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox