From: Andrea Arcangeli <andrea@qumranet.com>
To: kvm-devel@lists.sourceforge.net
Cc: Avi Kivity <avi@qumranet.com>
Subject: preempt emulation miscompile fix
Date: Tue, 12 Feb 2008 12:46:16 +0100 [thread overview]
Message-ID: <20080212114616.GP7051@v2.random> (raw)
Hello,
I tracked down the reason of my kernel crashing builds with the latest
kvm-userland package. It has taken a bit of time because with certain
workloads this wouldn't crash. I've been testing stuff with preempt
emulation enabled most of the time to be sure it worked (and to fix
the host breakpoint too). This will fix it by importing the task
struct before we define CONFIG_PREEMPT_NOTIFIERS. preempt.h is most
certainly unnecessary but it's a good rule of thumb to include
anything that uses CONFIG_PREEMPT_NOTIFIERS before defining it.
Signed-off-by: Andrea Arcangeli <andrea@qumranet.com>
diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h
index 3b45999..fe6108c 100644
--- a/kernel/external-module-compat.h
+++ b/kernel/external-module-compat.h
@@ -348,6 +348,12 @@ static inline unsigned long long __kvm_cmpxchg64(volatile void *ptr,
#endif
#ifndef CONFIG_PREEMPT_NOTIFIERS
+/*
+ * Include sched|preempt.h before defining CONFIG_PREEMPT_NOTIFIERS to avoid
+ * a miscompile.
+ */
+#include <linux/sched.h>
+#include <linux/preempt.h>
#define CONFIG_PREEMPT_NOTIFIERS
#define CONFIG_PREEMPT_NOTIFIERS_COMPAT
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
next reply other threads:[~2008-02-12 11:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-12 11:46 Andrea Arcangeli [this message]
2008-02-12 12:21 ` preempt emulation miscompile fix Avi Kivity
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=20080212114616.GP7051@v2.random \
--to=andrea@qumranet.com \
--cc=avi@qumranet.com \
--cc=kvm-devel@lists.sourceforge.net \
/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