aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-12-31 05:10:16 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 10:36:09 -0500
commit90bb6fc556ab255abd798bcf4ff5769690ab2eea (patch)
treedd17338dbcb5a2963800639bcf097595861810d2 /arch
parent43db669730743fcc2a74b641ff4d77781eb15bfa (diff)
KVM: MMU: Add tracepoint for guest page aging
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/mmu.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index b8da6715d08b..739793240d1d 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -151,6 +151,9 @@ module_param(oos_shadow, bool, 0644);
151#define ACC_USER_MASK PT_USER_MASK 151#define ACC_USER_MASK PT_USER_MASK
152#define ACC_ALL (ACC_EXEC_MASK | ACC_WRITE_MASK | ACC_USER_MASK) 152#define ACC_ALL (ACC_EXEC_MASK | ACC_WRITE_MASK | ACC_USER_MASK)
153 153
154#include <trace/events/kvm.h>
155
156#undef TRACE_INCLUDE_FILE
154#define CREATE_TRACE_POINTS 157#define CREATE_TRACE_POINTS
155#include "mmutrace.h" 158#include "mmutrace.h"
156 159
@@ -792,6 +795,7 @@ static int kvm_handle_hva(struct kvm *kvm, unsigned long hva,
792 unsigned long data)) 795 unsigned long data))
793{ 796{
794 int i, j; 797 int i, j;
798 int ret;
795 int retval = 0; 799 int retval = 0;
796 struct kvm_memslots *slots; 800 struct kvm_memslots *slots;
797 801
@@ -806,16 +810,17 @@ static int kvm_handle_hva(struct kvm *kvm, unsigned long hva,
806 if (hva >= start && hva < end) { 810 if (hva >= start && hva < end) {
807 gfn_t gfn_offset = (hva - start) >> PAGE_SHIFT; 811 gfn_t gfn_offset = (hva - start) >> PAGE_SHIFT;
808 812
809 retval |= handler(kvm, &memslot->rmap[gfn_offset], 813 ret = handler(kvm, &memslot->rmap[gfn_offset], data);
810 data);
811 814
812 for (j = 0; j < KVM_NR_PAGE_SIZES - 1; ++j) { 815 for (j = 0; j < KVM_NR_PAGE_SIZES - 1; ++j) {
813 int idx = gfn_offset; 816 int idx = gfn_offset;
814 idx /= KVM_PAGES_PER_HPAGE(PT_DIRECTORY_LEVEL + j); 817 idx /= KVM_PAGES_PER_HPAGE(PT_DIRECTORY_LEVEL + j);
815 retval |= handler(kvm, 818 ret |= handler(kvm,
816 &memslot->lpage_info[j][idx].rmap_pde, 819 &memslot->lpage_info[j][idx].rmap_pde,
817 data); 820 data);
818 } 821 }
822 trace_kvm_age_page(hva, memslot, ret);
823 retval |= ret;
819 } 824 }
820 } 825 }
821 826