提交 3fbfb458 编写于 作者: M Mike Rapoport 提交者: Thomas Bogendoerfer

mips: define pud_index() regardless of page table folding

Commit 31168f03 ("mips: drop __pXd_offset() macros that duplicate
pXd_index() ones") is correct that pud_index() & __pud_offset() are the
same when pud_index() is actually provided, however it does not take into
account the __PAGETABLE_PUD_FOLDED case. This has broken MIPS KVM
compilation because it relied on availability of pud_index().

Define pud_index() regardless of page table folded. It will evaluate to
actual index for 4-level pagetables and to 0 for folded PUD level.

Link: https://lore.kernel.org/lkml/20200331154749.5457-1-pbonzini@redhat.comReported-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NMike Rapoport <rppt@linux.ibm.com>
Tested-by: NHuacai Chen <chenhc@lemote.com>
Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
上级 de0c4eb4
......@@ -172,6 +172,8 @@
extern pte_t invalid_pte_table[PTRS_PER_PTE];
#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
#ifndef __PAGETABLE_PUD_FOLDED
/*
* For 4-level pagetables we defines these ourselves, for 3-level the
......@@ -210,8 +212,6 @@ static inline void p4d_clear(p4d_t *p4dp)
p4d_val(*p4dp) = (unsigned long)invalid_pud_table;
}
#define pud_index(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
static inline unsigned long p4d_page_vaddr(p4d_t p4d)
{
return p4d_val(p4d);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册