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

[Xen-devel] [PATCH] PoD: Fix domain build populate-on-demand cache alloc

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] PoD: Fix domain build populate-on-demand cache allocation
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: Mon, 9 Aug 2010 14:18:10 +0100
Cc: george.dunlap@xxxxxxxxxxxxx
Delivery-date: Mon, 09 Aug 2010 06:22:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
Rather than trying to count the number of PoD entries we're putting in, we
simply pass the target # of pages - the vga hole, and let the hypervisor
do the calculation.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

diff -r fe930e1b2ce8 -r c453b237894e tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c        Fri Aug 06 18:35:02 2010 +0100
+++ b/tools/libxc/xc_hvm_build.c        Mon Aug 09 14:18:02 2010 +0100
@@ -123,7 +123,6 @@
     xen_pfn_t *page_array = NULL;
     unsigned long i, nr_pages = (unsigned long)memsize << (20 - PAGE_SHIFT);
     unsigned long target_pages = (unsigned long)target << (20 - PAGE_SHIFT);
-    unsigned long pod_pages = 0;
     unsigned long entry_eip, cur_pages;
     void *hvm_info_page;
     uint32_t *ident_pt;
@@ -237,11 +236,6 @@
             {
                 stat_1gb_pages += done;
                 done <<= SUPERPAGE_1GB_SHIFT;
-                if ( pod_mode && target_pages > cur_pages )
-                {
-                    int d = target_pages - cur_pages;
-                    pod_pages += ( done < d ) ? done : d;
-                }
                 cur_pages += done;
                 count -= done;
             }
@@ -284,11 +278,6 @@
                 {
                     stat_2mb_pages += done;
                     done <<= SUPERPAGE_2MB_SHIFT;
-                    if ( pod_mode && target_pages > cur_pages )
-                    {
-                        int d = target_pages - cur_pages;
-                        pod_pages += ( done < d ) ? done : d;
-                    }
                     cur_pages += done;
                     count -= done;
                 }
@@ -302,15 +291,16 @@
                 xch, dom, count, 0, 0, &page_array[cur_pages]);
             cur_pages += count;
             stat_normal_pages += count;
-            if ( pod_mode )
-                pod_pages -= count;
         }
     }
 
+    /* Subtract 0x20 from target_pages for the VGA "hole".  Xen will
+     * adjust the PoD cache size so that domain tot_pages will be
+     * target_pages - 0x20 after this call. */
     if ( pod_mode )
         rc = xc_domain_memory_set_pod_target(xch,
                                              dom,
-                                             pod_pages,
+                                             target_pages - 0x20,
                                              NULL, NULL, NULL);
 
     if ( rc != 0 )

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

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