Subject: next-20230809: kvm unittest fail: emulator

From: "Aithal, Srikanth" <[email-masked]>
Date: Thu, 10 Aug 2023 09:36:59 +0530

Hello,

On linux-next 20230809 build kvm emulator unittest failed.

===================
Recreation steps:
===================

1. git clone https://gitlab.com/kvm-unit-tests/kvm-unit-tests.git
2. export QEMU=<location of QEMU binary> I used v8.0.2
3. cd kvm-unit-tests/;./configure;make standalone;tests/emulator

Debug log:

[stdout] BUILD_HEAD=023002d2
[stdout] timeout -k 1s --foreground 90s 
/home/VT_BUILD/qemu/build/x86_64-softmmu/qemu-system-x86_64 --no-reboot 
-nodefaults -device pc-testdev -device 
isa-debug-exit,iobase=0xf4,iosize=0x4 -vnc none -serial stdio -device 
pci-testdev -machine accel=kvm -kernel /tmp/tmp.AFoESgjELO -smp 1 # 
-initrd /tmp/tmp.CGpwyvgHI4
[stdout] enabling apic
[stdout] smp: waiting for 0 APs
[stdout] SKIP: Skipping tests the require forced emulation, use 
kvm.force_emulation_prefix=1 to enable
[stdout] paging enabled
[stdout] cr0 = 80010011
[stdout] cr3 = 1007000
[stdout] cr4 = 20
[stdout] PASS: mov reg, r/m (1)
[stdout] FAIL: or
[stdout] FAIL: add
[stdout] FAIL: xor
[stdout] FAIL: sub
[stdout] FAIL: adc(0)
[stdout] FAIL: adc(0)
[stdout] FAIL: sbb(0)
[stdout] FAIL: sbb(1)
[stdout] FAIL: and
[stdout] FAIL: test
[stdout] FAIL: repe/cmpsb (1)
[stdout] FAIL: repe cmpsb (1.zf)
[stdout] FAIL: repe cmpsw (1)
[stdout] FAIL: repe cmpll (1)
[stdout] FAIL: repe cmpsq (1)
[stdout] FAIL: repe cmpsb (2)
[stdout] FAIL: repe cmpsw (2)
[stdout] FAIL: repe cmpll (2)
[stdout] FAIL: repe cmpsq (2)
[stdout] FAIL: repe/cmpsb (1)
[stdout] FAIL: repe cmpsb (1.zf)
[stdout] FAIL: repe cmpsw (1)
[stdout] FAIL: repe cmpll (1)
[stdout] FAIL: repe cmpsq (1)
[stdout] FAIL: repe cmpsb (2)
[stdout] FAIL: repe cmpsw (2)
[stdout] FAIL: repe cmpll (2)
[stdout] FAIL: repe cmpsq (2)
[stdout] FAIL: scasb match
[stdout] PASS: scasb mismatch
[stdout] FAIL: scasw match
[stdout] PASS: scasw mismatch
[stdout] FAIL: scasd match
[stdout] PASS: scasd mismatch
[stdout] FAIL: scasq match
[stdout] PASS: scasq mismatch
[stdout] PASS: smsw (1)
[stdout] PASS: smsw (2)
[stdout] PASS: smsw (3)
[stdout] before 80010011 after 80010019
[stdout] PASS: lmsw (1)
[stdout] before 80010011 after 80010011
[stdout] PASS: lmsw (2)
[stdout] PASS: lmsw (3)
[stdout] PASS: outsb up
[stdout] PASS: outsb down
[stdout] FAIL: incl
[stdout] FAIL: decl
[stdout] FAIL: incb
[stdout] FAIL: decb
[stdout] FAIL: lock incl
[stdout] FAIL: lock decl
[stdout] FAIL: lock incb
[stdout] FAIL: lock decb
[stdout] FAIL: lock negl
[stdout] FAIL: lock notl
[stdout] FAIL: lock negb
[stdout] FAIL: lock notb
[stdout] FAIL: btcl imm8, r/m
[stdout] FAIL: btcl reg, r/m
[stdout] FAIL: btcq reg, r/m
[stdout] PASS: bsfw r/m, reg
[stdout] PASS: bsfl r/m, reg
[stdout] PASS: bsfq r/m, reg
[stdout] FAIL: bsfq r/m, reg
[stdout] PASS: bsrw r/m, reg
[stdout] PASS: bsrl r/m, reg
[stdout] PASS: bsrq r/m, reg
[stdout] FAIL: bsrq r/m, reg
[stdout] PASS: imul ax, mem
[stdout] PASS: imul eax, mem
[stdout] PASS: imul ax, mem, imm8
[stdout] PASS: imul eax, mem, imm8
[stdout] PASS: imul ax, mem, imm
[stdout] PASS: imul eax, mem, imm
[stdout] PASS: imul rax, mem
[stdout] PASS: imul rax, mem, imm8
[stdout] PASS: imul rax, mem, imm
[stdout] PASS: movdqu (read)
[stdout] PASS: movdqu (write)
[stdout] PASS: movaps (read)
[stdout] PASS: movaps (write)
[stdout] PASS: movapd (read)
[stdout] PASS: movapd (write)
[stdout] PASS: movups (read)
[stdout] PASS: movups (write)
[stdout] PASS: movupd (read)
[stdout] PASS: movupd (write)
[stdout] PASS: movups unaligned
[stdout] PASS: movupd unaligned
[stdout] PASS: unaligned movaps exception
[stdout] PASS: movups unaligned crosspage
[stdout] PASS: movups crosspage exception
[stdout] FAIL: shld (cl)
[stdout] FAIL: shrd (cl)
[stdout] PASS: ltr
[stdout] PASS: cross-page mmio read
[stdout] PASS: cross-page mmio write
[stdout] PASS: string_io_mmio
[stdout] SKIP: MOVBE unsupported by CPU
[stdout] PASS: no fep: #DB occurred after MOV SS
[stdout] FAIL: push $imm8
[stdout] FAIL: push %reg
[stdout] FAIL: push mem
[stdout] FAIL: push $imm
[stdout] FAIL: pop mem
[stdout] PASS: pop mem (2)
[stdout] PASS: pop reg
[stdout] PASS: ret
[stdout] PASS: leave
[stdout] FAIL: enter
[stdout] FAIL: xchg reg, r/m (1)
[stdout] FAIL: xchg reg, r/m (2)
[stdout] FAIL: xchg reg, r/m (3)
[stdout] FAIL: xchg reg, r/m (4)
[stdout] FAIL: xadd reg, r/m (1)
[stdout] FAIL: xadd reg, r/m (2)
[stdout] FAIL: xadd reg, r/m (3)
[stdout] FAIL: xadd reg, r/m (4)
[stdout] PASS: mov %cr8
[stdout] PASS: ljmp
[stdout] PASS: divq (fault)
[stdout] PASS: divq (1)
[stdout] PASS: mulb mem
[stdout] PASS: mulw mem
[stdout] PASS: mull mem
[stdout] PASS: mulq mem
[stdout] FAIL: movq (mmx, read)
[stdout] PASS: movq (mmx, write)
[stdout] FAIL: movb $imm, 0(%rip)
[stdout] PASS: Test ret/iret with a nullified segment
[stdout] PASS: mov null, %ss
[stdout] PASS: mov null, %ss (with ss.rpl != cpl)
[stdout] FAIL: cmovnel
[stdout] PASS: push16
[stdout] PASS: jump to non-canonical address
[stdout] SUMMARY: 136 tests, 68 unexpected failures, 2 skipped
[stdout] [31mFAIL[0m emulator (136 tests, 68 unexpected failures, 2 
skipped)