[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Xen1.2 NetBSD port snapshot available and set_gdt patch for Xen1.2


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
  • From: Christian Limpach <chris@xxxxxx>
  • Date: Tue, 3 Feb 2004 02:57:59 +0100
  • Delivery-date: Tue, 03 Feb 2004 02:18:49 +0000
  • List-id: List for Xen developers <xen-devel.lists.sourceforge.net>

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>

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.