aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-07-01 09:01:02 -0400
committerAvi Kivity <avi@redhat.com>2009-09-10 01:33:07 -0400
commitaec51dc4f1584018d7e35269e04e3dde3d2033e6 (patch)
tree8423d4680a2db4417fd99ccfffc935f8650230e1 /arch/x86/kvm/x86.c
parentc323c0e5f06150cc000e09e8e3b22356099e7bde (diff)
KVM: Trace mmio
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index af40e23df25..d32e3c6d317 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -37,6 +37,8 @@
37#include <linux/iommu.h> 37#include <linux/iommu.h>
38#include <linux/intel-iommu.h> 38#include <linux/intel-iommu.h>
39#include <linux/cpufreq.h> 39#include <linux/cpufreq.h>
40#include <trace/events/kvm.h>
41#undef TRACE_INCLUDE_FILE
40#define CREATE_TRACE_POINTS 42#define CREATE_TRACE_POINTS
41#include "trace.h" 43#include "trace.h"
42 44
@@ -2425,6 +2427,8 @@ static int emulator_read_emulated(unsigned long addr,
2425 2427
2426 if (vcpu->mmio_read_completed) { 2428 if (vcpu->mmio_read_completed) {
2427 memcpy(val, vcpu->mmio_data, bytes); 2429 memcpy(val, vcpu->mmio_data, bytes);
2430 trace_kvm_mmio(KVM_TRACE_MMIO_READ, bytes,
2431 vcpu->mmio_phys_addr, *(u64 *)val);
2428 vcpu->mmio_read_completed = 0; 2432 vcpu->mmio_read_completed = 0;
2429 return X86EMUL_CONTINUE; 2433 return X86EMUL_CONTINUE;
2430 } 2434 }
@@ -2445,8 +2449,12 @@ mmio:
2445 /* 2449 /*
2446 * Is this MMIO handled locally? 2450 * Is this MMIO handled locally?
2447 */ 2451 */
2448 if (!vcpu_mmio_read(vcpu, gpa, bytes, val)) 2452 if (!vcpu_mmio_read(vcpu, gpa, bytes, val)) {
2453 trace_kvm_mmio(KVM_TRACE_MMIO_READ, bytes, gpa, *(u64 *)val);
2449 return X86EMUL_CONTINUE; 2454 return X86EMUL_CONTINUE;
2455 }
2456
2457 trace_kvm_mmio(KVM_TRACE_MMIO_READ_UNSATISFIED, bytes, gpa, 0);
2450 2458
2451 vcpu->mmio_needed = 1; 2459 vcpu->mmio_needed = 1;
2452 vcpu->mmio_phys_addr = gpa; 2460 vcpu->mmio_phys_addr = gpa;
@@ -2490,6 +2498,7 @@ static int emulator_write_emulated_onepage(unsigned long addr,
2490 return X86EMUL_CONTINUE; 2498 return X86EMUL_CONTINUE;
2491 2499
2492mmio: 2500mmio:
2501 trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, bytes, gpa, *(u64 *)val);
2493 /* 2502 /*
2494 * Is this MMIO handled locally? 2503 * Is this MMIO handled locally?
2495 */ 2504 */