public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* preempt emulation miscompile fix
@ 2008-02-12 11:46 Andrea Arcangeli
  2008-02-12 12:21 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Andrea Arcangeli @ 2008-02-12 11:46 UTC (permalink / raw)
  To: kvm-devel; +Cc: Avi Kivity

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/

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-12 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-12 11:46 preempt emulation miscompile fix Andrea Arcangeli
2008-02-12 12:21 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox