aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/xen/mmu.c10
-rw-r--r--include/trace/events/xen.h33
2 files changed, 41 insertions, 2 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 43fa7771ccb9..f2160997287e 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1478,8 +1478,11 @@ static void __init xen_release_pmd_init(unsigned long pfn)
1478static void xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn, unsigned level) 1478static void xen_alloc_ptpage(struct mm_struct *mm, unsigned long pfn, unsigned level)
1479{ 1479{
1480 struct page *page = pfn_to_page(pfn); 1480 struct page *page = pfn_to_page(pfn);
1481 int pinned = PagePinned(virt_to_page(mm->pgd));
1482
1483 trace_xen_mmu_alloc_ptpage(mm, pfn, level, pinned);
1481 1484
1482 if (PagePinned(virt_to_page(mm->pgd))) { 1485 if (pinned) {
1483 SetPagePinned(page); 1486 SetPagePinned(page);
1484 1487
1485 if (!PageHighMem(page)) { 1488 if (!PageHighMem(page)) {
@@ -1508,8 +1511,11 @@ static void xen_alloc_pmd(struct mm_struct *mm, unsigned long pfn)
1508static void xen_release_ptpage(unsigned long pfn, unsigned level) 1511static void xen_release_ptpage(unsigned long pfn, unsigned level)
1509{ 1512{
1510 struct page *page = pfn_to_page(pfn); 1513 struct page *page = pfn_to_page(pfn);
1514 bool pinned = PagePinned(page);
1511 1515
1512 if (PagePinned(page)) { 1516 trace_xen_mmu_release_ptpage(pfn, level, pinned);
1517
1518 if (pinned) {
1513 if (!PageHighMem(page)) { 1519 if (!PageHighMem(page)) {
1514 if (level == PT_PTE && USE_SPLIT_PTLOCKS) 1520 if (level == PT_PTE && USE_SPLIT_PTLOCKS)
1515 pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, pfn); 1521 pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, pfn);
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h
index 08089e82f77e..f46fdb4afb89 100644
--- a/include/trace/events/xen.h
+++ b/include/trace/events/xen.h
@@ -347,6 +347,39 @@ TRACE_EVENT(xen_mmu_ptep_modify_prot_commit,
347 (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval) 347 (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval)
348 ); 348 );
349 349
350TRACE_EVENT(xen_mmu_alloc_ptpage,
351 TP_PROTO(struct mm_struct *mm, unsigned long pfn, unsigned level, bool pinned),
352 TP_ARGS(mm, pfn, level, pinned),
353 TP_STRUCT__entry(
354 __field(struct mm_struct *, mm)
355 __field(unsigned long, pfn)
356 __field(unsigned, level)
357 __field(bool, pinned)
358 ),
359 TP_fast_assign(__entry->mm = mm;
360 __entry->pfn = pfn;
361 __entry->level = level;
362 __entry->pinned = pinned),
363 TP_printk("mm %p pfn %lx level %d %spinned",
364 __entry->mm, __entry->pfn, __entry->level,
365 __entry->pinned ? "" : "un")
366 );
367
368TRACE_EVENT(xen_mmu_release_ptpage,
369 TP_PROTO(unsigned long pfn, unsigned level, bool pinned),
370 TP_ARGS(pfn, level, pinned),
371 TP_STRUCT__entry(
372 __field(unsigned long, pfn)
373 __field(unsigned, level)
374 __field(bool, pinned)
375 ),
376 TP_fast_assign(__entry->pfn = pfn;
377 __entry->level = level;
378 __entry->pinned = pinned),
379 TP_printk("pfn %lx level %d %spinned",
380 __entry->pfn, __entry->level,
381 __entry->pinned ? "" : "un")
382 );
350 383
351#endif /* _TRACE_XEN_H */ 384#endif /* _TRACE_XEN_H */
352 385