aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Kaplan <David.Kaplan@amd.com>2015-03-02 14:43:37 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2015-03-10 19:31:25 -0400
commitdab429a798a8ab3377136e09dda55ea75a41648d (patch)
treefb1df00573993fbb516c7537bc262246258eca57
parent5cb56059c94ddfaf92567a1c6443deec8363ae1c (diff)
kvm: svm: make wbinvd faster
No need to re-decode WBINVD since we know what it is from the intercept. Signed-off-by: David Kaplan <David.Kaplan@amd.com> [extracted from larger unlrelated patch, forward ported, tested,style cleanup] Signed-off-by: Joel Schopp <joel.schopp@amd.com> Reviewed-by: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--arch/x86/kvm/svm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 16d6e5ca4c03..8f665851724f 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -2774,6 +2774,12 @@ static int skinit_interception(struct vcpu_svm *svm)
2774 return 1; 2774 return 1;
2775} 2775}
2776 2776
2777static int wbinvd_interception(struct vcpu_svm *svm)
2778{
2779 kvm_emulate_wbinvd(&svm->vcpu);
2780 return 1;
2781}
2782
2777static int xsetbv_interception(struct vcpu_svm *svm) 2783static int xsetbv_interception(struct vcpu_svm *svm)
2778{ 2784{
2779 u64 new_bv = kvm_read_edx_eax(&svm->vcpu); 2785 u64 new_bv = kvm_read_edx_eax(&svm->vcpu);
@@ -3373,7 +3379,7 @@ static int (*const svm_exit_handlers[])(struct vcpu_svm *svm) = {
3373 [SVM_EXIT_STGI] = stgi_interception, 3379 [SVM_EXIT_STGI] = stgi_interception,
3374 [SVM_EXIT_CLGI] = clgi_interception, 3380 [SVM_EXIT_CLGI] = clgi_interception,
3375 [SVM_EXIT_SKINIT] = skinit_interception, 3381 [SVM_EXIT_SKINIT] = skinit_interception,
3376 [SVM_EXIT_WBINVD] = emulate_on_interception, 3382 [SVM_EXIT_WBINVD] = wbinvd_interception,
3377 [SVM_EXIT_MONITOR] = monitor_interception, 3383 [SVM_EXIT_MONITOR] = monitor_interception,
3378 [SVM_EXIT_MWAIT] = mwait_interception, 3384 [SVM_EXIT_MWAIT] = mwait_interception,
3379 [SVM_EXIT_XSETBV] = xsetbv_interception, 3385 [SVM_EXIT_XSETBV] = xsetbv_interception,