qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Ilya Leoshkevich <iii@linux.ibm.com>
Cc: qemu-s390x <qemu-s390x@nongnu.org>,
	Richard Henderson <richard.henderson@linaro.org>,
	David Hildenbrand <david@redhat.com>
Subject: Re: [PULL 4/8] tests/tcg/s390x: Test BRASL and BRCL with large negative offsets
Date: Mon, 2 May 2022 15:43:57 +0200	[thread overview]
Message-ID: <ca60af14-baf0-be2d-1062-25de76c76c02@redhat.com> (raw)
In-Reply-To: <20220315112052.515467-5-thuth@redhat.com>

On 15/03/2022 12.20, Thomas Huth wrote:
> From: Ilya Leoshkevich <iii@linux.ibm.com>
> 
> Add a small test in order to prevent regressions.
> 
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> Message-Id: <20220314104232.675863-4-iii@linux.ibm.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Reviewed-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   tests/tcg/s390x/Makefile.target        |  1 +
>   tests/tcg/s390x/branch-relative-long.c | 68 ++++++++++++++++++++++++++
>   2 files changed, 69 insertions(+)
>   create mode 100644 tests/tcg/s390x/branch-relative-long.c
> 
> diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
> index 7aa502a557..f0d474a245 100644
> --- a/tests/tcg/s390x/Makefile.target
> +++ b/tests/tcg/s390x/Makefile.target
> @@ -15,6 +15,7 @@ TESTS+=mvc
>   TESTS+=shift
>   TESTS+=trap
>   TESTS+=signals-s390x
> +TESTS+=branch-relative-long
>   
>   ifneq ($(HAVE_GDB_BIN),)
>   GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
> diff --git a/tests/tcg/s390x/branch-relative-long.c b/tests/tcg/s390x/branch-relative-long.c
> new file mode 100644
> index 0000000000..94219afcad
> --- /dev/null
> +++ b/tests/tcg/s390x/branch-relative-long.c
> @@ -0,0 +1,68 @@
> +#include <stddef.h>
> +#include <stdio.h>
> +#include <string.h>
> +#include <sys/mman.h>
> +
> +#define DEFINE_ASM(_name, _code) \
> +    extern const char _name[]; \
> +    extern const char _name ## _end[]; \
> +    asm("    .globl " #_name "\n" \
> +        #_name ":\n" \
> +        "    " _code "\n" \
> +        "    .globl " #_name "_end\n" \
> +        #_name "_end:\n");
> +
> +DEFINE_ASM(br_r14, "br %r14");
> +DEFINE_ASM(brasl_r0, "brasl %r0,.-0x100000000");
> +DEFINE_ASM(brcl_0xf, "brcl 0xf,.-0x100000000");

  Hi Ilya,

I just noticed that this does not compile with Clang
(version 13.0.1):

<inline asm>:8:15: error: offset out of range
     brasl %r0,.-0x100000000
               ^
<inline asm>:13:14: error: offset out of range
     brcl 0xf,.-0x100000000
              ^
2 errors generated.

Any ideas how to fix this? Could we decrease the offset a little bit? Or 
maybe detect Clang and run with -no-integrated-as in that case?

  Thomas



  reply	other threads:[~2022-05-02 13:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 11:20 [PULL 0/8] s390x and misc fixes Thomas Huth
2022-03-15 11:20 ` [PULL 1/8] tests/tcg: drop -cpu max from s390x sha512-mvx invocation Thomas Huth
2022-03-15 11:20 ` [PULL 2/8] s390x/tcg: Fix BRASL with a large negative offset Thomas Huth
2022-03-15 11:20 ` [PULL 3/8] s390x/tcg: Fix BRCL " Thomas Huth
2022-03-15 11:20 ` [PULL 4/8] tests/tcg/s390x: Test BRASL and BRCL with large negative offsets Thomas Huth
2022-05-02 13:43   ` Thomas Huth [this message]
2022-03-15 11:20 ` [PULL 5/8] tests/avocado: start PhoneServer upfront Thomas Huth
2022-03-15 11:20 ` [PULL 6/8] accel/tcg: Fix cpu_ldq_be_mmu typo Thomas Huth
2022-03-15 11:20 ` [PULL 7/8] softmmu: List CPU types again Thomas Huth
2022-03-15 11:20 ` [PULL 8/8] meson: Update to version 0.61.3 Thomas Huth
2022-03-15 18:58 ` [PULL 0/8] s390x and misc fixes Peter Maydell
2022-03-15 19:30   ` Peter Maydell
2022-03-16  7:35     ` Thomas Huth
2022-03-16 12:14     ` Paolo Bonzini
2022-03-16 12:18   ` Paolo Bonzini
2022-03-16 13:19     ` Peter Maydell
2022-03-16 14:26       ` Paolo Bonzini
2022-03-16 12:30   ` Paolo Bonzini

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=ca60af14-baf0-be2d-1062-25de76c76c02@redhat.com \
    --to=thuth@redhat.com \
    --cc=david@redhat.com \
    --cc=iii@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@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).