[RFC PATCH part-5 20/22] pkvm: x86: Add INVEPT/INVVPID emulation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The INVEPT & INVVPID cause vmexit unconditionally, pKVM must have
handler for them.

It's a tmp solution, just call global invept for invept/invvpid. After
pKVM supported shadow EPT, such emulation shall be done based on
shadow EPT.

Signed-off-by: Jason Chen CJ <jason.cj.chen@xxxxxxxxx>
---
 arch/x86/kvm/vmx/pkvm/hyp/vmexit.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/kvm/vmx/pkvm/hyp/vmexit.c b/arch/x86/kvm/vmx/pkvm/hyp/vmexit.c
index 27b6518032b5..8e7392010887 100644
--- a/arch/x86/kvm/vmx/pkvm/hyp/vmexit.c
+++ b/arch/x86/kvm/vmx/pkvm/hyp/vmexit.c
@@ -251,6 +251,11 @@ int pkvm_main(struct kvm_vcpu *vcpu)
 			case EXIT_REASON_INTERRUPT_WINDOW:
 				handle_irq_window(vcpu);
 				break;
+			case EXIT_REASON_INVEPT:
+			case EXIT_REASON_INVVPID:
+				ept_sync_global();
+				skip_instruction = true;
+				break;
 			default:
 				pkvm_dbg("CPU%d: Unsupported vmexit reason 0x%x.\n", vcpu->cpu, vmx->exit_reason.full);
 				skip_instruction = true;
-- 
2.25.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux