diff options
author | Keir Fraser <keir@xensource.com> | 2007-03-31 12:42:02 +0100 |
---|---|---|
committer | Keir Fraser <keir@xensource.com> | 2007-03-31 12:42:02 +0100 |
commit | 7fd0f937ba5af29fb1cfe7622ff4aea6b4133639 (patch) | |
tree | e4b2b02715b85acc83e69e8f37bcdbd67935883b /linux-2.6-xen-sparse | |
parent | 29f999ff69fea4aa73d3a85c399d78159db876d7 (diff) | |
download | xen-7fd0f937ba5af29fb1cfe7622ff4aea6b4133639.tar.gz xen-7fd0f937ba5af29fb1cfe7622ff4aea6b4133639.tar.bz2 xen-7fd0f937ba5af29fb1cfe7622ff4aea6b4133639.zip |
linux: Add a hook before a page table entry is cleared, for use with
the grant-table device.
Signed-off-by: Derek Murray <Derek.Murray@cl.cam.ac.uk>
Diffstat (limited to 'linux-2.6-xen-sparse')
-rw-r--r-- | linux-2.6-xen-sparse/include/linux/mm.h | 5 | ||||
-rw-r--r-- | linux-2.6-xen-sparse/mm/memory.c | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/linux-2.6-xen-sparse/include/linux/mm.h b/linux-2.6-xen-sparse/include/linux/mm.h index 1368b8450a..19654229cc 100644 --- a/linux-2.6-xen-sparse/include/linux/mm.h +++ b/linux-2.6-xen-sparse/include/linux/mm.h @@ -205,6 +205,11 @@ struct vm_operations_struct { /* notification that a previously read-only page is about to become * writable, if an error is returned it will cause a SIGBUS */ int (*page_mkwrite)(struct vm_area_struct *vma, struct page *page); + /* Area-specific function for clearing the PTE at @ptep. Returns the + * original value of @ptep. */ + pte_t (*ptep_get_and_clear_full)(struct vm_area_struct *vma, + unsigned long addr, pte_t *ptep, + int is_fullmm); #ifdef CONFIG_NUMA int (*set_policy)(struct vm_area_struct *vma, struct mempolicy *new); struct mempolicy *(*get_policy)(struct vm_area_struct *vma, diff --git a/linux-2.6-xen-sparse/mm/memory.c b/linux-2.6-xen-sparse/mm/memory.c index f55ed7dedc..4af5beccaa 100644 --- a/linux-2.6-xen-sparse/mm/memory.c +++ b/linux-2.6-xen-sparse/mm/memory.c @@ -659,8 +659,15 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, page->index > details->last_index)) continue; } - ptent = ptep_get_and_clear_full(mm, addr, pte, - tlb->fullmm); + if (unlikely(vma->vm_ops && + vma->vm_ops->ptep_get_and_clear_full)) + ptent = vma->vm_ops-> + ptep_get_and_clear_full(vma, addr, + pte, + tlb->fullmm); + else + ptent = ptep_get_and_clear_full(mm, addr, pte, + tlb->fullmm); tlb_remove_tlb_entry(tlb, pte, addr); if (unlikely(!page)) continue; @@ -755,6 +762,7 @@ static unsigned long unmap_page_range(struct mmu_gather *tlb, details = NULL; BUG_ON(addr >= end); + tlb_start_vma(tlb, vma); pgd = pgd_offset(vma->vm_mm, addr); do { |