xref: /linux/arch/x86/kvm/svm/hyperv.c (revision 0da908c291070d89482f6211dbe81d4d43c3f7cb)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * AMD SVM specific code for Hyper-V on KVM.
4  *
5  * Copyright 2022 Red Hat, Inc. and/or its affiliates.
6  */
7 #include "hyperv.h"
8 
9 void svm_hv_inject_synthetic_vmexit_post_tlb_flush(struct kvm_vcpu *vcpu)
10 {
11 	struct vcpu_svm *svm = to_svm(vcpu);
12 
13 	svm->vmcb->control.exit_code = HV_SVM_EXITCODE_ENL;
14 	svm->vmcb->control.exit_code_hi = 0;
15 	svm->vmcb->control.exit_info_1 = HV_SVM_ENL_EXITCODE_TRAP_AFTER_FLUSH;
16 	svm->vmcb->control.exit_info_2 = 0;
17 	nested_svm_vmexit(svm);
18 }
19