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] Cleanups to tools since HVM domain P2M table and 1-1 tab

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Cleanups to tools since HVM domain P2M table and 1-1 table are built in xen.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 21 Feb 2006 22:06:09 +0000
Delivery-date: Tue, 21 Feb 2006 22:20:42 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID f33e537c4ac52b6c928883e9f143e8669a35a1f1
# Parent  1fd6e9c32b034126128ff4fcd2bb6d209446d146
Cleanups to tools since HVM domain P2M table and 1-1 table are built in xen.

Signed-off-by: Xin Li <xin.b.li@xxxxxxxxx>

diff -r 1fd6e9c32b03 -r f33e537c4ac5 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c        Tue Feb 21 17:21:13 2006
+++ b/tools/libxc/xc_hvm_build.c        Tue Feb 21 17:23:35 2006
@@ -192,11 +192,7 @@
     xc_mmu_t *mmu = NULL;
     int rc;
 
-    unsigned long nr_pt_pages;
-
     struct domain_setup_info dsi;
-    unsigned long vpt_start;
-    unsigned long vpt_end;
     unsigned long v_end;
 
     unsigned long shared_page_frame = 0;
@@ -216,20 +212,10 @@
     /* memsize is in megabytes */
     v_end              = (unsigned long)memsize << 20;
 
-#ifdef __i386__
-    nr_pt_pages = 1 + ((memsize + 3) >> 2);
-#else
-    nr_pt_pages = 5 + ((memsize + 1) >> 1);
-#endif
-    vpt_start   = v_end;
-    vpt_end     = vpt_start + (nr_pt_pages * PAGE_SIZE);
-
     printf("VIRTUAL MEMORY ARRANGEMENT:\n"
            " Loaded HVM loader: %08lx->%08lx\n"
-           " Page tables:   %08lx->%08lx\n"
            " TOTAL:         %08lx->%08lx\n",
            dsi.v_kernstart, dsi.v_kernend,
-           vpt_start, vpt_end,
            dsi.v_start, v_end);
     printf(" ENTRY ADDRESS: %08lx\n", dsi.v_kernentry);
 
diff -r 1fd6e9c32b03 -r f33e537c4ac5 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Tue Feb 21 17:21:13 2006
+++ b/tools/python/xen/xend/image.py    Tue Feb 21 17:23:35 2006
@@ -383,28 +383,12 @@
     def getDomainMemory(self, mem):
         """@see ImageHandler.getDomainMemory"""
         page_kb = 4
+        extra_pages = 0
         if os.uname()[4] == 'ia64':
             page_kb = 16
-        # for ioreq_t and xenstore
-        static_pages = 2
-        return mem + (self.getPageTableSize(mem / 1024) + static_pages) * 
page_kb
-
-    def getPageTableSize(self, mem_mb):
-        """Return the pages of memory needed for 1:1 page tables for physical
-           mode.
-
-        @param mem_mb: size in MB
-        @return size in KB
-        """
-        # 1 page for the PGD + 1 pte page for 4MB of memory (rounded)
-        if os.uname()[4] == 'x86_64':
-            return 5 + ((mem_mb + 1) >> 1)
-        elif os.uname()[4] == 'ia64':
-            # 1:1 pgtable is allocated on demand ia64, so just return rom size
-           # for guest firmware
-            return 1024
-        else:
-            return 1 + ((mem_mb + 3) >> 2)
+            # ROM size for guest firmware
+            extra_pages = 1024
+        return mem + extra_pages * page_kb
 
     def register_shutdown_watch(self):
         """ add xen store watch on control/shutdown """
diff -r 1fd6e9c32b03 -r f33e537c4ac5 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Tue Feb 21 17:21:13 2006
+++ b/xen/arch/x86/domain.c     Tue Feb 21 17:23:35 2006
@@ -398,12 +398,15 @@
     if ( v->vcpu_id == 0 )
         d->vm_assist = c->vm_assist;
 
-    phys_basetab = c->ctrlreg[3];
-    phys_basetab =
-        (gmfn_to_mfn(d, phys_basetab >> PAGE_SHIFT) << PAGE_SHIFT) |
-        (phys_basetab & ~PAGE_MASK);
-
-    v->arch.guest_table = mk_pagetable(phys_basetab);
+    if ( !(c->flags & VGCF_HVM_GUEST) )
+    {
+        phys_basetab = c->ctrlreg[3];
+        phys_basetab =
+            (gmfn_to_mfn(d, phys_basetab >> PAGE_SHIFT) << PAGE_SHIFT) |
+            (phys_basetab & ~PAGE_MASK);
+
+        v->arch.guest_table = mk_pagetable(phys_basetab);
+    }
 
     if ( (rc = (int)set_gdt(v, c->gdt_frames, c->gdt_ents)) != 0 )
         return rc;
@@ -428,9 +431,6 @@
 
     if ( c->flags & VGCF_HVM_GUEST )
     {
-        /* HVM uses the initially provided page tables as the P2M map. */
-        if ( !pagetable_get_paddr(d->arch.phys_table) )
-            d->arch.phys_table = v->arch.guest_table;
         v->arch.guest_table = mk_pagetable(0);
 
         if ( !hvm_initialize_guest_resources(v) )

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Cleanups to tools since HVM domain P2M table and 1-1 table are built in xen., Xen patchbot -unstable <=