Skip to content

Commit

Permalink
mm,kdb,kgdb: Add a debug reference for the kdb kmap usage
Browse files Browse the repository at this point in the history
The kdb kmap should never get used outside of the kernel debugger
exception context.

Signed-off-by: Jason Wessel<[email protected]>
CC: Andrew Morton <[email protected]>
CC: Ingo Molnar <[email protected]>
CC: [email protected]
  • Loading branch information
jwessel committed Aug 5, 2010
1 parent 9264b27 commit eac7900
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/init.h>
#include <linux/hash.h>
#include <linux/highmem.h>
#include <linux/kgdb.h>
#include <asm/tlbflush.h>

/*
Expand Down Expand Up @@ -470,6 +471,12 @@ void debug_kmap_atomic(enum km_type type)
warn_count--;
}
}
#ifdef CONFIG_KGDB_KDB
if (unlikely(type == KM_KDB && atomic_read(&kgdb_active) == -1)) {
WARN_ON(1);
warn_count--;
}
#endif /* CONFIG_KGDB_KDB */
}

#endif

0 comments on commit eac7900

Please sign in to comment.