[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: [Xen-staging] [xen-unstable] linux: Add a hook before a page table entry is cleared, for use with



   This doesn't work very well for archs that don't define
__HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL as ptep_get_and_clear_full is then
defined as a macro.  I'd suggest a different name to avoid conflicts.
Thanks,

        Alex


On Sat, 2007-03-31 at 13:52 +0100, Xen staging patchbot-unstable wrote:
> # HG changeset patch
> # User Keir Fraser <keir@xxxxxxxxxxxxx>
> # Date 1175341322 -3600
> # Node ID 7180d2e61f926023e24750c53fd4203a71f2a3ae
> # Parent  2de267ba9a76e1358601505e16786969f317aa7d
> 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@xxxxxxxxxxxx>
> ---
>  linux-2.6-xen-sparse/include/linux/mm.h |    5 +++++
>  linux-2.6-xen-sparse/mm/memory.c        |   12 ++++++++++--
>  2 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff -r 2de267ba9a76 -r 7180d2e61f92 linux-2.6-xen-sparse/include/linux/mm.h
> --- a/linux-2.6-xen-sparse/include/linux/mm.h Sat Mar 31 12:26:04 2007 +0100
> +++ b/linux-2.6-xen-sparse/include/linux/mm.h Sat Mar 31 12:42:02 2007 +0100
> @@ -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 -r 2de267ba9a76 -r 7180d2e61f92 linux-2.6-xen-sparse/mm/memory.c
> --- a/linux-2.6-xen-sparse/mm/memory.c        Sat Mar 31 12:26:04 2007 +0100
> +++ b/linux-2.6-xen-sparse/mm/memory.c        Sat Mar 31 12:42:02 2007 +0100
> @@ -659,8 +659,15 @@ static unsigned long zap_pte_range(struc
>                                    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(st
>               details = NULL;
>  
>       BUG_ON(addr >= end);
> +
>       tlb_start_vma(tlb, vma);
>       pgd = pgd_offset(vma->vm_mm, addr);
>       do {
> 
> _______________________________________________
> Xen-staging mailing list
> Xen-staging@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-staging
> 
-- 
Alex Williamson                             HP Open Source & Linux Org.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.