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-changelog

[Xen-changelog] [linux-2.6.18-xen] Refactor grant table allocation into

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] Refactor grant table allocation into arch-specific code.
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 06 Jul 2007 12:31:33 -0700
Delivery-date: Fri, 06 Jul 2007 12:29:51 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1183739583 -3600
# Node ID 22c388bfd719d291482f81859e12f29aefc96a98
# Parent  4a08141e62ca189577041d8854bb478e5fbe502f
Refactor grant table allocation into arch-specific code.
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>
---
 arch/ia64/xen/hypervisor.c |    5 +++++
 drivers/xen/core/gnttab.c  |   31 +++++++++++++++++--------------
 include/xen/gnttab.h       |    2 ++
 3 files changed, 24 insertions(+), 14 deletions(-)

diff -r 4a08141e62ca -r 22c388bfd719 arch/ia64/xen/hypervisor.c
--- a/arch/ia64/xen/hypervisor.c        Fri Jul 06 14:32:59 2007 +0100
+++ b/arch/ia64/xen/hypervisor.c        Fri Jul 06 17:33:03 2007 +0100
@@ -408,6 +408,11 @@ __xen_destroy_contiguous_region(unsigned
 #include <linux/mm.h>
 #include <xen/interface/xen.h>
 #include <xen/gnttab.h>
+
+void *arch_gnttab_alloc_shared(unsigned long *frames)
+{
+       return __va(frames[0] << PAGE_SHIFT);
+}
 
 static void
 gnttab_map_grant_ref_pre(struct gnttab_map_grant_ref *uop)
diff -r 4a08141e62ca -r 22c388bfd719 drivers/xen/core/gnttab.c
--- a/drivers/xen/core/gnttab.c Fri Jul 06 14:32:59 2007 +0100
+++ b/drivers/xen/core/gnttab.c Fri Jul 06 17:33:03 2007 +0100
@@ -430,7 +430,7 @@ static inline unsigned int max_nr_grant_
 
 #ifdef CONFIG_XEN
 
-#ifndef __ia64__
+#ifdef CONFIG_X86
 static int map_pte_fn(pte_t *pte, struct page *pmd_page,
                      unsigned long addr, void *data)
 {
@@ -448,7 +448,15 @@ static int unmap_pte_fn(pte_t *pte, stru
        set_pte_at(&init_mm, addr, pte, __pte(0));
        return 0;
 }
-#endif
+
+void *arch_gnttab_alloc_shared(unsigned long *frames)
+{
+       struct vm_struct *area;
+       area = alloc_vm_area(PAGE_SIZE * max_nr_grant_frames());
+       BUG_ON(area == NULL);
+       return area->addr;
+}
+#endif /* CONFIG_X86 */
 
 static int gnttab_map(unsigned int start_idx, unsigned int end_idx)
 {
@@ -473,21 +481,16 @@ static int gnttab_map(unsigned int start
 
        BUG_ON(rc || setup.status);
 
-#ifndef __ia64__
-       if (shared == NULL) {
-               struct vm_struct *area;
-               area = alloc_vm_area(PAGE_SIZE * max_nr_grant_frames());
-               BUG_ON(area == NULL);
-               shared = area->addr;
-       }
+       if (shared == NULL)
+               shared = arch_gnttab_alloc_shared(frames);
+
+#ifdef CONFIG_X86
        rc = apply_to_page_range(&init_mm, (unsigned long)shared,
                                 PAGE_SIZE * nr_gframes,
                                 map_pte_fn, &frames);
        BUG_ON(rc);
-        frames -= nr_gframes; /* adjust after map_pte_fn() */
-#else
-       shared = __va(frames[0] << PAGE_SHIFT);
-#endif
+       frames -= nr_gframes; /* adjust after map_pte_fn() */
+#endif /* CONFIG_X86 */
 
        kfree(frames);
 
@@ -623,7 +626,7 @@ int gnttab_resume(void)
 
 int gnttab_suspend(void)
 {
-#ifndef __ia64__
+#ifdef CONFIG_X86
        apply_to_page_range(&init_mm, (unsigned long)shared,
                            PAGE_SIZE * nr_grant_frames,
                            unmap_pte_fn, NULL);
diff -r 4a08141e62ca -r 22c388bfd719 include/xen/gnttab.h
--- a/include/xen/gnttab.h      Fri Jul 06 14:32:59 2007 +0100
+++ b/include/xen/gnttab.h      Fri Jul 06 17:33:03 2007 +0100
@@ -117,6 +117,8 @@ int gnttab_suspend(void);
 int gnttab_suspend(void);
 int gnttab_resume(void);
 
+void *arch_gnttab_alloc_shared(unsigned long *frames);
+
 static inline void
 gnttab_set_map_op(struct gnttab_map_grant_ref *map, maddr_t addr,
                  uint32_t flags, grant_ref_t ref, domid_t domid)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] Refactor grant table allocation into arch-specific code., Xen patchbot-linux-2.6.18-xen <=