mbox series

[00/12] Support CPUID/MSR data in migration streams

Message ID 20191224151932.6304-1-andrew.cooper3@citrix.com (mailing list archive)
Headers show
Series Support CPUID/MSR data in migration streams | expand

Message

Andrew Cooper Dec. 24, 2019, 3:19 p.m. UTC
As an early christmas present, here is the pumbing work to include CPUID/MSR
data in migration streams.

For bisectability reasons, this is a large amount of plumbing with no overall
change in behaviour.  Switching to use the CPUID/MSR data in the stream is
going to require some careful coordinated changes with libxl, which I haven't
quite managed to get working yet.

However, this subset of the work is now in a position to review.


The first 6 patches are various bits of cleanup.  Patches 7-9 introduce
Migration v3 and the STATIC_DATA_END record.  Patches 10-12 introduce the
X86_{CPUID,MSR}_POLICY records.

~Andrew

Andrew Cooper (12):
  libxc/save: Shrink code volume where possible
  libxc/restore: Introduce functionality to simplify blob handling
  libxc/migration: Rationalise the 'checkpointed' field to 'stream_type'
  libxc/migration: Adjust layout of struct xc_sr_context
  tools/migration: Drop IHDR_VERSION constant from libxc and python
  docs/migration Specify migration v3 and STATIC_DATA_END
  python/migration: Update validation logic to understand a v3 stream
  libxc/restore: Support v3 streams, and cope with v2 compatibilty
  libxc/save: Write a v3 stream
  docs/migration: Specify X86_{CPUID,MSR}_POLICY records
  libxc/restore: Handle X86_{CPUID,MSR}_DATA records
  libxc/save: Write X86_{CPUID,MSR}_DATA records

 docs/specs/libxc-migration-stream.pandoc   |  81 +++++++-
 tools/libxc/include/xenguest.h             |  15 +-
 tools/libxc/xc_nomigrate.c                 |   4 +-
 tools/libxc/xc_sr_common.c                 |   3 +
 tools/libxc/xc_sr_common.h                 | 205 ++++++++++++-------
 tools/libxc/xc_sr_common_x86.c             |  97 +++++++++
 tools/libxc/xc_sr_common_x86.h             |  25 +++
 tools/libxc/xc_sr_common_x86_pv.c          |  50 ++---
 tools/libxc/xc_sr_common_x86_pv.h          |   4 +-
 tools/libxc/xc_sr_restore.c                |  82 ++++++--
 tools/libxc/xc_sr_restore_x86_hvm.c        |  35 ++--
 tools/libxc/xc_sr_restore_x86_pv.c         | 316 +++++++++++++++--------------
 tools/libxc/xc_sr_save.c                   |  65 +++---
 tools/libxc/xc_sr_save_x86_hvm.c           |  31 +--
 tools/libxc/xc_sr_save_x86_pv.c            | 225 +++++++++-----------
 tools/libxc/xc_sr_stream_format.h          |   4 +-
 tools/libxl/libxl_save_helper.c            |   4 +-
 tools/python/scripts/convert-legacy-stream |  13 +-
 tools/python/scripts/verify-stream-v2      |   2 +-
 tools/python/xen/migration/libxc.py        |  74 ++++++-
 20 files changed, 854 insertions(+), 481 deletions(-)

Comments

Andrew Cooper Jan. 3, 2020, 1:06 p.m. UTC | #1
This is the incremental work to "Support CPUID/MSR data in migration streams"
which juggles libxl sufficiently to allow us to use the data sent in migration
streams.

The two patches:
  tools/libxl: Code-gen improvements for libxl_save_msgs_gen.pl
  tools/libxl: Reposition build_pre() logic between architectures

posted independently are logically patches 13/14 of the series, and these six
make it up to 20.

Future versions of the series, if necessary, will post them all togther.

Andrew Cooper (6):
  fixup tools/migration: Formatting and style cleanup
  tools/libxl: Simplify callback handling in libxl-save-helper
  tools/libx[cl]: Plumb static_data_done() up into libxl
  tools/libxl: Plumb domain_create_state down into libxl__build_pre()
  tools/libxl: Re-position CPUID handling during domain construction
  tools/libxc: Restore CPUID/MSR data found in the migration stream

 tools/libxc/include/xenguest.h     | 44 +++++++++++++++++++++++-------------
 tools/libxc/xc_sr_common_x86.c     | 35 +++++++++++++++++++++++++++--
 tools/libxc/xc_sr_restore.c        |  1 +
 tools/libxc/xc_sr_save.c           |  8 +++----
 tools/libxl/libxl_create.c         | 46 +++++++++++++++++++++++++++++++-------
 tools/libxl/libxl_dm.c             |  5 +++--
 tools/libxl/libxl_dom.c            | 16 ++++++++-----
 tools/libxl/libxl_internal.h       | 11 ++++-----
 tools/libxl/libxl_save_helper.c    | 15 +++++--------
 tools/libxl/libxl_save_msgs_gen.pl |  3 ++-
 10 files changed, 130 insertions(+), 54 deletions(-)