[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] S/390 host fixed
From: |
Thiemo Seufer |
Subject: |
Re: [Qemu-devel] [PATCH] S/390 host fixed |
Date: |
Wed, 1 Aug 2007 00:59:15 +0100 |
User-agent: |
Mutt/1.5.16 (2007-06-11) |
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