diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-12-16 20:02:35 -0500 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2011-07-18 18:43:27 -0400 |
commit | 847088079162a5cf8ab0d1ad1ecf7fa60c057246 (patch) | |
tree | d4e3a7a2901bcdc67033b6912694e6f1c2f65f6e /arch/x86/xen/mmu.c | |
parent | c796f213a6934712ede728d9b53ef0e5066db23a (diff) |
xen/trace: add mmu tracepoints
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/xen/mmu.c')
-rw-r--r-- | arch/x86/xen/mmu.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 0ccccb67a993..43fa7771ccb9 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -48,6 +48,8 @@ | |||
48 | #include <linux/memblock.h> | 48 | #include <linux/memblock.h> |
49 | #include <linux/seq_file.h> | 49 | #include <linux/seq_file.h> |
50 | 50 | ||
51 | #include <trace/events/xen.h> | ||
52 | |||
51 | #include <asm/pgtable.h> | 53 | #include <asm/pgtable.h> |
52 | #include <asm/tlbflush.h> | 54 | #include <asm/tlbflush.h> |
53 | #include <asm/fixmap.h> | 55 | #include <asm/fixmap.h> |
@@ -194,6 +196,8 @@ void xen_set_domain_pte(pte_t *ptep, pte_t pteval, unsigned domid) | |||
194 | struct multicall_space mcs; | 196 | struct multicall_space mcs; |
195 | struct mmu_update *u; | 197 | struct mmu_update *u; |
196 | 198 | ||
199 | trace_xen_mmu_set_domain_pte(ptep, pteval, domid); | ||
200 | |||
197 | mcs = xen_mc_entry(sizeof(*u)); | 201 | mcs = xen_mc_entry(sizeof(*u)); |
198 | u = mcs.args; | 202 | u = mcs.args; |
199 | 203 | ||
@@ -245,6 +249,8 @@ static void xen_set_pmd_hyper(pmd_t *ptr, pmd_t val) | |||
245 | 249 | ||
246 | static void xen_set_pmd(pmd_t *ptr, pmd_t val) | 250 | static void xen_set_pmd(pmd_t *ptr, pmd_t val) |
247 | { | 251 | { |
252 | trace_xen_mmu_set_pmd(ptr, val); | ||
253 | |||
248 | /* If page is not pinned, we can just update the entry | 254 | /* If page is not pinned, we can just update the entry |
249 | directly */ | 255 | directly */ |
250 | if (!xen_page_pinned(ptr)) { | 256 | if (!xen_page_pinned(ptr)) { |
@@ -282,22 +288,30 @@ static bool xen_batched_set_pte(pte_t *ptep, pte_t pteval) | |||
282 | return true; | 288 | return true; |
283 | } | 289 | } |
284 | 290 | ||
285 | static void xen_set_pte(pte_t *ptep, pte_t pteval) | 291 | static inline void __xen_set_pte(pte_t *ptep, pte_t pteval) |
286 | { | 292 | { |
287 | if (!xen_batched_set_pte(ptep, pteval)) | 293 | if (!xen_batched_set_pte(ptep, pteval)) |
288 | native_set_pte(ptep, pteval); | 294 | native_set_pte(ptep, pteval); |
289 | } | 295 | } |
290 | 296 | ||
297 | static void xen_set_pte(pte_t *ptep, pte_t pteval) | ||
298 | { | ||
299 | trace_xen_mmu_set_pte(ptep, pteval); | ||
300 | __xen_set_pte(ptep, pteval); | ||
301 | } | ||
302 | |||
291 | static void xen_set_pte_at(struct mm_struct *mm, unsigned long addr, | 303 | static void xen_set_pte_at(struct mm_struct *mm, unsigned long addr, |
292 | pte_t *ptep, pte_t pteval) | 304 | pte_t *ptep, pte_t pteval) |
293 | { | 305 | { |
294 | xen_set_pte(ptep, pteval); | 306 | trace_xen_mmu_set_pte_at(mm, addr, ptep, pteval); |
307 | __xen_set_pte(ptep, pteval); | ||
295 | } | 308 | } |
296 | 309 | ||
297 | pte_t xen_ptep_modify_prot_start(struct mm_struct *mm, | 310 | pte_t xen_ptep_modify_prot_start(struct mm_struct *mm, |
298 | unsigned long addr, pte_t *ptep) | 311 | unsigned long addr, pte_t *ptep) |
299 | { | 312 | { |
300 | /* Just return the pte as-is. We preserve the bits on commit */ | 313 | /* Just return the pte as-is. We preserve the bits on commit */ |
314 | trace_xen_mmu_ptep_modify_prot_start(mm, addr, ptep, *ptep); | ||
301 | return *ptep; | 315 | return *ptep; |
302 | } | 316 | } |
303 | 317 | ||
@@ -306,6 +320,7 @@ void xen_ptep_modify_prot_commit(struct mm_struct *mm, unsigned long addr, | |||
306 | { | 320 | { |
307 | struct mmu_update u; | 321 | struct mmu_update u; |
308 | 322 | ||
323 | trace_xen_mmu_ptep_modify_prot_commit(mm, addr, ptep, pte); | ||
309 | xen_mc_batch(); | 324 | xen_mc_batch(); |
310 | 325 | ||
311 | u.ptr = virt_to_machine(ptep).maddr | MMU_PT_UPDATE_PRESERVE_AD; | 326 | u.ptr = virt_to_machine(ptep).maddr | MMU_PT_UPDATE_PRESERVE_AD; |
@@ -530,6 +545,8 @@ static void xen_set_pud_hyper(pud_t *ptr, pud_t val) | |||
530 | 545 | ||
531 | static void xen_set_pud(pud_t *ptr, pud_t val) | 546 | static void xen_set_pud(pud_t *ptr, pud_t val) |
532 | { | 547 | { |
548 | trace_xen_mmu_set_pud(ptr, val); | ||
549 | |||
533 | /* If page is not pinned, we can just update the entry | 550 | /* If page is not pinned, we can just update the entry |
534 | directly */ | 551 | directly */ |
535 | if (!xen_page_pinned(ptr)) { | 552 | if (!xen_page_pinned(ptr)) { |
@@ -543,17 +560,20 @@ static void xen_set_pud(pud_t *ptr, pud_t val) | |||
543 | #ifdef CONFIG_X86_PAE | 560 | #ifdef CONFIG_X86_PAE |
544 | static void xen_set_pte_atomic(pte_t *ptep, pte_t pte) | 561 | static void xen_set_pte_atomic(pte_t *ptep, pte_t pte) |
545 | { | 562 | { |
563 | trace_xen_mmu_set_pte_atomic(ptep, pte); | ||
546 | set_64bit((u64 *)ptep, native_pte_val(pte)); | 564 | set_64bit((u64 *)ptep, native_pte_val(pte)); |
547 | } | 565 | } |
548 | 566 | ||
549 | static void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | 567 | static void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) |
550 | { | 568 | { |
569 | trace_xen_mmu_pte_clear(mm, addr, ptep); | ||
551 | if (!xen_batched_set_pte(ptep, native_make_pte(0))) | 570 | if (!xen_batched_set_pte(ptep, native_make_pte(0))) |
552 | native_pte_clear(mm, addr, ptep); | 571 | native_pte_clear(mm, addr, ptep); |
553 | } | 572 | } |
554 | 573 | ||
555 | static void xen_pmd_clear(pmd_t *pmdp) | 574 | static void xen_pmd_clear(pmd_t *pmdp) |
556 | { | 575 | { |
576 | trace_xen_mmu_pmd_clear(pmdp); | ||
557 | set_pmd(pmdp, __pmd(0)); | 577 | set_pmd(pmdp, __pmd(0)); |
558 | } | 578 | } |
559 | #endif /* CONFIG_X86_PAE */ | 579 | #endif /* CONFIG_X86_PAE */ |
@@ -629,6 +649,8 @@ static void xen_set_pgd(pgd_t *ptr, pgd_t val) | |||
629 | { | 649 | { |
630 | pgd_t *user_ptr = xen_get_user_pgd(ptr); | 650 | pgd_t *user_ptr = xen_get_user_pgd(ptr); |
631 | 651 | ||
652 | trace_xen_mmu_set_pgd(ptr, user_ptr, val); | ||
653 | |||
632 | /* If page is not pinned, we can just update the entry | 654 | /* If page is not pinned, we can just update the entry |
633 | directly */ | 655 | directly */ |
634 | if (!xen_page_pinned(ptr)) { | 656 | if (!xen_page_pinned(ptr)) { |