diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/kvm/svm.c | 8 | ||||
-rw-r--r-- | drivers/kvm/vmx.c | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index ccc06b1b91b5..714f6a7841cd 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c @@ -17,6 +17,7 @@ #include <linux/module.h> #include <linux/vmalloc.h> #include <linux/highmem.h> +#include <linux/profile.h> #include <asm/desc.h> #include "kvm_svm.h" @@ -1558,6 +1559,13 @@ again: reload_tss(vcpu); + /* + * Profile KVM exit RIPs: + */ + if (unlikely(prof_on == KVM_PROFILING)) + profile_hit(KVM_PROFILING, + (void *)(unsigned long)vcpu->svm->vmcb->save.rip); + stgi(); kvm_reput_irq(vcpu); diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index d4701cb4c654..ce219e3f557f 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -21,6 +21,7 @@ #include <linux/module.h> #include <linux/mm.h> #include <linux/highmem.h> +#include <linux/profile.h> #include <asm/io.h> #include <asm/desc.h> @@ -1859,6 +1860,12 @@ again: asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS)); #endif + /* + * Profile KVM exit RIPs: + */ + if (unlikely(prof_on == KVM_PROFILING)) + profile_hit(KVM_PROFILING, (void *)vmcs_readl(GUEST_RIP)); + kvm_run->exit_type = 0; if (fail) { kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY; |