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]about the super page support with EPT

To: "Keir Fraser" <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel]about the super page support with EPT
From: "Xin, Xiaohui" <xiaohui.xin@xxxxxxxxx>
Date: Tue, 20 May 2008 16:27:25 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 20 May 2008 01:33:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aci6U1T79Ml0ZnacQziUOSNI7fKrtQ==
Thread-topic: [Xen-devel]about the super page support with EPT

Hi, Keir,


The recent super page support patch checked in met some problem when EPT was enabled. The patch lost some code during checking in.

From our experience, in EPT enabled situation, we has to split the last 2M of the guest memory to 4k pages instead of 2M contiguous, the reason is that, in tools side, 5 special pages are located in guest high end memory, and the guard page will be decreased then. It will result to set the p2m entry with order 0 to be invalid, in normal logic, this will result to set the whole 2m p2m entry with order 9 to be invalid, then all the other 4k pages in the last 2M cannot be accessed. The end result is that we will get “Bad address” error when we create guest with EPT.

 

Following is the patch we handle it, please comments.

 

diff -r af77354c03e4 tools/libxc/xc_hvm_build.c

--- a/tools/libxc/xc_hvm_build.c  Tue May 20 22:37:05 2008 +0800

+++ b/tools/libxc/xc_hvm_build.c          Wed May 21 00:05:15 2008 +0800

@@ -220,10 +220,10 @@ static int setup_guest(int xc_handle,

     rc = xc_domain_memory_populate_physmap(

         xc_handle, dom, 0xa0, 0, 0, &page_array[0x00]);

     cur_pages = 0xc0;

-    while ( (rc == 0) && (nr_pages > cur_pages) )

+    while ( (rc == 0) && (nr_pages - 0x200 > cur_pages) )

     {

         /* Clip count to maximum 8MB extent. */

-        unsigned long count = nr_pages - cur_pages;

+        unsigned long count = nr_pages - 0x200 - cur_pages;

         if ( count > 2048 )

             count = 2048;

 

@@ -266,6 +266,12 @@ static int setup_guest(int xc_handle,

         }

     }

 

+    if ( nr_pages - cur_pages )

+    {

+        rc = xc_domain_memory_populate_physmap(

+                xc_handle, dom, nr_pages - cur_pages, 0, 0, &page_array[cur_pages]);

+    }

+

     if ( rc != 0 )

     {

         PERROR("Could not allocate memory for HVM guest.\n");

 

 

Thanks

Xiaohui

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>