Bug 1270703 - qemu: accel=tcg does not implement SSE 4 properly
Summary: qemu: accel=tcg does not implement SSE 4 properly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Virtualization Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1340971
TreeView+ depends on / blocked
 
Reported: 2015-10-12 08:13 UTC by Florian Weimer
Modified: 2016-09-20 12:10 UTC (History)
11 users (show)

Fixed In Version:
Clone Of: 1269529
: 1340971 (view as bug list)
Environment:
Last Closed: 2015-12-30 20:40:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
tst-strstr.c (14.97 KB, text/plain)
2015-10-12 08:13 UTC, Florian Weimer
no flags Details
tst-strstr (31.45 KB, application/octet-stream)
2015-10-12 08:16 UTC, Florian Weimer
no flags Details

Description Florian Weimer 2015-10-12 08:13:45 UTC
Created attachment 1081903 [details]
tst-strstr.c

Description of problem:

An old SSE4 strstr from glibc returns incorrect results if running with qemu in accel=tcg mode.

Version-Release number of selected component (if applicable):

qemu-kvm-2.3.1-3.fc22.x86_64

How reproducible:

Always.

Steps to Reproduce:
1. Compile the attached self-contained reproducer.
2. Run it with ./tst-strstr

Actual results:

Output looks like this:

error: needle not found at offset 3 (0x4007a3)
error: needle not found at offset 4 (0x4007a4)
error: needle not found at offset 5 (0x4007a5)
…

Expected results:

No output.

Additional info:

Test case was extracted from glibc 2.17.  Current Fedora no longer has this strstr implementation, but you can test with CentOS 7 in a guest as well.

qemu-kvm command line:

/usr/bin/qemu-system-x86_64 -machine accel=kvm -name rhel7.0 -S -machine pc-i440fx-2.3,accel=tcg,usb=off -cpu SandyBridge -m 2048 -realtime mlock=off -smp 2,sockets=2,cores=1,threads=1 -uuid b885eb90-c211-4554-bb3e-9406008d8cb5 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/rhel7.0.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x6.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x6 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x6.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x6.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive file=/var/lib/libvirt/images/rhel7.0.qcow2,if=none,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=23,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:05:91:43,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/rhel7.0.org.qemu.guest_agent.0,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -chardev spicevmc,id=charchannel1,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 -msg timestamp=on

Comment 1 Florian Weimer 2015-10-12 08:16:27 UTC
Created attachment 1081905 [details]
tst-strstr

compiled x86_64 program

Comment 2 Paolo Bonzini 2015-10-12 09:11:16 UTC
Can you attach a statically linked binary?

Comment 3 Paolo Bonzini 2015-10-12 09:24:51 UTC
Nevermind, I can reproduce it with the attached binary.

Comment 4 Florian Weimer 2015-10-12 13:00:10 UTC
Paolo posted a fix upstream: http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg02605.html

Comment 5 Fedora Update System 2015-12-07 21:30:10 UTC
qemu-2.3.1-8.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-686f289aa5

Comment 6 Fedora Update System 2015-12-08 23:51:22 UTC
qemu-2.3.1-8.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update qemu'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-686f289aa5

Comment 7 Cole Robinson 2015-12-30 20:40:07 UTC
Update is in stable now


Note You need to log in before you can comment on or make changes to this bug.