提交 f8b4ece2 编写于 作者: P Pekka Enberg 提交者: Vegard Nossum

kmemcheck: use kmemcheck_pte_lookup() instead of open-coding it

Lets use kmemcheck_pte_lookup() in kmemcheck_fault() instead of
open-coding it there.
Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
上级 6d9609c1
......@@ -611,7 +611,6 @@ bool kmemcheck_fault(struct pt_regs *regs, unsigned long address,
unsigned long error_code)
{
pte_t *pte;
unsigned int level;
/*
* XXX: Is it safe to assume that memory accesses from virtual 86
......@@ -624,13 +623,9 @@ bool kmemcheck_fault(struct pt_regs *regs, unsigned long address,
if (regs->cs != __KERNEL_CS)
return false;
pte = lookup_address(address, &level);
pte = kmemcheck_pte_lookup(address);
if (!pte)
return false;
if (level != PG_LEVEL_4K)
return false;
if (!pte_hidden(*pte))
return false;
if (error_code & 2)
kmemcheck_access(regs, address, KMEMCHECK_WRITE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册