Skip to content

Commit eac7900

Browse files
committed
mm,kdb,kgdb: Add a debug reference for the kdb kmap usage
The kdb kmap should never get used outside of the kernel debugger exception context. Signed-off-by: Jason Wessel<jason.wessel@windriver.com> CC: Andrew Morton <akpm@linux-foundation.org> CC: Ingo Molnar <mingo@elte.hu> CC: linux-mm@kvack.org
1 parent 9264b27 commit eac7900

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎mm/highmem.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <linux/init.h>
2727
#include <linux/hash.h>
2828
#include <linux/highmem.h>
29+
#include <linux/kgdb.h>
2930
#include <asm/tlbflush.h>
3031

3132
/*
@@ -470,6 +471,12 @@ void debug_kmap_atomic(enum km_type type)
470471
warn_count--;
471472
}
472473
}
474+
#ifdef CONFIG_KGDB_KDB
475+
if (unlikely(type == KM_KDB && atomic_read(&kgdb_active) == -1)) {
476+
WARN_ON(1);
477+
warn_count--;
478+
}
479+
#endif /* CONFIG_KGDB_KDB */
473480
}
474481

475482
#endif

0 commit comments

Comments
 (0)