All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH  v2 0/3]  Travis tweaks and tcg test fixes
@ 2018-10-09 14:59 Alex Bennée
  2018-10-09 14:59 ` [Qemu-devel] [PATCH v2 1/3] .travis.yml: split MacOSX builds and reduce target list Alex Bennée
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alex Bennée @ 2018-10-09 14:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: famz, f4bug, Alex Bennée

Hi,

The new patches fix the building the i386 tests when clang is the
system compiler. All currently need review.

Alex Bennée (2):
  .travis.yml: split MacOSX builds and reduce target list
  tests/tcg: disable enterN insn tests for test-i386 with clang

Theodore Dubois (1):
  tests/tcg: make test-i386 test program compile on clang

 .travis.yml                |  8 +++++++-
 tests/tcg/i386/test-i386.c | 22 ++++++++++++++++++----
 2 files changed, 25 insertions(+), 5 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH v2 1/3] .travis.yml: split MacOSX builds and reduce target list
  2018-10-09 14:59 [Qemu-devel] [PATCH v2 0/3] Travis tweaks and tcg test fixes Alex Bennée
@ 2018-10-09 14:59 ` Alex Bennée
  2018-10-09 14:59 ` [Qemu-devel] [PATCH v2 2/3] tests/tcg: make test-i386 test program compile on clang Alex Bennée
  2018-10-09 14:59 ` [Qemu-devel] [PATCH v2 3/3] tests/tcg: disable enterN insn tests for test-i386 with clang Alex Bennée
  2 siblings, 0 replies; 6+ messages in thread
From: Alex Bennée @ 2018-10-09 14:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: famz, f4bug, Alex Bennée

We have reached the point where the MacOSX build was regularly timing
out. So as before I've reduced the target list to "major"
architectures to try and bring the build time down. I've added an
additional MacOSX build with the latest XCode with a minimal list of
"most likely" targets on MacOS.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 .travis.yml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 95be6ec59f..13a09facd3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -107,8 +107,14 @@ matrix:
     - env: CONFIG="--disable-tcg"
            TEST_CMD=""
       compiler: gcc
-    - env: CONFIG=""
+    # MacOSX builds
+    - env: CONFIG="--target-list=aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"
       os: osx
