qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Eduardo Habkost" <ehabkost@redhat.com>
Subject: [PATCH v1 6/6] tests/i386/test-i386: try and correct constrain 16 bit call (WIP)
Date: Mon, 29 Mar 2021 12:03:03 +0100	[thread overview]
Message-ID: <20210329110303.15235-7-alex.bennee@linaro.org> (raw)
In-Reply-To: <20210329110303.15235-1-alex.bennee@linaro.org>

Newer compilers complain about non-matching constraints:

  test-i386.c:1393:5: error: asm operand 2 probably doesn’t match constraints [-Werror]
   1393 |     asm volatile ("lcall %1, %2"
        |     ^~~

It seems the plain "i" immediate constraint is a little too lax here.
What we are actually dealing with is a 32 bit offset into a particular
segment. I think that is "Ts" (Address operand without segment
register).

[AJB: however this just seems to push it a bit further down the road:

test-i386.c:1393: Error: operand type mismatch for `lcall'

Inline ASM constraints are hard :-/]

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

diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c
index 18d5609665..6d8aeccfb5 100644
--- a/tests/tcg/i386/test-i386.c
+++ b/tests/tcg/i386/test-i386.c
@@ -1392,15 +1392,15 @@ void test_code16(void)
     /* call the first function */
     asm volatile ("lcall %1, %2"
                   : "=a" (res)
-                  : "i" (MK_SEL(1)), "i" (&code16_func1): "memory", "cc");
+                  : "i" (MK_SEL(1)), "Ts" (&code16_func1): "memory", "cc");
     printf("func1() = 0x%08x\n", res);
     asm volatile ("lcall %2, %3"
                   : "=a" (res), "=c" (res2)
-                  : "i" (MK_SEL(1)), "i" (&code16_func2): "memory", "cc");
+                  : "i" (MK_SEL(1)), "Ts" (&code16_func2): "memory", "cc");
     printf("func2() = 0x%08x spdec=%d\n", res, res2);
     asm volatile ("lcall %1, %2"
                   : "=a" (res)
-                  : "i" (MK_SEL(1)), "i" (&code16_func3): "memory", "cc");
+                  : "i" (MK_SEL(1)), "Ts" (&code16_func3): "memory", "cc");
     printf("func3() = 0x%08x\n", res);
 }
 #endif
-- 
2.20.1



  parent reply	other threads:[~2021-03-29 11:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 11:02 [PATCH for 6.0-rc2? v1 0/6] check-tcg for non-x86 hosts Alex Bennée
2021-03-29 11:02 ` [PATCH v1 1/6] tests/tcg: update the defaults for x86 compilers Alex Bennée
2021-03-30 15:24   ` Richard Henderson
2021-03-29 11:02 ` [PATCH v1 2/6] tests/docker: don't set DOCKER_REGISTRY on non-x86_64 Alex Bennée
2021-03-29 11:36   ` Thomas Huth
2021-03-29 14:37   ` Willian Rampazzo
2021-03-30 15:24   ` Richard Henderson
2021-03-31 12:32   ` Philippe Mathieu-Daudé
2021-03-31 14:57     ` Alex Bennée
2021-03-29 11:03 ` [PATCH v1 3/6] tests/tcg: add concept of container_hosts Alex Bennée
2021-03-29 11:03 ` [PATCH v1 4/6] tests/tcg/configure.sh: make sure we pick up x86_64 cross compilers Alex Bennée
2021-03-29 11:03 ` [PATCH v1 5/6] tests/tcg/i386: expand .data sections for system tests Alex Bennée
2021-03-29 11:39   ` Thomas Huth
2021-03-30 15:27   ` Richard Henderson
2021-03-29 11:03 ` Alex Bennée [this message]
2021-03-30 15:58   ` [PATCH v1 6/6] tests/i386/test-i386: try and correct constrain 16 bit call (WIP) Richard Henderson
2021-03-30 18:20     ` Alex Bennée
2021-03-30 20:25       ` Richard Henderson
2021-03-30 20:46         ` Peter Maydell
2021-03-30 21:18           ` Richard Henderson
2021-03-29 11:12 ` [PATCH for 6.0-rc2? v1 0/6] check-tcg for non-x86 hosts no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210329110303.15235-7-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).