x86: cpu -- Rework feature testing

Submitted by Cyrill Gorcunov on Aug. 7, 2018, 4:35 p.m.

Details

Reviewer None
Submitted Aug. 7, 2018, 4:35 p.m.
Last Updated Aug. 30, 2018, 10:12 p.m.
Revision 2

Cover Letter

- Make --cpu-cap options being explicitly bitmask based
 - Save xsave frame sizes into image
 - Require xsave frames to exactly match when testing

All this needed to detect a situation where container is migrated
from one machine to another where xsave frames have different size.
We already hit the problem where application (for example libc) calls
for xsave directly and when destination machine is more powerful the
new bigger size of the frame may override the memory causing programs
to misbehave.

v2:
 - Make instruction capability mode to be set by default

Cyrill Gorcunov (12):
  x86: cpu -- Save xsave frame sizes in image
  x86: cpu -- Make cpu_dump_cpuinfo more readable
  x86: cpu -- Use bitwise operator for option check
  x86: cpu -- Move xsave testing into fpu capability block
  x86: cpu -- Move strict capability mode into own block
  x86: cpu -- Use special bit for image manipulation
  x86: cpu -- Update default cpu-cap option
  x86: cpu -- Add more detailed mode description
  x86: cpu -- Drop no longer needed early exit from cpu_validate_features
  x86: cpu -- Don't exit early if --cpu-cap=ins specified
  x86: cpu -- Use native uint_x types
  x86: cpu -- Require compatibility on instruction level by default

 Documentation/criu.txt    |  14 +++--
 criu/arch/x86/cpu.c       | 106 ++++++++++++++++++++++++--------------
 criu/config.c             |   4 ++
 criu/cr-dump.c            |   2 +-
 criu/cr-restore.c         |   2 +-
 criu/cr-service.c         |   4 +-
 criu/include/cr_options.h |  13 ++---
 images/cpuinfo.proto      |   2 +
 8 files changed, 97 insertions(+), 50 deletions(-)
  

Revisions