[CRIU] [PATCH 00/14] FPU c/r, v5

Cyrill Gorcunov gorcunov at openvz.org
Thu Dec 20 06:55:21 EST 2012


Hi, here is slightly updated version of the FPU c/r series.
The changes from previous series

 - FPU unit is not required anymore to proceed, in case if there
   is no FPU unit at all (have no idea how it could be on x86-64
   but whatever) we simply ignore its c/r

 - redundant zeroifying of xsave frame is dropped out

 - added comment on why we need a __pad in thread_restore_args
   structure

 - a few garbage instructions in show_rt_xsave_frame ripped off

 - the macros for registers copying remained untouched, since
   more general cleanup needed here

The overall idea remains as in previous set

| Here is some review over all things we're doiing to c/r FPU
| state
|
|  - There are two techniques used to fetch FPU stated from the
|    kernel
|
|	- via ptrace PTRACE_GETFPREGS facility, which uses fxsave
|           format for data provided to user-space
|
|         - or via ptrace PTRACE_GETREGSET facility, which uses xsave
|           format for data encoding
|
|    in both cases we decode data and carry it in user_x86_fpregs_entry
|    protobuf entry (which in turn belongs to core@ file)
|
|  - In restore procedure we simply decode data and form fxsave/xsave
|    frame (which kernel understands) and then simply pass it to
|    rt_sys_sigreturn syscall, which does all hard work for us


Cyrill Gorcunov (14):
  fpu: Add fpu.h header
  cpu: Add code to fetch/test cpuinfo data
  cpu: Add testing if host cpu is suitable to FPU c/r
  dump: Drop FPU padding allocation
  dump: Move assign_reg/assign_array closer to place where they are used  checkpoint: Add dumping of FPU state
  restore: Change rt_sigcontext::fpstate to void *
  restore: Reserve space in restorer for FPU frame
  restore: Restore FPU state
  zdtm: Add cpuid.h
  zdtm: Enable fpu00 test-case
  zdtm: Add fpu01 test
  zdtm: Enable fpu01 test
  zdtm: Don't wait too long for restore

 Makefile                       |   1 +
 cpu.c                          |  70 +++++++++++++++++++++
 cr-dump.c                      | 128 +++++++++++++++++++++++++++-----------
 cr-restore.c                   | 138 +++++++++++++++++++++++++++++++++++++++++
 include/cpu.h                  |  23 +++++++
 include/fpu.h                  |  84 +++++++++++++++++++++++++
 include/proc_parse.h           |   1 +
 include/restorer.h             |  13 +++-
 pie/restorer.c                 |  18 ++++++
 proc_parse.c                   |  32 ++++++++++
 protobuf/core.proto            |  12 ++++
 test/zdtm.sh                   |   4 +-
 test/zdtm/lib/cpuid.h          |  39 ++++++++++++
 test/zdtm/live/static/Makefile |   1 +
 test/zdtm/live/static/fpu01.c  | 105 +++++++++++++++++++++++++++++++
 15 files changed, 630 insertions(+), 39 deletions(-)
 create mode 100644 cpu.c
 create mode 100644 include/cpu.h
 create mode 100644 include/fpu.h
 create mode 100644 test/zdtm/lib/cpuid.h
 create mode 100644 test/zdtm/live/static/fpu01.c

-- 
1.8.0.1


More information about the CRIU mailing list