qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thiemo Seufer <ths@networkno.de>
To: Ulrich Hecht <uli@suse.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] S/390 host fixed
Date: Wed, 1 Aug 2007 00:59:15 +0100	[thread overview]
Message-ID: <20070731235915.GL26960@networkno.de> (raw)
In-Reply-To: <200707301605.47719.uli@suse.de>

Ulrich Hecht wrote:
> On Monday 30 July 2007 13:49, Ulrich Hecht wrote:
> > S/390 host support has been broken for a long time (since 0.4.2 or
> > something like that). I finally got around to fix it, adding
> > disassembly support on the way.
> 
> And here's an even better patch that also fixes non-i386 targets. MIPS 
> needs a little workaround to keep GCC from creating a jump table, 
> something that dyngen cannot handle. Alpha does not build because of an 
> ICE.

I committed the bits I were comfortable with, which left those:

[snip]
> @@ -300,7 +300,7 @@
>  if [ "$bsd" = "yes" -o "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
>      AIOLIBS=
>  else
> -    AIOLIBS="-lrt"
> +    AIOLIBS="-lrt -lpthread"

Why is this needed? Linux toolchains should add -lpthread implicitly.

[snip]
> diff -ruN qemu/target-alpha/op_helper.c qemu-s390/target-alpha/op_helper.c
> --- qemu/target-alpha/op_helper.c	2007-04-05 06:58:33.000000000 +0000
> +++ qemu-s390/target-alpha/op_helper.c	2007-07-30 12:16:31.000000000 +0000
> @@ -1229,6 +1229,9 @@
>      CPUState *saved_env;
>      target_phys_addr_t pc;
>      int ret;
> +#ifdef __s390__
> +    retaddr = (void*)((unsigned long)retaddr & 0x7fffffffUL);
> +#endif

All of those look weird. Is this a null-extension vs. sign-extension
issue?

[snip]
> diff -ruN qemu/target-i386/translate.c qemu-s390/target-i386/translate.c
> --- qemu/target-i386/translate.c	2007-06-26 08:35:18.000000000 +0000
> +++ qemu-s390/target-i386/translate.c	2007-07-30 13:57:39.000000000 +0000
> @@ -1795,7 +1795,11 @@
>          case CC_OP_SUBW:
>          case CC_OP_SUBL:
>          case CC_OP_SUBQ:
> +#ifdef __s390__
> +            func = NULL; /* does not work on S/390 for unknown reasons */
> +#else
>              func = gen_jcc_sub[s->cc_op - CC_OP_SUBB][jcc_op];
> +#endif

Hum. It wold be good to know what happens here.

[snip]
> diff -ruN qemu/target-mips/op.c qemu-s390/target-mips/op.c
> --- qemu/target-mips/op.c	2007-06-25 17:34:33.000000000 +0000
> +++ qemu-s390/target-mips/op.c	2007-07-30 13:34:08.000000000 +0000
> @@ -1616,6 +1616,18 @@
>  
>  void op_cfc1 (void)
>  {
> +#ifdef __s390__
> +    if(!T1)
> +        T0 = (int32_t)env->fcr0;
> +    else if(T1 == 25)
> +        T0 = ((env->fcr31 >> 24) & 0xfe) | ((env->fcr31 >> 23) & 0x1);
> +    else if(T1 == 26)
> +        T0 = env->fcr31 & 0x0003f07c;
> +    else if(T1 == 28)
> +        T0 = (env->fcr31 & 0x00000f83) | ((env->fcr31 >> 22) & 0x4);
> +    else
> +        T0 = (int32_t)env->fcr31;
> +#else    

I guess this breaks when you _breathe_ at the compiler. Inventing
switch-table support in dyngen would be preferable (if possible...).


Thiemo

  reply	other threads:[~2007-08-01  0:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-30 11:49 [Qemu-devel] [PATCH] S/390 host fixed Ulrich Hecht
2007-07-30 12:37 ` Sunil Amitkumar Janki
2007-07-30 14:05 ` Ulrich Hecht
2007-07-31 23:59   ` Thiemo Seufer [this message]
2007-08-01  1:02     ` Paul Brook
2007-08-01 13:58       ` Dan Shearer
2007-08-01 14:23         ` [Qemu-devel] replacing dyngen (was: S/390 host fixed) Paul Brook
2007-08-01 14:31           ` Dan Shearer
2007-08-01 14:47             ` Paul Brook
2007-08-01 13:44     ` [Qemu-devel] [PATCH] S/390 host fixed Ulrich Hecht
2007-09-13  4:21       ` Thiemo Seufer

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=20070731235915.GL26960@networkno.de \
    --to=ths@networkno.de \
    --cc=qemu-devel@nongnu.org \
    --cc=uli@suse.de \
    /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).