From 740ae4a360c6e91cd1640a21486eb884cb58f3cf Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Wed, 3 Oct 2018 14:54:11 +0300 Subject: [PATCH] x86: cpu -- Don't fail if member is not present in image When migrating from old images the particular xsave member might not be present in core-* image, which is fine we simply left data as initial zero state. https://jira.sw.ru/browse/PSBM-89215 Signed-off-by: Cyrill Gorcunov Signed-off-by: Andrei Vagin --- criu/arch/x86/crtools.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/criu/arch/x86/crtools.c b/criu/arch/x86/crtools.c index 185ade407..ee016da00 100644 --- a/criu/arch/x86/crtools.c +++ b/criu/arch/x86/crtools.c @@ -438,9 +438,14 @@ int restore_fpu(struct rt_sigframe *sigframe, CoreEntry *core) size_t size = pb_repeated_size(xsave, member); \ size_t xsize = (size_t)compel_fpu_feature_size(feature); \ if (xsize != size) { \ - pr_err("%s reported %zu bytes (expecting %zu)\n", \ - # feature, xsize, size); \ - return -1; \ + if (size) { \ + pr_err("%s reported %zu bytes (expecting %zu)\n",\ + # feature, xsize, size); \ + return -1; \ + } else { \ + pr_debug("%s is not present in image, ignore\n",\ + # feature); \ + } \ } \ xstate_bv |= (1UL << feature); \ xstate_size += xsize; \