summaryrefslogtreecommitdiff
path: root/sysutils/xentools12/patches/patch-aj
blob: 514e8d5d4c7527c21ce7f89659f0694f52d0ad28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$NetBSD: patch-aj,v 1.1 2004/05/08 18:24:00 cl Exp $

--- xc/lib/xc_netbsd_build.c.orig	2004-04-18 04:29:16.000000000 +0200
+++ xc/lib/xc_netbsd_build.c
@@ -157,6 +157,10 @@ static int setup_guestos(int xc_handle,
     if ( (vl2tab = map_pfn(pm_handle, l2tab >> PAGE_SHIFT)) == NULL )
         goto error_out;
     memset(vl2tab, 0, PAGE_SIZE);
+    unmap_pfn(pm_handle, vl2tab);
+    if ( (vl2tab = map_pfn_ro(pm_handle, l2tab >> PAGE_SHIFT)) == NULL )
+        goto error_out;
+    mlock(vl2tab, PAGE_SIZE);
     vl2e = vl2tab + l2_table_offset(*virt_load_addr);
     for ( count = 0; count < tot_pages; count++ )
     {    
@@ -166,6 +170,10 @@ static int setup_guestos(int xc_handle,
             if ( (vl1tab = map_pfn(pm_handle, l1tab >> PAGE_SHIFT)) == NULL )
                 goto error_out;
             memset(vl1tab, 0, PAGE_SIZE);
+            unmap_pfn(pm_handle, vl1tab);
+            if ( (vl1tab = map_pfn_ro(pm_handle, l1tab >> PAGE_SHIFT)) == NULL )
+                goto error_out;
+            mlock(vl1tab, PAGE_SIZE);
             alloc_index--;
   
             vl1e = vl1tab + l1_table_offset(*virt_load_addr +