[patch V3 6/8] KVM: x86: call isolation prepare from VM-entry code path
From: Marcelo Tosatti
Date: Tue Aug 24 2021 - 11:43:09 EST
VM-entry code path is an entry point similar to userspace return
when task isolation is concerned.
Call isolation_exit_to_user_mode_prepare before VM-enter.
Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx>
---
arch/x86/kvm/x86.c | 3 +++
1 file changed, 3 insertions(+)
Index: linux-2.6/arch/x86/kvm/x86.c
===================================================================
--- linux-2.6.orig/arch/x86/kvm/x86.c
+++ linux-2.6/arch/x86/kvm/x86.c
@@ -59,6 +59,7 @@
#include <linux/mem_encrypt.h>
#include <linux/entry-kvm.h>
#include <linux/suspend.h>
+#include <linux/task_isolation.h>
#include <trace/events/kvm.h>
@@ -9539,6 +9540,8 @@ static int vcpu_enter_guest(struct kvm_v
goto cancel_injection;
}
+ isolation_exit_to_user_mode_prepare();
+
preempt_disable();
static_call(kvm_x86_prepare_guest_switch)(vcpu);