aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@amd.com>2010-12-21 05:12:06 -0500
committerAvi Kivity <avi@redhat.com>2011-01-12 04:31:05 -0500
commitdf4f3108562dc6f6ae6648f2698df7f4c9acf52d (patch)
tree6a2b0889c5f232cf74e0bfca0b133cdb8a081566 /arch
parentcae3797a4639898f339fad57c7e12d270ec91a6c (diff)
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 <andre.przywara@amd.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/svm.c7
1 files changed, 6 insertions, 1 deletions
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)
2652 2652
2653static int invlpg_interception(struct vcpu_svm *svm) 2653static int invlpg_interception(struct vcpu_svm *svm)
2654{ 2654{
2655 return emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE; 2655 if (!static_cpu_has(X86_FEATURE_DECODEASSISTS))
2656 return emulate_instruction(&svm->vcpu, 0) == EMULATE_DONE;
2657
2658 kvm_mmu_invlpg(&svm->vcpu, svm->vmcb->control.exit_info_1);
2659 skip_emulated_instruction(&svm->vcpu);
2660 return 1;
2656} 2661}
2657 2662
2658static int emulate_on_interception(struct vcpu_svm *svm) 2663static int emulate_on_interception(struct vcpu_svm *svm)