WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 3/6] grantable and address conversion patches

To: yamahata@xxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH 3/6] grantable and address conversion patches
From: Hirokazu Takahashi <taka@xxxxxxxxxxxxx>
Date: Mon, 10 Apr 2006 17:50:50 +0900 (JST)
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 10 Apr 2006 01:54:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20060410083544.GF27482%yamahata@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20060410083544.GF27482%yamahata@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

Do you have any problems if you make all architectures use
this approach? It would be better to use the same approach.


> # HG changeset patch
> # User yamahata@xxxxxxxxxxxxx
> # Node ID f490d7d1ecce78acc40dda7644e59e7840c68ef4
> # Parent  3434966aa3d1aca4c6f04323c9d2e900a1084417
> PageForeign() uses PG_arch_1. However Linux/ia64, Linux/ppc already use
> the flag for their own purpose. So the flag can't be used.
> This patch is a work around for it.
> PATCHNAME: foreign_page_dont_use_pg_arch_1
> 
> Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
> 
> diff -r 3434966aa3d1 -r f490d7d1ecce 
> linux-2.6-xen-sparse/include/xen/foreign_page.h
> --- a/linux-2.6-xen-sparse/include/xen/foreign_page.h Mon Apr 10 16:39:12 
> 2006 +0900
> +++ b/linux-2.6-xen-sparse/include/xen/foreign_page.h Mon Apr 10 16:39:49 
> 2006 +0900
> @@ -5,10 +5,39 @@
>   * not the normal buddy allocator in page_alloc.c
>   * 
>   * Copyright (c) 2004, K A Fraser
> + *
> + * CONFIG_ARCH_USES_PG_ARCH_1_FOR_OTHER_PURPOSE work around
> + * Copyright (c) 2006 Isaku Yamahata
> + *                    VA Linux Systems Japan K.K.
>   */
>  
>  #ifndef __ASM_XEN_FOREIGN_PAGE_H__
>  #define __ASM_XEN_FOREIGN_PAGE_H__
> +
> +#ifdef CONFIG_ARCH_USES_PG_ARCH_1_FOR_OTHER_PURPOSE
> +
> +// Linux/ia64 and Linux/PPC use PG_arch_1 for their own purpose.
> +// PG_arch_1 can't be used.
> +extern struct address_space xen_foreign_dummy_mapping;
> +#define PageForeign(page)                            \
> +     ((page)->mapping == &xen_foreign_dummy_mapping)
> +
> +#define SetPageForeign(page, dtor)                                   \
> +     do {                                                            \
> +             set_page_private((page), (unsigned long)(dtor));        \
> +             (page)->mapping = &xen_foreign_dummy_mapping;           \
> +     } while (0)
> +
> +#define ClearPageForeign(page)                       \
> +     do {                                    \
> +             (page)->mapping = NULL;         \
> +             set_page_private((page), 0);    \
> +     } while (0)
> +
> +#define PageForeignDestructor(page)                          \
> +     ( (void (*) (struct page *)) page_private(page) )
> +
> +#else
>  
>  #define PG_foreign           PG_arch_1
>  
> @@ -27,6 +56,8 @@
>  #define PageForeignDestructor(page)  \
>       ( (void (*) (struct page *)) (page)->mapping )
>  
> +#endif
> +
>  #endif /* __ASM_XEN_FOREIGN_PAGE_H__ */
>  
>  /*
> diff -r 3434966aa3d1 -r f490d7d1ecce linux-2.6-xen-sparse/mm/page_alloc.c
> --- a/linux-2.6-xen-sparse/mm/page_alloc.c    Mon Apr 10 16:39:12 2006 +0900
> +++ b/linux-2.6-xen-sparse/mm/page_alloc.c    Mon Apr 10 16:39:49 2006 +0900
> @@ -85,6 +85,10 @@ int min_free_kbytes = 1024;
>  
>  unsigned long __initdata nr_kernel_pages;
>  unsigned long __initdata nr_all_pages;
> +
> +#ifdef CONFIG_ARCH_USES_PG_ARCH_1_FOR_OTHER_PURPOSE
> +struct address_space xen_foreign_dummy_mapping;
> +#endif
>  
>  #ifdef CONFIG_DEBUG_VM
>  static int page_outside_zone_boundaries(struct zone *zone, struct page *page)

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

<Prev in Thread] Current Thread [Next in Thread>