ia64/xen-unstable

changeset 17855:cb514522dab2

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>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 13 10:13:25 2008 +0100 (2008-06-13)
parents 02b6977de4b5
children 833ec967857c
files tools/libxc/xc_domain_restore.c tools/libxc/xc_domain_save.c
line diff
     1.1 --- a/tools/libxc/xc_domain_restore.c	Fri Jun 13 09:56:49 2008 +0100
     1.2 +++ b/tools/libxc/xc_domain_restore.c	Fri Jun 13 10:13:25 2008 +0100
     1.3 @@ -474,6 +474,22 @@ int xc_domain_restore(int xc_handle, int
     1.4              continue;
     1.5          }
     1.6  
     1.7 +        if ( j == -3 )
     1.8 +        {
     1.9 +            uint64_t ident_pt;
    1.10 +
    1.11 +            /* Skip padding 4 bytes then read the EPT identity PT location. */
    1.12 +            if ( read_exact(io_fd, &ident_pt, sizeof(uint32_t)) ||
    1.13 +                 read_exact(io_fd, &ident_pt, sizeof(uint64_t)) )
    1.14 +            {
    1.15 +                ERROR("error read the address of the EPT identity map");
    1.16 +                goto out;
    1.17 +            }
    1.18 +
    1.19 +            xc_set_hvm_param(xc_handle, dom, HVM_PARAM_IDENT_PT, ident_pt);
    1.20 +            continue;
    1.21 +        }
    1.22 +
    1.23          if ( j == 0 )
    1.24              break;  /* our work here is done */
    1.25  
     2.1 --- a/tools/libxc/xc_domain_save.c	Fri Jun 13 09:56:49 2008 +0100
     2.2 +++ b/tools/libxc/xc_domain_save.c	Fri Jun 13 10:13:25 2008 +0100
     2.3 @@ -1429,6 +1429,25 @@ int xc_domain_save(int xc_handle, int io
     2.4          }
     2.5      }
     2.6  
     2.7 +    if ( hvm )
     2.8 +    {
     2.9 +        struct {
    2.10 +            int minusthree;
    2.11 +            uint32_t pad;
    2.12 +            uint64_t ident_pt;
    2.13 +        } chunk = { -3, 0 };
    2.14 +
    2.15 +        xc_get_hvm_param(xc_handle, dom, HVM_PARAM_IDENT_PT,
    2.16 +                         (unsigned long *)&chunk.ident_pt);
    2.17 +
    2.18 +        if ( (chunk.ident_pt != 0) &&
    2.19 +             write_exact(io_fd, &chunk, sizeof(chunk)) )
    2.20 +        {
    2.21 +            PERROR("Error when writing the ident_pt for EPT guest");
    2.22 +            goto out;
    2.23 +        }
    2.24 +    }
    2.25 +
    2.26      /* Zero terminate */
    2.27      i = 0;
    2.28      if ( write_exact(io_fd, &i, sizeof(int)) )