mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: d18627583d
master date: 2017-04-05 16:39:53 +0200
This commit is contained in:
1 parent
7622465448
commit
c4c37506fa
1 file changed
+4
-2
+4
-2
@@ -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)) )
|
||||
@@ -215,7 +216,8 @@ static void populate_physmap(struct memop_args *a)
|
||||
mfn = page_to_mfn(page);
|
||||
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 < (1 << a->extent_order); j++ )
|
||||
set_gpfn_from_mfn(mfn + j, gpfn + j);
|
||||
|
||||