Skip to contentSkip to conversation

tests: Fix 'make test' for i686 hosts (build regression)

PATCH Applied Stefan Weil 5 participants 9 messages Mar 7, 2014 – Mar 14, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: Fix 'make test' for i686 hosts (build regression)

'make test' is broken at least since commit baacf04799ace72a9c735dd9306a1ceaf305e7cf. Several source files were moved to util/, and some of them there split, so add the missing prefix and new files to fix the compiler and linker errors.

There remain more issues, but these changes allow running the test on a Linux i686 host.

---

'make test' shows several problems where the results from native execution and user mode emulation differ. Obviously the TCG code or at least one helper function don't work as expected.

The patch might be useful for QEMU stable, too. I did not use it with older versions, so I still don't know whether there was a TCG regression and when it occurred.

Running 'make test' on an x86_64 host is currently not possible. There is at least one -m32 compiler option missing, and a 32 bit version of glib2.0 must be installed (not available for Debian wheezy, so I had to stop here).

Regards
Stefan

 tests/tcg/test_path.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
tests/tcg/test_path.c +8 -5
index a064eea..f8dd36a 100644
@@ -1,12 +1,15 @@
 /* Test path override code */
 #define _GNU_SOURCE
 #include "config-host.h"
-#include "iov.c"
-#include "cutils.c"
-#include "path.c"
-#include "trace.c"
+#include "util/cutils.c"
+#include "util/hexdump.c"
+#include "util/iov.c"
+#include "util/path.c"
+#include "util/qemu-timer-common.c"
+#include "trace/control.c"
+#include "../trace/generated-events.c"
 #ifdef CONFIG_TRACE_SIMPLE
-#include "../trace/simple.c"
+#include "trace/simple.c"
 #endif
 
 #include <stdarg.h>
Signature · 1 line
1.7.9.5
#1 lore raw

Re: [Qemu-devel] [PATCH] tests: Fix 'make test' for i686 hosts (buildregression))

Quoted 4 lines · Stefan Weil

'make test' is broken at least since commit baacf04799ace72a9c735dd9306a1ceaf305e7cf. Several source files were moved to util/, and some of them there split, so add the missing prefix and new files to fix the compiler and linker errors.

I'm curious as why the Travis builds didn't pick this up?

https://travis-ci.org/qemu/qemu/builds

Does it require more libraries/features enabled to cause the breakage?

Quoted 52 lines

There remain more issues, but these changes allow running the test on a Linux i686 host.

---

'make test' shows several problems where the results from native execution and user mode emulation differ. Obviously the TCG code or at least one helper function don't work as expected.

The patch might be useful for QEMU stable, too. I did not use it with older versions, so I still don't know whether there was a TCG regression and when it occurred.

Running 'make test' on an x86_64 host is currently not possible. There is at least one -m32 compiler option missing, and a 32 bit version of glib2.0 must be installed (not available for Debian wheezy, so I had to stop here).

Regards
Stefan

 tests/tcg/test_path.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
tests/tcg/test_path.c +8 -5
index a064eea..f8dd36a 100644
@@ -1,12 +1,15 @@
 /* Test path override code */
 #define _GNU_SOURCE
 #include "config-host.h"
-#include "iov.c"
-#include "cutils.c"
-#include "path.c"
-#include "trace.c"
+#include "util/cutils.c"
+#include "util/hexdump.c"
+#include "util/iov.c"
+#include "util/path.c"
+#include "util/qemu-timer-common.c"
+#include "trace/control.c"
+#include "../trace/generated-events.c"
 #ifdef CONFIG_TRACE_SIMPLE
-#include "../trace/simple.c"
+#include "trace/simple.c"
 #endif
 
 #include <stdarg.h>
Signature · 1 line
Alex Bennée
#2 lore raw

Re: [Qemu-devel] [PATCH] tests: Fix 'make test' for i686 hosts (buildregression))

Am 07.03.2014 13:06, schrieb Alex Bennée:

Quoted 8 lines
Quoted 4 lines · Stefan Weil

'make test' is broken at least since commit baacf04799ace72a9c735dd9306a1ceaf305e7cf. Several source files were moved to util/, and some of them there split, so add the missing prefix and new files to fix the compiler and linker errors.

Quoted 5 lines

I'm curious as why the Travis builds didn't pick this up?

https://travis-ci.org/qemu/qemu/builds

Does it require more libraries/features enabled to cause the breakage?

Neither a simple 'make' nor a 'make check' will trigger the breakage because no other target depends on 'test', so you have to add that target explicitly.

In the meantime I tried older versions. Even version 1.1 already shows unwanted differences between native and QEMU emulated FPU operations.

The test binary is now available from this URL:
http://qemu.weilnetz.de/test/user/i386/test-i386

Run it native and with qemu-i386 and compare the output of both runs to see the problems.

Stefan

#3 lore raw

Re: [Qemu-devel] [PATCH] tests: Fix 'make test' for i686 hosts (buildregression))

Am 07.03.2014 13:40, schrieb Stefan Weil:

Quoted 8 lines

Am 07.03.2014 13:06, schrieb Alex Bennée:

