diff options
author | Igor Druzhinin <igor.druzhinin@citrix.com> | 2017-07-10 23:40:03 +0100 |
---|---|---|
committer | Stefano Stabellini <sstabellini@kernel.org> | 2017-07-18 14:16:52 -0700 |
commit | 331b5189d756d431b1d18ae7097527ba3d3ea809 (patch) | |
tree | a891dc3006d2241e326b5b541a3538374d2f19ec /hw/i386/xen/xen-mapcache.c | |
parent | 5ba3d7564593c55292056ef5af84d50b55ebcf0e (diff) |
xen: don't use xenstore to save/restore physmap anymore
If we have a system with xenforeignmemory_map2() implemented
we don't need to save/restore physmap on suspend/restore
anymore. In case we resume a VM without physmap - try to
recreate the physmap during memory region restore phase and
remap map cache entries accordingly. The old code is left
for compatibility reasons.
Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Diffstat (limited to 'hw/i386/xen/xen-mapcache.c')
-rw-r--r-- | hw/i386/xen/xen-mapcache.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c index 56986db706..2a1fbd13cc 100644 --- a/hw/i386/xen/xen-mapcache.c +++ b/hw/i386/xen/xen-mapcache.c @@ -239,7 +239,7 @@ static uint8_t *xen_map_cache_unlocked(hwaddr phys_addr, hwaddr size, hwaddr address_offset; hwaddr cache_size = size; hwaddr test_bit_size; - bool translated = false; + bool translated G_GNUC_UNUSED = false; bool dummy = false; tryagain: @@ -307,11 +307,13 @@ tryagain: test_bit_size >> XC_PAGE_SHIFT, entry->valid_mapping)) { mapcache->last_entry = NULL; +#ifdef XEN_COMPAT_PHYSMAP if (!translated && mapcache->phys_offset_to_gaddr) { phys_addr = mapcache->phys_offset_to_gaddr(phys_addr, size, mapcache->opaque); translated = true; goto tryagain; } +#endif if (!dummy && runstate_check(RUN_STATE_INMIGRATE)) { dummy = true; goto tryagain; |