public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@qumranet.com>
To: kvm-devel@lists.sourceforge.net
Cc: Avi Kivity <avi@qumranet.com>
Subject: mmdrop external module oops
Date: Wed, 20 Feb 2008 11:27:59 +0100	[thread overview]
Message-ID: <20080220102759.GT7128@v2.random> (raw)

A 2.6.25-rc based kernel spawned an oops in mmdrop when kvm quit so
that reminded me of this:

Signed-off-by: Andrea Arcangeli <andrea@qumranet.com>

diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h
index 20ef841..fd3cb1d 100644
--- a/kernel/external-module-compat.h
+++ b/kernel/external-module-compat.h
@@ -564,6 +564,11 @@ static inline void blahblah(void)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
 
 #define mmdrop(x) do { (void)(x); } while (0)
+#define mmget(x) do { (void)(x); } while (0)
+
+#else
+
+#define mmget(x) do { atomic_inc(x); } while (0)
 
 #endif
 
diff --git a/kernel/hack-module.awk b/kernel/hack-module.awk
index ad7a7c5..404944e 100644
--- a/kernel/hack-module.awk
+++ b/kernel/hack-module.awk
@@ -33,7 +33,7 @@
     vmx_load_host_state = 0
 }
 
-/atomic_inc\(&kvm->mm->mm_count\);/ { $0 = "//" $0 }
+/atomic_inc\(&kvm->mm->mm_count\);/ { $0 = "mmget(&kvm->mm->mm_count);" }
 
 /^\t\.fault = / {
     fcn = gensub(/,/, "", "g", $3)


-------------------------------------------------------------------------
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/

             reply	other threads:[~2008-02-20 10:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-20 10:27 Andrea Arcangeli [this message]
2008-02-20 14:10 ` mmdrop external module oops 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=20080220102759.GT7128@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