Quoted 7 lines
Quoted 4 lines · Stefan Weil

'make test' is broken at least since commit baacf04799ace72a9c735dd9306a1ceaf305e7cf. Several source files were moved to util/, and some of them there split, so add the missing prefix and new files to fix the compiler and linker errors.

[...]

Quoted 8 lines

In the meantime I tried older versions. Even version 1.1 already shows unwanted differences between native and QEMU emulated FPU operations.

The test binary is now available from this URL:
http://qemu.weilnetz.de/test/user/i386/test-i386

Run it native and with qemu-i386 and compare the output of both runs to see the problems.

So... is QEMU or the test mistaken? :)

Regards,
Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#4 lore raw

Re: [Qemu-devel] [PATCH] tests: Fix 'make test' for i686 hosts (buildregression))

Am 07.03.2014 13:56, schrieb Andreas Färber:

Quoted 16 lines

Am 07.03.2014 13:40, schrieb Stefan Weil:

Quoted 8 lines

Am 07.03.2014 13:06, schrieb Alex Bennée:

Quoted 7 lines
Quoted 4 lines · Stefan Weil

'make test' is broken at least since commit baacf04799ace72a9c735dd9306a1ceaf305e7cf. Several source files were moved to util/, and some of them there split, so add the missing prefix and new files to fix the compiler and linker errors.

[...]

Quoted 6 lines

In the meantime I tried older versions. Even version 1.1 already shows unwanted differences between native and QEMU emulated FPU operations.

The test binary is now available from this URL:
http://qemu.weilnetz.de/test/user/i386/test-i386

Quoted 7 lines
Quoted 2 lines

Run it native and with qemu-i386 and compare the output of both runs to see the problems.

So... is QEMU or the test mistaken? :)

Regards,
Andreas

Hi Andreas,

test-i386 does some calculations and prints the results (see source code tests/tcg/test-i386.c). If the user mode emulation of QEMU works, it should not matter whether that executable runs native or emulated and both outputs be identical. They aren't - that's why I think we have a TCG problem to solve.

Regards
Stefan

#5 lore raw

Re: [Qemu-devel] [PATCH] tests: Fix 'make test' for i686 hosts (buildregression))

Quoted 5 lines · Stefan Weil

test-i386 does some calculations and prints the results (see source code tests/tcg/test-i386.c). If the user mode emulation of QEMU works, it should not matter whether that executable runs native or emulated and both outputs be identical. They aren't - that's why I think we have a TCG problem to solve.

I think TCG x86 FPU emulation has been a bit dodgy since forever; it's a fair amount of work to go through and fix everything up to be bitwise exact results versus hardware and I think that nobody's cared enough about x86 emulation to do that...

thanks
-- PMM

#6 lore raw

Re: [Qemu-devel] [PATCH] tests: Fix 'make test' for i686 hosts (buildregression))

Quoted 7 lines · Peter Maydell
Quoted 5 lines · Stefan Weil

test-i386 does some calculations and prints the results (see source code tests/tcg/test-i386.c). If the user mode emulation of QEMU works, it should not matter whether that executable runs native or emulated and both outputs be identical. They aren't - that's why I think we have a TCG problem to solve.

Quoted 5 lines

I think TCG x86 FPU emulation has been a bit dodgy since forever; it's a fair amount of work to go through and fix everything up to be bitwise exact results versus hardware and I think that nobody's cared enough about x86 emulation to do that...

IIRC the behaviour is different depending on how much x87 vs SIMD FP you go through. FWIW the Transitive translator was able to do most FP ops with generated code (certainly on SPARC->x86_64) and only go to softfloat for some things. But you did need to disable the x87 to do it.

But I get the impression that FP performance is currently "good enough" for what QEMU gets used for.

Signature · 1 line
Alex Bennée
#7 lore raw

Re: [Qemu-devel] [PATCH] tests: Fix 'make test' for i686 hosts (buildregression))

Quoted 7 lines · Alex Bennée
Quoted 5 lines · Peter Maydell

I think TCG x86 FPU emulation has been a bit dodgy since forever; it's a fair amount of work to go through and fix everything up to be bitwise exact results versus hardware and I think that nobody's cared enough about x86 emulation to do that...

Quoted 7 lines

IIRC the behaviour is different depending on how much x87 vs SIMD FP you go through. FWIW the Transitive translator was able to do most FP ops with generated code (certainly on SPARC->x86_64) and only go to softfloat for some things. But you did need to disable the x87 to do it.

But I get the impression that FP performance is currently "good enough" for what QEMU gets used for.

This is true but not particularly relevant to whether our current implementation is actually buggy in the sense of producing wrong results. We ripped out the code that tried to implement FP natively a long time back, so pure emulation is all we do now.

thanks
-- PMM

#8 lore raw
In reply to Stefan Weil
Quoted 7 lines · Stefan Weil

'make test' is broken at least since commit baacf04799ace72a9c735dd9306a1ceaf305e7cf. Several source files were moved to util/, and some of them there split, so add the missing prefix and new files to fix the compiler and linker errors.

There remain more issues, but these changes allow running the test on a Linux i686 host.

Thanks, applied to -trivial.

/mjt