summaryrefslogtreecommitdiff
path: root/arch/x86/mm/kmemcheck/pte.c
blob: 8a03be90272a938012419086572092f16561039c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// SPDX-License-Identifier: GPL-2.0
#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;
}