From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ItmNm-0004Y5-OI for qemu-devel@nongnu.org; Sun, 18 Nov 2007 10:48:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ItmNl-0004TH-BY for qemu-devel@nongnu.org; Sun, 18 Nov 2007 10:48:25 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ItmNk-0004Sv-U9 for qemu-devel@nongnu.org; Sun, 18 Nov 2007 10:48:25 -0500 Received: from bangui.magic.fr ([195.154.194.245]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ItmNk-0006Z4-A6 for qemu-devel@nongnu.org; Sun, 18 Nov 2007 10:48:24 -0500 Received: from [192.168.0.2] (ppp-36.net-123.static.magiconline.fr [80.118.184.36]) by bangui.magic.fr (8.13.1/8.13.1) with ESMTP id lAIFm7jk013326 for ; Sun, 18 Nov 2007 16:48:07 +0100 From: "J. Mayer" Content-Type: multipart/mixed; boundary="=-ynw1izharE66AT2ePmcM" Date: Sun, 18 Nov 2007 16:48:10 +0100 Message-Id: <1195400890.5335.80.camel@rapid> Mime-Version: 1.0 Subject: [Qemu-devel] [RFC] Fix for random Qemu crashes Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-ynw1izharE66AT2ePmcM Content-Type: text/plain Content-Transfer-Encoding: 7bit Here's an updated patch to fix the inlining problems that make some Qemu targets crash randomly. As we have at least one broken target in the CVS because of this bug (and maybe more), we have an urgent need of a fix. I'll then commit this patch today if there is no other fix proposed that actually solves the problem. -- J. Mayer Never organized --=-ynw1izharE66AT2ePmcM Content-Disposition: attachment; filename=always_inline.diff Content-Type: text/x-patch; name=always_inline.diff; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Index: exec-all.h =================================================================== RCS file: /sources/qemu/qemu/exec-all.h,v retrieving revision 1.70 diff -u -d -d -p -r1.70 exec-all.h --- exec-all.h 4 Nov 2007 02:24:57 -0000 1.70 +++ exec-all.h 18 Nov 2007 15:44:16 -0000 @@ -21,36 +21,6 @@ /* allow to see translation results - the slowdown should be negligible, so we leave it */ #define DEBUG_DISAS -#ifndef glue -#define xglue(x, y) x ## y -#define glue(x, y) xglue(x, y) -#define stringify(s) tostring(s) -#define tostring(s) #s -#endif - -#ifndef likely -#if __GNUC__ < 3 -#define __builtin_expect(x, n) (x) -#endif - -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#endif - -#ifndef always_inline -#if (__GNUC__ < 3) || defined(__APPLE__) -#define always_inline inline -#else -#define always_inline __attribute__ (( always_inline )) inline -#endif -#endif - -#ifdef __i386__ -#define REGPARM(n) __attribute((regparm(n))) -#else -#define REGPARM(n) -#endif - /* is_jmp field values */ #define DISAS_NEXT 0 /* next instruction can be analyzed */ #define DISAS_JUMP 1 /* only pc was modified dynamically */ Index: osdep.h =================================================================== RCS file: /sources/qemu/qemu/osdep.h,v retrieving revision 1.10 diff -u -d -d -p -r1.10 osdep.h --- osdep.h 7 Jun 2007 23:09:47 -0000 1.10 +++ osdep.h 18 Nov 2007 15:44:16 -0000 @@ -3,6 +3,44 @@ #include +#ifndef glue +#define xglue(x, y) x ## y +#define glue(x, y) xglue(x, y) +#define stringify(s) tostring(s) +#define tostring(s) #s +#endif + +#ifndef likely +#if __GNUC__ < 3 +#define __builtin_expect(x, n) (x) +#endif + +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) +#endif + +#ifndef MIN +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif +#ifndef MAX +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#endif + +#ifndef always_inline +#if (__GNUC__ < 3) || defined(__APPLE__) +#define always_inline inline +#else +#define always_inline __attribute__ (( always_inline )) __inline__ +#endif +#endif +#define inline always_inline + +#ifdef __i386__ +#define REGPARM(n) __attribute((regparm(n))) +#else +#define REGPARM(n) +#endif + #define qemu_printf printf void *qemu_malloc(size_t size); Index: qemu-common.h =================================================================== RCS file: /sources/qemu/qemu/qemu-common.h,v retrieving revision 1.2 diff -u -d -d -p -r1.2 qemu-common.h --- qemu-common.h 17 Nov 2007 17:14:38 -0000 1.2 +++ qemu-common.h 18 Nov 2007 15:44:16 -0000 @@ -62,37 +62,6 @@ static inline char *realpath(const char #endif /* !defined(NEED_CPU_H) */ -#ifndef glue -#define xglue(x, y) x ## y -#define glue(x, y) xglue(x, y) -#define stringify(s) tostring(s) -#define tostring(s) #s -#endif - -#ifndef likely -#if __GNUC__ < 3 -#define __builtin_expect(x, n) (x) -#endif - -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#endif - -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif -#ifndef MAX -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef always_inline -#if (__GNUC__ < 3) || defined(__APPLE__) -#define always_inline inline -#else -#define always_inline __attribute__ (( always_inline )) inline -#endif -#endif - /* bottom halves */ typedef struct QEMUBH QEMUBH; Index: translate-op.c =================================================================== RCS file: /sources/qemu/qemu/translate-op.c,v retrieving revision 1.3 diff -u -d -d -p -r1.3 translate-op.c --- translate-op.c 18 Nov 2007 01:44:36 -0000 1.3 +++ translate-op.c 18 Nov 2007 15:44:16 -0000 @@ -24,6 +24,7 @@ #include #include "config.h" +#include "osdep.h" enum { #define DEF(s, n, copy_size) INDEX_op_ ## s, Index: darwin-user/qemu.h =================================================================== RCS file: /sources/qemu/qemu/darwin-user/qemu.h,v retrieving revision 1.1 diff -u -d -d -p -r1.1 qemu.h --- darwin-user/qemu.h 18 Jan 2007 20:06:33 -0000 1.1 +++ darwin-user/qemu.h 18 Nov 2007 15:44:16 -0000 @@ -1,13 +1,13 @@ #ifndef GEMU_H #define GEMU_H -#include "thunk.h" - #include #include #include "cpu.h" +#include "thunk.h" + #include "gdbstub.h" typedef siginfo_t target_siginfo_t; --=-ynw1izharE66AT2ePmcM--