qemu-i386 pentium3/athlon incorrect instruction set

Bug #1469342 reported by PeteVine
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
QEMU
Won't Fix
Undecided
Unassigned

Bug Description

Running a binary containing a movsd instruction (SSE2) in 32-bit qemu-i386 from 20150609 using the -cpu pentium3 switch results in flawless execution whereas it should crash with SIGILL as P3 only had SSE and not SSE2.

Revision history for this message
PeteVine (davine-k) wrote :

Still there in the latest master.

To clarify, running the binary with the -cpu athlon switch (same instruction set as P3) also exhibits the problem whereas a real athlon SIGILL's correctly.

description: updated
summary: - qemu-i386 pentium3 incorrect instruction set
+ qemu-i386 pentium3/athlon incorrect instruction set
Revision history for this message
Paolo Bonzini (bonzini) wrote :

QEMU doesn't try to mimic the exact set of instructions for a processor, unfortunately. Virtualization solutions like KVM also do not allow you to do that, so the case for this feature is relatively minor.

However, patches are welcome.

Changed in qemu:
status: New → Won't Fix
Revision history for this message
PeteVine (davine-k) wrote :

I'm pretty sure you're right regarding entire instruction sets - but surely simply disabling SSE2 is possible even now? (after all pentium2 and below doesn't have it)

That could solve this problem with a simple hack like, eg. :

pentium3 = $pentium3 - SSE2

Revision history for this message
PeteVine (davine-k) wrote :

In the case it's really unfixable and both pentium3 and athlon are nothing more than aliases for 'QEMU Virtual CPU version 2.4.50' they should be removed from the list the user gets after:

qemu-i386 -cpu help

so as not to mislead. Thanks!

Revision history for this message
PeteVine (davine-k) wrote :

After looking at target-i386/cpu.c, it's clear to me CPUID_SSE and CPUID_SSE2 are defined seperately and neither pentium3 nor athlon have those defines set.

This could mean it's a bug not in the instruction set but possibly in the build process somewhere.

Revision history for this message
Marina Kovalevna (ciiiiipa) wrote :

This option is useful for testing, nothing more.

Revision history for this message
PeteVine (davine-k) wrote :

I think I may have found the culprit - athlon is defined as 'PPRO_FEATURES + some additional features'.

If PPRO_FEATURES is what I think it is (pentium pro) why does it have SSE and SSE2 defined? It should end with MMX.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.