x86/crtools: do not error when YMM is missing

Submitted by Zhang, Ning A on April 16, 2019, 7:45 a.m.

Details

Message ID 20190416074505.27801-1-ning.a.zhang@intel.com
State Accepted
Series "x86/crtools: do not error when YMM is missing"
Commit 5a52e34655636a8f00a664cf42716e1439ea2ef0
Headers show

Commit Message

Zhang, Ning A April 16, 2019, 7:45 a.m.
From: Zhang Ning <ning.a.zhang@intel.com>

for Intel Apollo Lake SOC, its cpuinfo and fpu features:
cpu: x86_family 6 x86_vendor_id GenuineIntel x86_model_id Intel(R) Celeron(R) CPU J3455 @ 1.50GHz
cpu: fpu: xfeatures_mask 0x11 xsave_size 1088 xsave_size_max 1088 xsaves_size 704
cpu: fpu: x87 floating point registers     xstate_offsets      0 / 0      xstate_sizes    160 / 160

this CPU doesn't have AVX registers, YMM feature.

when CRIU runs on this CPU, it will report dump error:
Dumping GP/FPU registers for 4888
Error (criu/arch/x86/crtools.c:362): x86: Corruption in XFEATURE_YMM area (expected 64 but 0 obtained)
Error (criu/cr-dump.c:1278): Can't infect (pid: 4888) with parasite

that's because x86/crtools.c will still valid YMM xsave frame, thus fail to dump.

bypass unsupported feature, to make CRIU runs this kinds of CPUs.

Cc: Chen Hu <hu1.chen@intel.com>
Signed-off-by: Zhang Ning <ning.a.zhang@intel.com>
---
 criu/arch/x86/crtools.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/arch/x86/crtools.c b/criu/arch/x86/crtools.c