+      osx_image: xcode9.4
+      compiler: clang
+    - env: CONFIG="--target-list=i386-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu,x86_64-softmmu"
+      os: osx
+      osx_image: xcode10
       compiler: clang
     # Python builds
     - env: CONFIG="--target-list=x86_64-softmmu"
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH v2 2/3] tests/tcg: make test-i386 test program compile on clang
  2018-10-09 14:59 [Qemu-devel] [PATCH v2 0/3] Travis tweaks and tcg test fixes Alex Bennée
  2018-10-09 14:59 ` [Qemu-devel] [PATCH v2 1/3] .travis.yml: split MacOSX builds and reduce target list Alex Bennée
@ 2018-10-09 14:59 ` Alex Bennée
  2018-10-09 14:59 ` [Qemu-devel] [PATCH v2 3/3] tests/tcg: disable enterN insn tests for test-i386 with clang Alex Bennée
  2 siblings, 0 replies; 6+ messages in thread
From: Alex Bennée @ 2018-10-09 14:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: famz, f4bug, Theodore Dubois, Alex Bennée, Paolo Bonzini,
	Richard Henderson, Eduardo Habkost

From: Theodore Dubois <tblodt@icloud.com>

Clang's assembler is slightly incompatible with GCC's assembler, which
caused the program to not compile on Clang for these reasons:

  - The "q" constraint was specified for an argument to the set
    instruction, which didn't work because Clang chose the esi register,
    which has no 8-bit form on i386.
  - Clang doesn't support size suffixes on the loop instructions.
    https://bugs.llvm.org/show_bug.cgi?id=33741
  - Clang requires a size suffix on the fist instruction.
  - Clang doesn't support specifying segment prefixes before the
    instruction, and requires specifying them on the address.
  - The arguments to the bound instruction are in the wrong order on
    Clang. https://bugs.llvm.org/show_bug.cgi?id=27653

Signed-off-by: Theodore Dubois <tblodt@icloud.com>
[AJB: tweaked title, add bugref]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/tcg/i386/test-i386.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c
index a29b41e764..c5f67000e4 100644
--- a/tests/tcg/i386/test-i386.c
+++ b/tests/tcg/i386/test-i386.c
@@ -368,7 +368,7 @@ void test_lea(void)
     asm("movl $0, %0\n\t"\
         "cmpl %2, %1\n\t"\
         "set" JCC " %b0\n\t"\
-        : "=r" (res)\
+        : "=q" (res)\
         : "r" (v1), "r" (v2));\
     printf("%-10s %d\n", "set" JCC, res);\
  if (TEST_CMOV) {\
@@ -490,15 +490,23 @@ void test_loop(void)
 
 #if !defined(__x86_64__)
     TEST_LOOP("jcxz");
+#if !defined(__clang__)
     TEST_LOOP("loopw");
     TEST_LOOP("loopzw");
     TEST_LOOP("loopnzw");
+#endif
 #endif
 
     TEST_LOOP("jecxz");
+#if !defined(__clang__)
     TEST_LOOP("loopl");
     TEST_LOOP("loopzl");
     TEST_LOOP("loopnzl");
+#else
+    TEST_LOOP("loop");
+    TEST_LOOP("loopz");
+    TEST_LOOP("loopnz");
+#endif
 }
 
 #undef CC_MASK
@@ -866,7 +874,7 @@ void test_fcvt(double a)
         uint16_t val16;
         val16 = (fpuc & ~0x0c00) | (i << 10);
         asm volatile ("fldcw %0" : : "m" (val16));
-        asm volatile ("fist %0" : "=m" (wa) : "t" (a));
+        asm volatile ("fists %0" : "=m" (wa) : "t" (a));
         asm volatile ("fistl %0" : "=m" (ia) : "t" (a));
         asm volatile ("fistpll %0" : "=m" (lla) : "t" (a) : "st");
         asm volatile ("frndint ; fstl %0" : "=m" (ra) : "t" (a));
@@ -1317,12 +1325,12 @@ void test_segs(void)
     seg_data1[1] = 0xaa;
     seg_data2[1] = 0x55;
 
-    asm volatile ("fs movzbl 0x1, %0" : "=r" (res));
+    asm volatile ("movzbl %%fs:0x1, %0" : "=r" (res));
     printf("FS[1] = %02x\n", res);
 
     asm volatile ("pushl %%gs\n"
                   "movl %1, %%gs\n"
-                  "gs movzbl 0x1, %0\n"
+                  "movzbl %%gs:0x1, %0\n"
                   "popl %%gs\n"
                   : "=r" (res)
                   : "r" (MK_SEL(2)));
@@ -1763,7 +1771,11 @@ void test_exceptions(void)
         /* bound exception */
         tab[0] = 1;
         tab[1] = 10;
+#if defined(__clang__)
+        asm volatile ("bound %1, %0" : : "r" (11), "m" (tab[0]));
+#else
         asm volatile ("bound %0, %1" : : "r" (11), "m" (tab[0]));
+#endif
     }
 #endif
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH v2 3/3] tests/tcg: disable enterN insn tests for test-i386 with clang
  2018-10-09 14:59 [Qemu-devel] [PATCH v2 0/3] Travis tweaks and tcg test fixes Alex Bennée
  2018-10-09 14:59 ` [Qemu-devel] [PATCH v2 1/3] .travis.yml: split MacOSX builds and reduce target list Alex Bennée
  2018-10-09 14:59 ` [Qemu-devel] [PATCH v2 2/3] tests/tcg: make test-i386 test program compile on clang Alex Bennée
@ 2018-10-09 14:59 ` Alex Bennée
  2018-10-09 15:48   ` Paolo Bonzini
  2 siblings, 1 reply; 6+ messages in thread
From: Alex Bennée @ 2018-10-09 14:59 UTC (permalink / raw)
  To: qemu-devel
  Cc: famz, f4bug, Alex Bennée, Paolo Bonzini, Richard Henderson,
	Eduardo Habkost

The enter[qwl] instructions aren't supported by clang's inline
assembler. Apply the hammer to work around it when we re-use our
system compiler to build tcg tests.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/tcg/i386/test-i386.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c
index c5f67000e4..da632c9b67 100644
--- a/tests/tcg/i386/test-i386.c
+++ b/tests/tcg/i386/test-i386.c
@@ -2098,6 +2098,7 @@ long enter_stack[4096];
 
 static void test_enter(void)
 {
+#if !(defined __clang__)
 #if defined(__x86_64__)
     TEST_ENTER("q", uint64_t, 0);
     TEST_ENTER("q", uint64_t, 1);
@@ -2114,6 +2115,7 @@ static void test_enter(void)
     TEST_ENTER("w", uint16_t, 1);
     TEST_ENTER("w", uint16_t, 2);
     TEST_ENTER("w", uint16_t, 31);
+#endif
 }
 
 #ifdef TEST_SSE
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH v2 3/3] tests/tcg: disable enterN insn tests for test-i386 with clang
  2018-10-09 14:59 ` [Qemu-devel] [PATCH v2 3/3] tests/tcg: disable enterN insn tests for test-i386 with clang Alex Bennée
