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] Add some sanity check when creating 3-level 1:1 page tab

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Add some sanity check when creating 3-level 1:1 page table
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Sep 2005 13:38:11 +0000
Delivery-date: Wed, 14 Sep 2005 13:36:41 +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 5e943af66571bd9361b8865a2c9718b1098fe3fb
# Parent  1cdc469bf78d8807a4b11737b851986b860fc179
Add some sanity check when creating 3-level 1:1 page table
in VMX domain builder.
 - Add check for empty l2e page entry.
 - Add check for failed vl1tab map.

Signed-off-by: Yunhong Jiang <yunhong.jiang@xxxxxxxxx>
Signed-off-by: Asit Mallick <asit.k.mallick@xxxxxxxxx>

diff -r 1cdc469bf78d -r 5e943af66571 tools/libxc/xc_vmx_build.c
--- a/tools/libxc/xc_vmx_build.c        Wed Sep 14 13:28:45 2005
+++ b/tools/libxc/xc_vmx_build.c        Wed Sep 14 13:34:14 2005
@@ -169,21 +169,35 @@
    l2_pgentry_t *vl2tab;
  
    mmio_addr = mmio_range_start & PAGE_MASK;
-   for (; mmio_addr < mmio_range_end; mmio_addr += PAGE_SIZE) {
+   for ( ; mmio_addr < mmio_range_end; mmio_addr += PAGE_SIZE )
+   {
        vl3e = vl3tab[l3_table_offset(mmio_addr)];
-       if (vl3e == 0)
+       if ( vl3e == 0 )
            continue;
-       vl2tab = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
-               PROT_READ|PROT_WRITE, vl3e >> PAGE_SHIFT);
-       if (vl2tab == 0) {
+
+       vl2tab = xc_map_foreign_range(
+           xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, vl3e>>PAGE_SHIFT);
+       if ( vl2tab == NULL )
+       {
            PERROR("Failed zap MMIO range");
            return -1;
        }
+
        vl2e = vl2tab[l2_table_offset(mmio_addr)];
-       if (vl2e == 0)
+       if ( vl2e == 0 )
+       {
+           munmap(vl2tab, PAGE_SIZE);
            continue;
-       vl1tab = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
-               PROT_READ|PROT_WRITE, vl2e >> PAGE_SHIFT);
+       }
+
+       vl1tab = xc_map_foreign_range(
+           xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, vl2e>>PAGE_SHIFT);
+       if ( vl1tab == NULL )
+       {
+           PERROR("Failed zap MMIO range");
+           munmap(vl2tab, PAGE_SIZE);
+           return -1;
+       }
 
        vl1tab[l1_table_offset(mmio_addr)] = 0;
        munmap(vl2tab, PAGE_SIZE);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Add some sanity check when creating 3-level 1:1 page table, Xen patchbot -unstable <=