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

[Xen-changelog] [xen stable-4.7] memory: don't hand MFN info to translated guests



commit 16f34b7a1903da359c013bd0fb1b80218434f3a1
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed May 3 17:11:33 2017 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed May 3 17:11:33 2017 +0200

    memory: don't hand MFN info to translated guests
    
    We shouldn't hand MFN info back from increase-reservation for
    translated domains, just like we don't for populate-physmap and
    memory-exchange. For full symmetry also check for a NULL guest handle
    in populate_physmap() (but note this makes no sense in
    memory_exchange(), as there the array is also an input).
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    master commit: d18627583df28facd9af473ea1ac4a56e93e6ea9
    master date: 2017-04-05 16:39:53 +0200
---
 xen/common/memory.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 301fb72..e7e1b36 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -123,7 +123,8 @@ static void increase_reservation(struct memop_args *a)
         }
 
         /* Inform the domain of the new page's machine address. */ 
-        if ( !guest_handle_is_null(a->extent_list) )
+        if ( !paging_mode_translate(d) &&
+             !guest_handle_is_null(a->extent_list) )
         {
             mfn = page_to_mfn(page);
             if ( unlikely(__copy_to_guest_offset(a->extent_list, i, &mfn, 1)) )
@@ -219,7 +220,8 @@ static void populate_physmap(struct memop_args *a)
 
             guest_physmap_add_page(d, gpfn, mfn, a->extent_order);
 
-            if ( !paging_mode_translate(d) )
+            if ( !paging_mode_translate(d) &&
+                 !guest_handle_is_null(a->extent_list) )
             {
                 for ( j = 0; j < (1U << a->extent_order); j++ )
                     set_gpfn_from_mfn(mfn + j, gpfn + j);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.7

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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