Skip to contentSkip to conversation

lib: add test module for CONFIG_DEBUG_VIRTUAL

PATCH New [email protected] 1 participant 1 message Sep 8, 2017 Library code

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 83/126 lib: add test module for CONFIG_DEBUG_VIRTUAL

From: Florian Fainelli <[email protected]>
Subject: lib: add test module for CONFIG_DEBUG_VIRTUAL

Add a test module that allows testing that CONFIG_DEBUG_VIRTUAL works correctly, at least that it can catch invalid calls to virt_to_phys() against the non-linear kernel virtual address map.

---

 lib/Kconfig.debug        |   11 ++++++++
 lib/Makefile             |    1 
 lib/test_debug_virtual.c |   49 +++++++++++++++++++++++++++++++++++++
 3 files changed, 61 insertions(+)
lib/Kconfig.debug renamed from lib/Kconfig.debug~lib-add-test-module-for-config_debug_virtual +11 -0
diff -puN lib/Kconfig.debug~lib-add-test-module-for-config_debug_virtual lib/Kconfig.debug
@@ -1930,6 +1930,17 @@ config TEST_KMOD
 
 	  If unsure, say N.
 
+config TEST_DEBUG_VIRTUAL
+	tristate "Test CONFIG_DEBUG_VIRTUAL feature"
+	depends on DEBUG_VIRTUAL
+	help
+	  Test the kernel's ability to detect incorrect calls to
+	  virt_to_phys() done against the non-linear part of the
+	  kernel's virtual address map.
+
+	  If unsure, say N.
+
+
 source "samples/Kconfig"
 
 source "lib/Kconfig.kgdb"
lib/Makefile renamed from lib/Makefile~lib-add-test-module-for-config_debug_virtual +1 -0
diff -puN lib/Makefile~lib-add-test-module-for-config_debug_virtual lib/Makefile
@@ -62,6 +62,7 @@ obj-$(CONFIG_TEST_BITMAP) += test_bitmap
 obj-$(CONFIG_TEST_UUID) += test_uuid.o
 obj-$(CONFIG_TEST_PARMAN) += test_parman.o
 obj-$(CONFIG_TEST_KMOD) += test_kmod.o
+obj-$(CONFIG_TEST_DEBUG_VIRTUAL) += test_debug_virtual.o
 
 ifeq ($(CONFIG_DEBUG_KOBJECT),y)
 CFLAGS_kobject.o += -DDEBUG
lib/test_debug_virtual.c new file +49 -0

49 lines not on this page · raw message

_