[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [Bug 1201446] Re: Instructions not supported by targeted CP
From: |
Jonathan Morton |
Subject: |
[Qemu-devel] [Bug 1201446] Re: Instructions not supported by targeted CPU do not throw SIGILL |
Date: |
Mon, 15 Jul 2013 16:20:21 -0000 |
The CMOV feature bit (bit 15 of EDX) should affect availability of the
following instructions:
CMOVcc (0F 40 -> 0F 4F)
FCMOVcc (DA C0 -> DA DF and DB C0 -> DB DF)
FCOMI family (DB E8 -> DB F7 and DF E8 -> DF F7)
HTH
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1201446
Title:
Instructions not supported by targeted CPU do not throw SIGILL
Status in QEMU:
New
Bug description:
We encountered a bug in another package that caused it to include CMOV
instructions when targetting i486, resulting in an inability to run
the package on real i486 and i586 hardware. We then attempted to use
QEMU to reproduce the bug for easier debugging, since most developers
have long since got rid of such old hardware.
QEMU appears to continue to support *all* instructions when -cpu=486
is selected, regardless of what is advertised in CPUID to the guest.
CPUID describes the host environment as a reasonably close
approximation to a late-model i486, with very few instruction
extensions - specifically excluding CMOV, which on real hardware is an
optional extension to the i686 architecture.
The result was that we could not reproduce the bug using QEMU, and
must therefore attempt to debug it using a very limited stock of real
hardware, which also has very limited performance for rebuilding the
package. This completely defeats one of the main uses of QEMU, in our
opinion.
If this bug extends to other CPU architectures, it would affect all
developers wishing to check whether their code conforms to
restrictions imposed by any older or more restrictive ISA
specification than the latest that QEMU supports, including the
distinctions between ARMv7-A-NEON, ARMv7-A-VFPv3, ARMv7-A-VFPv3-d16,
ARMv7-R, ARMv7-M, ARMv6-VFPv2, ARMv5-TE, ARMv4-T... all of which are
currently shipping in new devices.
Attached is a small C program which can easily be compiled to include
CMOV instructions. It can be used to reproduce the bug:
$ gcc -march=i486 -O2 -c minmax.c -o minmax
$ ./minmax
No arguments!
$ ./minmax 5 6 7
max: 7 min: 5
$ gcc -march=pentium2 -O2 -c minmax.c -o minmax-p2
$ ./minmax-p2
No arguments!
$ ./minmax-p2 5 6 7
[Expected, occurs on real i4/586 hardware:] Illegal instruction
[Actual, within QEMU v1.2.0 with -cpu=486:] max: 7 min: 5
$
The bug is likely not limited to CMOV, but would also apply to more
recent ISA extensions - so 3DNow! instructions would appear to run on
Intel guest CPUs, AVX on a Pentium-2, and other such weirdness.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1201446/+subscriptions
- [Qemu-devel] [PULL 0/7] arm-devs queue, Peter Maydell, 2013/07/15
- [Qemu-devel] [PULL 2/7] hw/cpu/a15mpcore: Correct default value for num-irq, Peter Maydell, 2013/07/15
- [Qemu-devel] [PULL 1/7] char/cadence_uart: Fix reset for unattached instances, Peter Maydell, 2013/07/15
- [Qemu-devel] [PULL 7/7] ARM/highbank: add support for Calxeda ECX-2000 / Midway, Peter Maydell, 2013/07/15
- [Qemu-devel] [PULL 6/7] ARM/highbank: prepare for adding similar machines, Peter Maydell, 2013/07/15
- [Qemu-devel] [PULL 3/7] sd/pl181.c: Avoid undefined shift behaviour in RWORD macro, Peter Maydell, 2013/07/15
- [Qemu-devel] [PULL 4/7] hw/dma/omap_dma: Fix bugs with DMA requests above 32, Peter Maydell, 2013/07/15
- [Qemu-devel] [PULL 5/7] hw/arm/vexpress: Add alias for flash at address 0 on A15 board, Peter Maydell, 2013/07/15