From: "J. Mayer" <l_indien@magic.fr>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [RFC] Fix for random Qemu crashes
Date: Sun, 18 Nov 2007 16:48:10 +0100 [thread overview]
Message-ID: <1195400890.5335.80.camel@rapid> (raw)
[-- Attachment #1: Type: text/plain, Size: 369 bytes --]
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 <l_indien@magic.fr>
Never organized
[-- Attachment #2: always_inline.diff --]
[-- Type: text/x-patch, Size: 4374 bytes --]
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 <stdarg.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
+#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 <inttypes.h>
#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 <signal.h>
#include <string.h>
#include "cpu.h"
+#include "thunk.h"
+
#include "gdbstub.h"
typedef siginfo_t target_siginfo_t;
next reply other threads:[~2007-11-18 15:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-18 15:48 J. Mayer [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-11-15 23:18 [Qemu-devel] RFC: fix for random Qemu crashes J. Mayer
2007-11-15 23:49 ` andrzej zaborowski
2007-11-16 0:09 ` J. Mayer
2007-11-16 15:06 ` Heikki Lindholm
2007-11-16 15:35 ` Jocelyn Mayer
2007-11-16 15:42 ` Heikki Lindholm
2007-11-16 16:34 ` Jocelyn Mayer
2007-11-16 15:59 ` Jamie Lokier
2007-11-16 20:13 ` Jocelyn Mayer
2007-11-16 15:52 ` Paul Brook
2007-11-16 16:05 ` Jocelyn Mayer
2007-11-16 20:32 ` andrzej zaborowski
2007-11-17 0:04 ` J. Mayer
2007-11-17 10:57 ` andrzej zaborowski
2007-11-17 11:13 ` J. Mayer
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=1195400890.5335.80.camel@rapid \
--to=l_indien@magic.fr \
--cc=qemu-devel@nongnu.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).