index ee016da0..efc23e5f 100644
--- a/criu/arch/x86/crtools.c
+++ b/criu/arch/x86/crtools.c
@@ -354,7 +354,7 @@  static bool valid_xsave_frame(CoreEntry *core)
 			};
 
 			for (i = 0; i < ARRAY_SIZE(features); i++) {
-				if (!features[i].ptr && i > 0)
+				if (!features[i].ptr)
 					continue;
 
 				if (features[i].expected > features[i].obtained) {

Comments

Cyrill Gorcunov April 16, 2019, 7:50 a.m.
On Tue, Apr 16, 2019 at 03:45:05PM +0800, ning.a.zhang@intel.com wrote:
> From: Zhang Ning <ning.a.zhang@intel.com>
> 
> for Intel Apollo Lake SOC, its cpuinfo and fpu features:
> cpu: x86_family 6 x86_vendor_id GenuineIntel x86_model_id Intel(R) Celeron(R) CPU J3455 @ 1.50GHz
> cpu: fpu: xfeatures_mask 0x11 xsave_size 1088 xsave_size_max 1088 xsaves_size 704
> cpu: fpu: x87 floating point registers     xstate_offsets      0 / 0      xstate_sizes    160 / 160
> 
> this CPU doesn't have AVX registers, YMM feature.
> 
> when CRIU runs on this CPU, it will report dump error:
> Dumping GP/FPU registers for 4888
> Error (criu/arch/x86/crtools.c:362): x86: Corruption in XFEATURE_YMM area (expected 64 but 0 obtained)
> Error (criu/cr-dump.c:1278): Can't infect (pid: 4888) with parasite
> 
> that's because x86/crtools.c will still valid YMM xsave frame, thus fail to dump.
> 
> bypass unsupported feature, to make CRIU runs this kinds of CPUs.
> 
> Cc: Chen Hu <hu1.chen@intel.com>
> Signed-off-by: Zhang Ning <ning.a.zhang@intel.com>

Well, to be honest we never tested celeron series, neither lack of avx support.
Patch looks ok to me though. But requires more testing. Does it passes all
tests on your machine?
Zhang, Ning A April 16, 2019, 8:04 a.m.
we are currently working on Android, we can check/dump on skylake SOC,
but failed to restore.

I will test this patch by using ubuntu on Apollo Lake SOC.

please wait.

BR.
Ning.

在 2019-04-16二的 10:50 +0300,Cyrill Gorcunov写道:
> On Tue, Apr 16, 2019 at 03:45:05PM +0800, ning.a.zhang@intel.com
> wrote:
> > From: Zhang Ning <ning.a.zhang@intel.com>
> > 
> > for Intel Apollo Lake SOC, its cpuinfo and fpu features:
> > cpu: x86_family 6 x86_vendor_id GenuineIntel x86_model_id Intel(R)
> > Celeron(R) CPU J3455 @ 1.50GHz
> > cpu: fpu: xfeatures_mask 0x11 xsave_size 1088 xsave_size_max 1088
> > xsaves_size 704
> > cpu: fpu: x87 floating point registers     xstate_offsets      0 /
> > 0      xstate_sizes    160 / 160
> > 
> > this CPU doesn't have AVX registers, YMM feature.
> > 
> > when CRIU runs on this CPU, it will report dump error:
> > Dumping GP/FPU registers for 4888
> > Error (criu/arch/x86/crtools.c:362): x86: Corruption in
> > XFEATURE_YMM area (expected 64 but 0 obtained)
> > Error (criu/cr-dump.c:1278): Can't infect (pid: 4888) with parasite
> > 
> > that's because x86/crtools.c will still valid YMM xsave frame, thus
> > fail to dump.
> > 
> > bypass unsupported feature, to make CRIU runs this kinds of CPUs.
> > 
> > Cc: Chen Hu <hu1.chen@intel.com>
> > Signed-off-by: Zhang Ning <ning.a.zhang@intel.com>
> 
> Well, to be honest we never tested celeron series, neither lack of
> avx support.
> Patch looks ok to me though. But requires more testing. Does it
> passes all
> tests on your machine?
Cyrill Gorcunov April 16, 2019, 8:12 a.m.
On Tue, Apr 16, 2019 at 08:04:36AM +0000, Zhang, Ning A wrote:
> we are currently working on Android, we can check/dump on skylake SOC,
> but failed to restore.
> 
> I will test this patch by using ubuntu on Apollo Lake SOC.
> 
> please wait.

No rush.
Zhang, Ning A April 16, 2019, 9 a.m.
On ubuntu:
without this patch, dump error, same as commit message.

with this patch, both dump/restore are good.

please check logs:
https://gist.github.com/zhangn1985/1ec39b59641090e48356d7358fc277c7

BR.
Ning.


在 2019-04-16二的 11:12 +0300,Cyrill Gorcunov写道:
> On Tue, Apr 16, 2019 at 08:04:36AM +0000, Zhang, Ning A wrote:
> > we are currently working on Android, we can check/dump on skylake
> > SOC,
> > but failed to restore.
> > 
> > I will test this patch by using ubuntu on Apollo Lake SOC.
> > 
> > please wait.
> 
> No rush.
Cyrill Gorcunov April 16, 2019, 9:04 a.m.
On Tue, Apr 16, 2019 at 09:00:25AM +0000, Zhang, Ning A wrote:
> On ubuntu:
> without this patch, dump error, same as commit message.
> 
> with this patch, both dump/restore are good.
> 
> please check logs:
> https://gist.github.com/zhangn1985/1ec39b59641090e48356d7358fc277c7
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>

Thank you!
Zhang, Ning A May 10, 2019, 1:52 a.m.
hello,

how about the status of this patch? what should I do next?


在 2019-04-16二的 12:04 +0300,Cyrill Gorcunov写道:
> On Tue, Apr 16, 2019 at 09:00:25AM +0000, Zhang, Ning A wrote:
> > On ubuntu:
> > without this patch, dump error, same as commit message.
> > 
> > with this patch, both dump/restore are good.
> > 
> > please check logs:
> > https://gist.github.com/zhangn1985/1ec39b59641090e48356d7358fc277c7
> 
> Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
> 
> Thank you!
>
Cyrill Gorcunov May 10, 2019, 6:56 a.m.
On Fri, May 10, 2019 at 01:52:49AM +0000, Zhang, Ning A wrote:
> hello,
> 
> how about the status of this patch? what should I do next?

Let me add Andrew to CC, I thought the patch is already merged.
Andrei Vagin May 21, 2019, 7:31 a.m.
Hello,

I'm sorry for the deleay. The patch has been applied. Thanks!

On Fri, May 10, 2019 at 01:52:49AM +0000, Zhang, Ning A wrote:
> hello,
> 
> how about the status of this patch? what should I do next?
> 
> 
> 在 2019-04-16二的 12:04 +0300,Cyrill Gorcunov写道:
> > On Tue, Apr 16, 2019 at 09:00:25AM +0000, Zhang, Ning A wrote:
> > > On ubuntu:
> > > without this patch, dump error, same as commit message.
> > > 
> > > with this patch, both dump/restore are good.
> > > 
> > > please check logs:
> > > https://gist.github.com/zhangn1985/1ec39b59641090e48356d7358fc277c7
> > 
> > Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
> > 
> > Thank you!
> > 
> 
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu