From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IG1sw-00087w-C9 for qemu-devel@nongnu.org; Tue, 31 Jul 2007 20:16:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IG1su-00084b-QA for qemu-devel@nongnu.org; Tue, 31 Jul 2007 20:16:18 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IG1su-00084M-NR for qemu-devel@nongnu.org; Tue, 31 Jul 2007 20:16:16 -0400 Received: from phoenix.bawue.net ([193.7.176.60] helo=mail.bawue.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IG1su-0003pN-9D for qemu-devel@nongnu.org; Tue, 31 Jul 2007 20:16:16 -0400 Date: Wed, 1 Aug 2007 00:59:15 +0100 From: Thiemo Seufer Subject: Re: [Qemu-devel] [PATCH] S/390 host fixed Message-ID: <20070731235915.GL26960@networkno.de> References: <200707301349.26745.uli@suse.de> <200707301605.47719.uli@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200707301605.47719.uli@suse.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ulrich Hecht Cc: qemu-devel@nongnu.org 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