From: Andre Przywara Date: Tue, 21 Dec 2010 10:12:06 +0000 (+0100) Subject: KVM: SVM: implement enhanced INVLPG intercept X-Git-Tag: firefly_0821_release~7613^2~2890^2~12 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=df4f3108562dc6f6ae6648f2698df7f4c9acf52d;p=firefly-linux-kernel-4.4.55.git KVM: SVM: implement enhanced INVLPG intercept When the DecodeAssist feature is available, the linear address is provided in the VMCB on INVLPG intercepts. Use it directly to avoid any decoding and emulation. This is only useful for shadow paging, though. Signed-off-by: Andre Przywara Signed-off-by: Marcelo Tosatti --- diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index d84f6a7c2bc5..a04c01e324b4 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -2652,7 +2652,12 @@ static int iret_interception(struct vcpu_svm *svm) static int invlpg_interception(struct vcpu_svm *svm) { - return emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE; + if (!static_cpu_has(X86_FEATURE_DECODEASSISTS)) + return emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE; + + kvm_mmu_invlpg(&svm->vcpu, svm->vmcb->control.exit_info_1); + skip_emulated_instruction(&svm->vcpu); + return 1; } static int emulate_on_interception(struct vcpu_svm *svm)