diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-06-13 10:13:25 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-06-13 10:13:25 +0100 |
commit | a1d529a86b53d87fce96910ecb9009680007886d (patch) | |
tree | 8f945376f69d386e5c348a70e5b4cb37046a0bb1 /tools/libxc | |
parent | 4565fb811d5eeaed34c870ec193050ed45ea6aeb (diff) | |
download | xen-a1d529a86b53d87fce96910ecb9009680007886d.tar.gz xen-a1d529a86b53d87fce96910ecb9009680007886d.tar.bz2 xen-a1d529a86b53d87fce96910ecb9009680007886d.zip |
hvm: Fix the realmode live migration issue with Intel EPT
The patch save/restore the HVM_PARAM_IDENT_PT parameter, then the live
migration during real mode with EPT may work fine.
Signed-off-by: Xiaohui Xin <Xiaohui.xin@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'tools/libxc')
-rw-r--r-- | tools/libxc/xc_domain_restore.c | 16 | ||||
-rw-r--r-- | tools/libxc/xc_domain_save.c | 19 |
2 files changed, 35 insertions, 0 deletions
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c index b7b74352e1..46859f63cf 100644 --- a/tools/libxc/xc_domain_restore.c +++ b/tools/libxc/xc_domain_restore.c @@ -474,6 +474,22 @@ int xc_domain_restore(int xc_handle, int io_fd, uint32_t dom, continue; } + if ( j == -3 ) + { + uint64_t ident_pt; + + /* Skip padding 4 bytes then read the EPT identity PT location. */ + if ( read_exact(io_fd, &ident_pt, sizeof(uint32_t)) || + read_exact(io_fd, &ident_pt, sizeof(uint64_t)) ) + { + ERROR("error read the address of the EPT identity map"); + goto out; + } + + xc_set_hvm_param(xc_handle, dom, HVM_PARAM_IDENT_PT, ident_pt); + continue; + } + if ( j == 0 ) break; /* our work here is done */ diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c index 636bb78e7f..7b8a1317a4 100644 --- a/tools/libxc/xc_domain_save.c +++ b/tools/libxc/xc_domain_save.c @@ -1429,6 +1429,25 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters, } } + if ( hvm ) + { + struct { + int minusthree; + uint32_t pad; + uint64_t ident_pt; + } chunk = { -3, 0 }; + + xc_get_hvm_param(xc_handle, dom, HVM_PARAM_IDENT_PT, + (unsigned long *)&chunk.ident_pt); + + if ( (chunk.ident_pt != 0) && + write_exact(io_fd, &chunk, sizeof(chunk)) ) + { + PERROR("Error when writing the ident_pt for EPT guest"); + goto out; + } + } + /* Zero terminate */ i = 0; if ( write_exact(io_fd, &i, sizeof(int)) ) |