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] Xen1.2 NetBSD port snapshot available and set_gdt patch for

To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Xen1.2 NetBSD port snapshot available and set_gdt patch for Xen1.2
From: Christian Limpach <chris@xxxxxx>
Date: Tue, 3 Feb 2004 02:57:59 +0100
Delivery-date: Tue, 03 Feb 2004 02:18:49 +0000
Envelope-to: steven.hand@xxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
Hi!

I've updated the NetBSD port to Xen1.2.  Updated files are available at
http://lola.pin.lu/netbsd/xen/

See http://lola.pin.lu/netbsd/xen/readme-040203 for details.  Domain
creation is now possible using the xc_dom_*.py tools.

I've also found a bug in Xen1.2 and to run NetBSD you'll have to apply a
patch until this is fixed in the repository.  set_gdt() copies Xen's GDT
entries to the wrong page, this instantly kills the hypervisor when the
new GDT is activated.  Also the check for new GDT pages does always check
the first GDT page, which allows installing arbitrary GDT entries.

--- ../../xeno-1.2.bk/xen/arch/i386/mm.c        2004-01-21 14:57:32.000000000 
+0100
+++ xen/arch/i386/mm.c  2004-02-02 21:35:35.000000000 +0100
@@ -238,7 +238,7 @@ long set_gdt(struct task_struct *p, 
                 goto out;
 
             /* Check all potential GDT entries in the page. */
-            gdt_page = map_domain_mem(frames[0] << PAGE_SHIFT);
+            gdt_page = map_domain_mem(frames[i] << PAGE_SHIFT);
             for ( j = 0; j < 512; j++ )
                 if ( !check_descriptor(gdt_page[j*2], gdt_page[j*2+1]) )
                     goto out;
@@ -274,7 +274,7 @@ long set_gdt(struct task_struct *p, 
     }
 
     /* Copy reserved GDT entries to the new GDT. */
-    vgdt = map_domain_mem(frames[i] << PAGE_SHIFT);
+    vgdt = map_domain_mem(frames[0] << PAGE_SHIFT);
     memcpy(vgdt + FIRST_RESERVED_GDT_ENTRY, 
            gdt_table + FIRST_RESERVED_GDT_ENTRY, 
            NR_RESERVED_GDT_ENTRIES*8);
-- 
Christian Limpach <chris@xxxxxx>