aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/lapic.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2009-06-17 08:22:14 -0400
committerAvi Kivity <avi@redhat.com>2009-09-10 01:32:59 -0400
commit229456fc34b1c9031b04f7581e7b755d1cebfe9c (patch)
tree85fc0b54e9403d6ea059b8f7f78cea49594aaace /arch/x86/kvm/lapic.c
parent219b65dcf6c0bad83d51bfa12e25891c02de2414 (diff)
KVM: convert custom marker based tracing to event traces
This allows use of the powerful ftrace infrastructure. See Documentation/trace/ for usage information. [avi, stephen: various build fixes] [sheng: fix control register breakage] Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r--arch/x86/kvm/lapic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 3bde43c3789e..2e0286596387 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -34,6 +34,7 @@
34#include <asm/atomic.h> 34#include <asm/atomic.h>
35#include "kvm_cache_regs.h" 35#include "kvm_cache_regs.h"
36#include "irq.h" 36#include "irq.h"
37#include "trace.h"
37 38
38#ifndef CONFIG_X86_64 39#ifndef CONFIG_X86_64
39#define mod_64(x, y) ((x) - (y) * div64_u64(x, y)) 40#define mod_64(x, y) ((x) - (y) * div64_u64(x, y))
@@ -515,8 +516,6 @@ static u32 __apic_read(struct kvm_lapic *apic, unsigned int offset)
515{ 516{
516 u32 val = 0; 517 u32 val = 0;
517 518
518 KVMTRACE_1D(APIC_ACCESS, apic->vcpu, (u32)offset, handler);
519
520 if (offset >= LAPIC_MMIO_LENGTH) 519 if (offset >= LAPIC_MMIO_LENGTH)
521 return 0; 520 return 0;
522 521
@@ -562,6 +561,8 @@ static void apic_mmio_read(struct kvm_io_device *this,
562 } 561 }
563 result = __apic_read(apic, offset & ~0xf); 562 result = __apic_read(apic, offset & ~0xf);
564 563
564 trace_kvm_apic_read(offset, result);
565
565 switch (len) { 566 switch (len) {
566 case 1: 567 case 1:
567 case 2: 568 case 2:
@@ -657,7 +658,7 @@ static void apic_mmio_write(struct kvm_io_device *this,
657 658
658 offset &= 0xff0; 659 offset &= 0xff0;
659 660
660 KVMTRACE_1D(APIC_ACCESS, apic->vcpu, (u32)offset, handler); 661 trace_kvm_apic_write(offset, val);
661 662
662 switch (offset) { 663 switch (offset) {
663 case APIC_ID: /* Local APIC ID */ 664 case APIC_ID: /* Local APIC ID */