]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
xxx clone_mapping should handle vmap range as well
authorWei Liu <wei.liu2@citrix.com>
Tue, 26 Feb 2019 15:32:58 +0000 (15:32 +0000)
committerWei Liu <wei.liu2@citrix.com>
Tue, 26 Feb 2019 15:34:39 +0000 (15:34 +0000)
Because xenheap addresses now come from that range.

This isn't the safest way of coding this. To be absolutely sure there
isn't anything interesting there we will need to split the vmap region
further.

xen/arch/x86/smpboot.c

index e245b42cf75eafc6b340e2dd1697a53d1b45cbca..4df8a7e6451bb0f9a1c5149135d7cd694c8ace37 100644 (file)
@@ -679,7 +679,7 @@ static int clone_mapping(const void *ptr, root_pgentry_t *rpt)
 
     /*
      * Sanity check 'linear'.  We only allow cloning from the Xen virtual
-     * range, and in particular, only from the directmap and .text ranges.
+     * range, and in particular, only from vmap, directmap and .text ranges.
      */
     if ( root_table_offset(linear) > ROOT_PAGETABLE_LAST_XEN_SLOT ||
          root_table_offset(linear) < ROOT_PAGETABLE_FIRST_XEN_SLOT )
@@ -688,7 +688,8 @@ static int clone_mapping(const void *ptr, root_pgentry_t *rpt)
         goto out;
     }
 
-    if ( linear < XEN_VIRT_START ||
+    if ( linear < VMAP_VIRT_START ||
+         (linear >= VMAP_VIRT_END && linear < XEN_VIRT_START) ||
          (linear >= XEN_VIRT_END && linear < DIRECTMAP_VIRT_START) )
     {
         rc = -EINVAL;