summaryrefslogtreecommitdiffstats
path: root/kernel/arch/x86/mm/kmemcheck/pte.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/arch/x86/mm/kmemcheck/pte.c')
-rw-r--r--kernel/arch/x86/mm/kmemcheck/pte.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/arch/x86/mm/kmemcheck/pte.c b/kernel/arch/x86/mm/kmemcheck/pte.c
new file mode 100644
index 000000000..4ead26eea
--- /dev/null
+++ b/kernel/arch/x86/mm/kmemcheck/pte.c
@@ -0,0 +1,22 @@
+#include <linux/mm.h>
+
+#include <asm/pgtable.h>
+
+#include "pte.h"
+
+pte_t *kmemcheck_pte_lookup(unsigned long address)
+{
+ pte_t *pte;
+ unsigned int level;
+
+ pte = lookup_address(address, &level);
+ if (!pte)
+ return NULL;
+ if (level != PG_LEVEL_4K)
+ return NULL;
+ if (!pte_hidden(*pte))
+ return NULL;
+
+ return pte;
+}
+