Skip to contentSkip to conversation

PV-GRUB fix

PATCH New Samuel Thibault 1 participant 1 message Jun 20, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PV-GRUB fix

I forgot one hook in the PV-GRUB patch, here is the missing part.

minios: do not systematically free the page under shared info, as the guest booted by PV-GRUB will need it.

extras/mini-os/arch/x86/mm.c +3 -8
diff -r 3da148fb7d9b extras/mini-os/arch/x86/mm.c
@@ -528,18 +528,13 @@
 
 static void clear_bootstrap(void)
 {
-    xen_pfn_t mfns[] = { virt_to_mfn(&shared_info) };
-    int n = sizeof(mfns)/sizeof(*mfns);
     pte_t nullpte = { };
 
     /* Use first page as the CoW zero page */
     memset(&_text, 0, PAGE_SIZE);
-    mfn_zero = pfn_to_mfn((unsigned long) &_text);
-    if (HYPERVISOR_update_va_mapping((unsigned long) &_text, nullpte, UVMF_INVLPG))
-	printk("Unable to unmap first page\n");
-
-    if (free_physical_pages(mfns, n) != n)
-	printk("Unable to free bootstrap pages\n");
+    mfn_zero = virt_to_mfn((unsigned long) &_text);
+    if (HYPERVISOR_update_va_mapping(0, nullpte, UVMF_INVLPG))
+	printk("Unable to unmap NULL page\n");
 }
 
 void arch_init_p2m(unsigned long max_pfn)