https://lists.ubuntu.com/archives/kernel-team/2021-August/123672.html
** Description changed: [Impact] Our Bionic 4.15 kernel lacks of movups/movupd emulation support. With the following commit added into the emulator test in ubuntu_kvm_unit_tests: commit 8726f9771911d6749dbd36ab2fc70f0f25e2b1a9 Author: Jacob Xu <jacob...@google.com> Date: Wed Apr 21 16:12:57 2021 -0700 x86: add movups/movupd sse testcases to emulator.c Here we add movups/movupd tests corresponding to functionality introduced in commit 29916968c486 ("kvm: Add emulation for movups/movupd"). Signed-off-by: Jacob Xu <jacob...@google.com> Message-Id: <20210421231258.2583654-1-jacob...@google.com> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> It will cause the emulator test in ubuntu_kvm_unit_tests fail with timeout: + ... PASS: movdqu (read) PASS: movdqu (write) PASS: movaps (read) PASS: movaps (write) PASS: movapd (read) PASS: movapd (write) KVM internal error. Suberror: 1 emulation failure RAX=000000000000000a RBX=ffffffffffffe000 RCX=00000000000003fd RDX=00000000000003f8 RSI=0000000000419991 RDI=0000000000419991 RBP=000000000051b490 RSP=000000000051b470 R8 =000000000000000a R9 =00000000000003f8 R10=000000000000000d R11=0000000000000000 R12=ffffffffffffe000 R13=1111111111111111 R14=ffffffffffffd000 R15=3333333333333333 RIP=0000000000400a1f RFL=00010006 [-----P-] CPL=0 II=0 A20=1 SMM=0 HLT=0 ES =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] CS =0008 0000000000000000 ffffffff 00a09b00 DPL=0 CS64 [-RA] SS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] DS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] FS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] GS =0010 000000000051a510 ffffffff 00c09300 DPL=0 DS [-WA] LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT TR =0080 000000000041207a 0000ffff 00008b00 DPL=0 TSS64-busy GDT= 000000000041100a 0000106f IDT= 0000000000410000 00000fff CR0=80010011 CR2=0000000000000000 CR3=0000000001007000 CR4=00000220 DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 DR6=00000000ffff0ff0 DR7=0000000000000400 EFER=0000000000000500 Code=00 c7 45 e8 03 00 00 00 c7 45 ec 04 00 00 00 66 0f 6f 45 e0 <0f> 11 03 48 89 de 48 8d 7d e0 e8 e5 f9 ff ff 0f b6 f8 be a1 8f 41 00 b8 00 00 00 00 e8 07 qemu-system-x86_64: terminating on signal 15 from pid 15758 (timeout) FAIL emulator (timeout; duration=90s) [Fix] * 29916968c48691 kvm: Add emulation for movups/movupd This patch can be cherry-picked into Bionic. + It can fix our test failure plus, as mentioned in the commit message, emulation failures with openbsd as guest and with Windows 10 with intel HD graphics pass through. - - I didn't see any other patch that claims to be a fix of this one in - upstream tree. [Test] Test kernel can be found here: https://people.canonical.com/~phlin/kernel/lp-1932966-kvm-emulator/ Run the emulator test from ubuntu_kvm_unit_tests, with this patch applied it will pass without any issue: + ... PASS: movdqu (read) PASS: movdqu (write) PASS: movaps (read) PASS: movaps (write) PASS: movapd (read) PASS: movapd (write) PASS: movups (read) PASS: movups (write) PASS: movupd (read) PASS: movupd (write) PASS: movups unaligned PASS: movupd unaligned PASS: unaligned movaps exception PASS: movups unaligned crosspage PASS: movups crosspage exception PASS: movq (mmx, read) PASS: movq (mmx, write) PASS: movb $imm, 0(%rip) PASS: shld (cl) PASS: shrd (cl) PASS: mov null, %ss PASS: mov null, %ss (with ss.rpl != cpl) PASS: Test ret/iret with a nullified segment PASS: ltr PASS: cmovnel SKIP: skipping register-only tests, use kvm.force_emulation_prefix=1 to enable PASS: push16 PASS: cross-page mmio read PASS: cross-page mmio write PASS: string_io_mmio PASS: jump to non-canonical address SKIP: illegal movbe SUMMARY: 135 tests, 2 skipped PASS emulator (135 tests, 2 skipped) [Where problems could occur] - The problem I think of for the moment is that we might see other - failures when using this in the future. + I didn't see any other patch that claims to be a fix of this one in + the upstream tree. The problem I think of for the moment is that we + might see other failures when using this in the future. [Original Bug Report] Found this on B/KVM, current cycle (sru-20210531): 18:27:11 DEBUG| [stdout] PASS: movapd (write)^M 18:27:11 DEBUG| [stderr] KVM internal error. Suberror: 1 18:27:11 DEBUG| [stderr] emulation failure 18:27:11 DEBUG| [stderr] RAX=000000000000000a RBX=ffffffffffffe000 RCX=00000000000003fd RDX=00000000000003f8 18:27:11 DEBUG| [stderr] RSI=0000000000419991 RDI=0000000000419991 RBP=000000000051b440 RSP=000000000051b420 18:27:11 DEBUG| [stderr] R8 =000000000000000a R9 =00000000000003f8 R10=000000000000000d R11=0000000000000000 18:27:11 DEBUG| [stderr] R12=ffffffffffffe000 R13=1111111111111111 R14=ffffffffffffd000 R15=3333333333333333 18:27:11 DEBUG| [stderr] RIP=0000000000400a0c RFL=00010006 [-----P-] CPL=0 II=0 A20=1 SMM=0 HLT=0 18:27:11 DEBUG| [stderr] ES =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] 18:27:11 DEBUG| [stderr] CS =0008 0000000000000000 ffffffff 00a09b00 DPL=0 CS64 [-RA] 18:27:11 DEBUG| [stderr] SS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] 18:27:11 DEBUG| [stderr] DS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] 18:27:11 DEBUG| [stderr] FS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] 18:27:11 DEBUG| [stderr] GS =0010 000000000051a4d0 ffffffff 00c09300 DPL=0 DS [-WA] 18:27:11 DEBUG| [stderr] LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT 18:27:11 DEBUG| [stderr] TR =0080 000000000041207a 0000ffff 00008b00 DPL=0 TSS64-busy 18:27:11 DEBUG| [stderr] GDT= 000000000041100a 0000106f 18:27:11 DEBUG| [stderr] IDT= 0000000000410000 00000fff 18:27:11 DEBUG| [stderr] CR0=80010011 CR2=0000000000000000 CR3=0000000001007000 CR4=00000220 18:27:11 DEBUG| [stderr] DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 18:27:11 DEBUG| [stderr] DR6=00000000ffff0ff0 DR7=0000000000000400 18:27:11 DEBUG| [stderr] EFER=0000000000000500 18:27:11 DEBUG| [stderr] Code=00 c7 45 e8 03 00 00 00 c7 45 ec 04 00 00 00 66 0f 6f 45 e0 <0f> 11 03 48 89 de 48 8d 7d e0 e8 f8 f9 ff ff 0f b6 f8 be a1 8f 41 00 b8 00 00 00 00 e8 05 18:28:40 DEBUG| [stderr] qemu-system-x86_64: terminating on signal 15 from pid 13634 (timeout) 18:28:40 DEBUG| [stdout] FAIL emulator (timeout; duration=90s) [...] TestError: Test failed for emulator 18:28:40 ERROR| child process failed 18:28:40 DEBUG| Traceback (most recent call last): 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/parallel.py", line 25, in fork_start 18:28:40 DEBUG| l() 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/job.py", line 505, in <lambda> 18:28:40 DEBUG| l = lambda: test.runtest(self, url, tag, args, dargs) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/test.py", line 125, in runtest 18:28:40 DEBUG| job.sysinfo.log_after_each_iteration) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/shared/test.py", line 913, in runtest 18:28:40 DEBUG| mytest._exec(args, dargs) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/shared/test.py", line 411, in _exec 18:28:40 DEBUG| _call_test_function(self.execute, *p_args, **p_dargs) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/shared/test.py", line 823, in _call_test_function 18:28:40 DEBUG| return func(*args, **dargs) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/shared/test.py", line 291, in execute 18:28:40 DEBUG| postprocess_profiled_run, args, dargs) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/shared/test.py", line 212, in _call_run_once 18:28:40 DEBUG| self.run_once(*args, **dargs) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/tests/ubuntu_kvm_unit_tests/ubuntu_kvm_unit_tests.py", line 82, in run_once 18:28:40 DEBUG| raise error.TestError("Test failed for {}".format(test_name)) 18:28:40 DEBUG| TestError: Test failed for emulator 18:28:41 INFO | ERROR ubuntu_kvm_unit_tests.emulator ubuntu_kvm_unit_tests.emulator timestamp=1624040921 localtime=Jun 18 18:28:41 Test failed for emulator 18:28:41 INFO | END ERROR ubuntu_kvm_unit_tests.emulator ubuntu_kvm_unit_tests.emulator timestamp=1624040921 localtime=Jun 18 18:28:41 -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux in Ubuntu. https://bugs.launchpad.net/bugs/1932966 Title: kvm_unit_tests: emulator test fails on 4.15 kernel, timeout Status in ubuntu-kernel-tests: In Progress Status in linux package in Ubuntu: Fix Released Status in linux source package in Bionic: In Progress Bug description: [Impact] Our Bionic 4.15 kernel lacks of movups/movupd emulation support. With the following commit added into the emulator test in ubuntu_kvm_unit_tests: commit 8726f9771911d6749dbd36ab2fc70f0f25e2b1a9 Author: Jacob Xu <jacob...@google.com> Date: Wed Apr 21 16:12:57 2021 -0700 x86: add movups/movupd sse testcases to emulator.c Here we add movups/movupd tests corresponding to functionality introduced in commit 29916968c486 ("kvm: Add emulation for movups/movupd"). Signed-off-by: Jacob Xu <jacob...@google.com> Message-Id: <20210421231258.2583654-1-jacob...@google.com> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> It will cause the emulator test in ubuntu_kvm_unit_tests fail with timeout: ... PASS: movdqu (read) PASS: movdqu (write) PASS: movaps (read) PASS: movaps (write) PASS: movapd (read) PASS: movapd (write) KVM internal error. Suberror: 1 emulation failure RAX=000000000000000a RBX=ffffffffffffe000 RCX=00000000000003fd RDX=00000000000003f8 RSI=0000000000419991 RDI=0000000000419991 RBP=000000000051b490 RSP=000000000051b470 R8 =000000000000000a R9 =00000000000003f8 R10=000000000000000d R11=0000000000000000 R12=ffffffffffffe000 R13=1111111111111111 R14=ffffffffffffd000 R15=3333333333333333 RIP=0000000000400a1f RFL=00010006 [-----P-] CPL=0 II=0 A20=1 SMM=0 HLT=0 ES =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] CS =0008 0000000000000000 ffffffff 00a09b00 DPL=0 CS64 [-RA] SS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] DS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] FS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] GS =0010 000000000051a510 ffffffff 00c09300 DPL=0 DS [-WA] LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT TR =0080 000000000041207a 0000ffff 00008b00 DPL=0 TSS64-busy GDT= 000000000041100a 0000106f IDT= 0000000000410000 00000fff CR0=80010011 CR2=0000000000000000 CR3=0000000001007000 CR4=00000220 DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 DR6=00000000ffff0ff0 DR7=0000000000000400 EFER=0000000000000500 Code=00 c7 45 e8 03 00 00 00 c7 45 ec 04 00 00 00 66 0f 6f 45 e0 <0f> 11 03 48 89 de 48 8d 7d e0 e8 e5 f9 ff ff 0f b6 f8 be a1 8f 41 00 b8 00 00 00 00 e8 07 qemu-system-x86_64: terminating on signal 15 from pid 15758 (timeout) FAIL emulator (timeout; duration=90s) [Fix] * 29916968c48691 kvm: Add emulation for movups/movupd This patch can be cherry-picked into Bionic. It can fix our test failure plus, as mentioned in the commit message, emulation failures with openbsd as guest and with Windows 10 with intel HD graphics pass through. [Test] Test kernel can be found here: https://people.canonical.com/~phlin/kernel/lp-1932966-kvm-emulator/ Run the emulator test from ubuntu_kvm_unit_tests, with this patch applied it will pass without any issue: ... PASS: movdqu (read) PASS: movdqu (write) PASS: movaps (read) PASS: movaps (write) PASS: movapd (read) PASS: movapd (write) PASS: movups (read) PASS: movups (write) PASS: movupd (read) PASS: movupd (write) PASS: movups unaligned PASS: movupd unaligned PASS: unaligned movaps exception PASS: movups unaligned crosspage PASS: movups crosspage exception PASS: movq (mmx, read) PASS: movq (mmx, write) PASS: movb $imm, 0(%rip) PASS: shld (cl) PASS: shrd (cl) PASS: mov null, %ss PASS: mov null, %ss (with ss.rpl != cpl) PASS: Test ret/iret with a nullified segment PASS: ltr PASS: cmovnel SKIP: skipping register-only tests, use kvm.force_emulation_prefix=1 to enable PASS: push16 PASS: cross-page mmio read PASS: cross-page mmio write PASS: string_io_mmio PASS: jump to non-canonical address SKIP: illegal movbe SUMMARY: 135 tests, 2 skipped PASS emulator (135 tests, 2 skipped) [Where problems could occur] I didn't see any other patch that claims to be a fix of this one in the upstream tree. The problem I think of for the moment is that we might see other failures when using this in the future. [Original Bug Report] Found this on B/KVM, current cycle (sru-20210531): 18:27:11 DEBUG| [stdout] PASS: movapd (write)^M 18:27:11 DEBUG| [stderr] KVM internal error. Suberror: 1 18:27:11 DEBUG| [stderr] emulation failure 18:27:11 DEBUG| [stderr] RAX=000000000000000a RBX=ffffffffffffe000 RCX=00000000000003fd RDX=00000000000003f8 18:27:11 DEBUG| [stderr] RSI=0000000000419991 RDI=0000000000419991 RBP=000000000051b440 RSP=000000000051b420 18:27:11 DEBUG| [stderr] R8 =000000000000000a R9 =00000000000003f8 R10=000000000000000d R11=0000000000000000 18:27:11 DEBUG| [stderr] R12=ffffffffffffe000 R13=1111111111111111 R14=ffffffffffffd000 R15=3333333333333333 18:27:11 DEBUG| [stderr] RIP=0000000000400a0c RFL=00010006 [-----P-] CPL=0 II=0 A20=1 SMM=0 HLT=0 18:27:11 DEBUG| [stderr] ES =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] 18:27:11 DEBUG| [stderr] CS =0008 0000000000000000 ffffffff 00a09b00 DPL=0 CS64 [-RA] 18:27:11 DEBUG| [stderr] SS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] 18:27:11 DEBUG| [stderr] DS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] 18:27:11 DEBUG| [stderr] FS =0010 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] 18:27:11 DEBUG| [stderr] GS =0010 000000000051a4d0 ffffffff 00c09300 DPL=0 DS [-WA] 18:27:11 DEBUG| [stderr] LDT=0000 0000000000000000 0000ffff 00008200 DPL=0 LDT 18:27:11 DEBUG| [stderr] TR =0080 000000000041207a 0000ffff 00008b00 DPL=0 TSS64-busy 18:27:11 DEBUG| [stderr] GDT= 000000000041100a 0000106f 18:27:11 DEBUG| [stderr] IDT= 0000000000410000 00000fff 18:27:11 DEBUG| [stderr] CR0=80010011 CR2=0000000000000000 CR3=0000000001007000 CR4=00000220 18:27:11 DEBUG| [stderr] DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 18:27:11 DEBUG| [stderr] DR6=00000000ffff0ff0 DR7=0000000000000400 18:27:11 DEBUG| [stderr] EFER=0000000000000500 18:27:11 DEBUG| [stderr] Code=00 c7 45 e8 03 00 00 00 c7 45 ec 04 00 00 00 66 0f 6f 45 e0 <0f> 11 03 48 89 de 48 8d 7d e0 e8 f8 f9 ff ff 0f b6 f8 be a1 8f 41 00 b8 00 00 00 00 e8 05 18:28:40 DEBUG| [stderr] qemu-system-x86_64: terminating on signal 15 from pid 13634 (timeout) 18:28:40 DEBUG| [stdout] FAIL emulator (timeout; duration=90s) [...] TestError: Test failed for emulator 18:28:40 ERROR| child process failed 18:28:40 DEBUG| Traceback (most recent call last): 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/parallel.py", line 25, in fork_start 18:28:40 DEBUG| l() 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/job.py", line 505, in <lambda> 18:28:40 DEBUG| l = lambda: test.runtest(self, url, tag, args, dargs) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/test.py", line 125, in runtest 18:28:40 DEBUG| job.sysinfo.log_after_each_iteration) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/shared/test.py", line 913, in runtest 18:28:40 DEBUG| mytest._exec(args, dargs) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/shared/test.py", line 411, in _exec 18:28:40 DEBUG| _call_test_function(self.execute, *p_args, **p_dargs) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/shared/test.py", line 823, in _call_test_function 18:28:40 DEBUG| return func(*args, **dargs) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/shared/test.py", line 291, in execute 18:28:40 DEBUG| postprocess_profiled_run, args, dargs) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/shared/test.py", line 212, in _call_run_once 18:28:40 DEBUG| self.run_once(*args, **dargs) 18:28:40 DEBUG| File "/home/ubuntu/autotest/client/tests/ubuntu_kvm_unit_tests/ubuntu_kvm_unit_tests.py", line 82, in run_once 18:28:40 DEBUG| raise error.TestError("Test failed for {}".format(test_name)) 18:28:40 DEBUG| TestError: Test failed for emulator 18:28:41 INFO | ERROR ubuntu_kvm_unit_tests.emulator ubuntu_kvm_unit_tests.emulator timestamp=1624040921 localtime=Jun 18 18:28:41 Test failed for emulator 18:28:41 INFO | END ERROR ubuntu_kvm_unit_tests.emulator ubuntu_kvm_unit_tests.emulator timestamp=1624040921 localtime=Jun 18 18:28:41 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-kernel-tests/+bug/1932966/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp