]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: VMX: move APIC_ACCESS trace entry to generic code
authorJoerg Roedel <joerg.roedel@amd.com>
Wed, 30 Apr 2008 15:55:59 +0000 (17:55 +0200)
committerAvi Kivity <avi@qumranet.com>
Sun, 20 Jul 2008 09:40:47 +0000 (12:40 +0300)
This patch moves the trace entry for APIC accesses from the VMX code to the
generic lapic code. This way APIC accesses from SVM will also be traced.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/lapic.c
arch/x86/kvm/vmx.c

index ebc03f5ae162e2702974c122e27a580fa6556ac2..f9201fbc61d1fcbedfedd33608e9da5aed861141 100644 (file)
@@ -572,6 +572,8 @@ static u32 __apic_read(struct kvm_lapic *apic, unsigned int offset)
 {
        u32 val = 0;
 
+       KVMTRACE_1D(APIC_ACCESS, apic->vcpu, (u32)offset, handler);
+
        if (offset >= LAPIC_MMIO_LENGTH)
                return 0;
 
@@ -695,6 +697,8 @@ static void apic_mmio_write(struct kvm_io_device *this,
 
        offset &= 0xff0;
 
+       KVMTRACE_1D(APIC_ACCESS, apic->vcpu, (u32)offset, handler);
+
        switch (offset) {
        case APIC_ID:           /* Local APIC ID */
                apic_set_reg(apic, APIC_ID, val);
index 39739305980079e8ea86edac49843ea82be37e73..8c951d3eab3090a7526b4f1c756f6d51ddabb538 100644 (file)
@@ -2554,8 +2554,6 @@ static int handle_apic_access(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
        exit_qualification = vmcs_read64(EXIT_QUALIFICATION);
        offset = exit_qualification & 0xffful;
 
-       KVMTRACE_1D(APIC_ACCESS, vcpu, (u32)offset, handler);
-
        er = emulate_instruction(vcpu, kvm_run, 0, 0, 0);
 
        if (er !=  EMULATE_DONE) {