@ 2018-10-09 15:48   ` Paolo Bonzini
  2018-10-09 16:35     ` Alex Bennée
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2018-10-09 15:48 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: famz, f4bug, Richard Henderson, Eduardo Habkost

On 09/10/2018 16:59, Alex Bennée wrote:
> The enter[qwl] instructions aren't supported by clang's inline
> assembler. Apply the hammer to work around it when we re-use our
> system compiler to build tcg tests.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Do you have a bug for this in llvm?  It doesn't seem to be a good idea.

Paolo

> ---
>  tests/tcg/i386/test-i386.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c
> index c5f67000e4..da632c9b67 100644
> --- a/tests/tcg/i386/test-i386.c
> +++ b/tests/tcg/i386/test-i386.c
> @@ -2098,6 +2098,7 @@ long enter_stack[4096];
>  
>  static void test_enter(void)
>  {
> +#if !(defined __clang__)
>  #if defined(__x86_64__)
>      TEST_ENTER("q", uint64_t, 0);
>      TEST_ENTER("q", uint64_t, 1);
> @@ -2114,6 +2115,7 @@ static void test_enter(void)
>      TEST_ENTER("w", uint16_t, 1);
>      TEST_ENTER("w", uint16_t, 2);
>      TEST_ENTER("w", uint16_t, 31);
> +#endif
>  }
>  
>  #ifdef TEST_SSE
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH v2 3/3] tests/tcg: disable enterN insn tests for test-i386 with clang
  2018-10-09 15:48   ` Paolo Bonzini
@ 2018-10-09 16:35     ` Alex Bennée
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Bennée @ 2018-10-09 16:35 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, famz, f4bug, Richard Henderson, Eduardo Habkost


Paolo Bonzini <pbonzini@redhat.com> writes:

> On 09/10/2018 16:59, Alex Bennée wrote:
>> The enter[qwl] instructions aren't supported by clang's inline
>> assembler. Apply the hammer to work around it when we re-use our
>> system compiler to build tcg tests.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>
> Do you have a bug for this in llvm?  It doesn't seem to be a good
> idea.

I thought I had an llvm bugzilla login but I can't find the details.
I'll have to a wait until an admin can add me.

>
> Paolo
>
>> ---
>>  tests/tcg/i386/test-i386.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c
>> index c5f67000e4..da632c9b67 100644
>> --- a/tests/tcg/i386/test-i386.c
>> +++ b/tests/tcg/i386/test-i386.c
>> @@ -2098,6 +2098,7 @@ long enter_stack[4096];
>>
>>  static void test_enter(void)
>>  {
>> +#if !(defined __clang__)
>>  #if defined(__x86_64__)
>>      TEST_ENTER("q", uint64_t, 0);
>>      TEST_ENTER("q", uint64_t, 1);
>> @@ -2114,6 +2115,7 @@ static void test_enter(void)
>>      TEST_ENTER("w", uint16_t, 1);
>>      TEST_ENTER("w", uint16_t, 2);
>>      TEST_ENTER("w", uint16_t, 31);
>> +#endif
>>  }
>>
>>  #ifdef TEST_SSE
>>


--
Alex Bennée

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-10-09 16:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 14:59 [Qemu-devel] [PATCH v2 0/3] Travis tweaks and tcg test fixes Alex Bennée
2018-10-09 14:59 ` [Qemu-devel] [PATCH v2 1/3] .travis.yml: split MacOSX builds and reduce target list Alex Bennée
2018-10-09 14:59 ` [Qemu-devel] [PATCH v2 2/3] tests/tcg: make test-i386 test program compile on clang Alex Bennée
2018-10-09 14:59 ` [Qemu-devel] [PATCH v2 3/3] tests/tcg: disable enterN insn tests for test-i386 with clang Alex Bennée
2018-10-09 15:48   ` Paolo Bonzini
2018-10-09 16:35     ` Alex Bennée

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.