mirror of https://gitee.com/openkylin/linux.git
x86: prepare for the unification of the cpa code
prepare for the unification of the cpa code, by unifying the lookup_address() logic between 32-bit and 64-bit. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
55ce29ba16
commit
bbb09f5cfc
|
@ -20,10 +20,10 @@ enum {
|
||||||
LOWEST_LEVEL = 4,
|
LOWEST_LEVEL = 4,
|
||||||
LPS = (1 << PMD_SHIFT),
|
LPS = (1 << PMD_SHIFT),
|
||||||
#elif defined(CONFIG_X86_PAE)
|
#elif defined(CONFIG_X86_PAE)
|
||||||
LOWEST_LEVEL = 3,
|
LOWEST_LEVEL = 4,
|
||||||
LPS = (1 << PMD_SHIFT),
|
LPS = (1 << PMD_SHIFT),
|
||||||
#else
|
#else
|
||||||
LOWEST_LEVEL = 3, /* lookup_address lies here */
|
LOWEST_LEVEL = 4, /* lookup_address lies here */
|
||||||
LPS = (1 << 22),
|
LPS = (1 << 22),
|
||||||
#endif
|
#endif
|
||||||
GPS = (1<<30)
|
GPS = (1<<30)
|
||||||
|
|
|
@ -29,10 +29,10 @@ pte_t *lookup_address(unsigned long address, int *level)
|
||||||
pmd = pmd_offset(pud, address);
|
pmd = pmd_offset(pud, address);
|
||||||
if (pmd_none(*pmd))
|
if (pmd_none(*pmd))
|
||||||
return NULL;
|
return NULL;
|
||||||
*level = 2;
|
*level = 3;
|
||||||
if (pmd_large(*pmd))
|
if (pmd_large(*pmd))
|
||||||
return (pte_t *)pmd;
|
return (pte_t *)pmd;
|
||||||
*level = 3;
|
*level = 4;
|
||||||
|
|
||||||
return pte_offset_kernel(pmd, address);
|
return pte_offset_kernel(pmd, address);
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ static int __change_page_attr(struct page *page, pgprot_t prot)
|
||||||
address < (unsigned long)&_etext &&
|
address < (unsigned long)&_etext &&
|
||||||
(pgprot_val(prot) & _PAGE_NX));
|
(pgprot_val(prot) & _PAGE_NX));
|
||||||
|
|
||||||
if (level == 3) {
|
if (level == 4) {
|
||||||
set_pte_atomic(kpte, mk_pte(page, canon_pgprot(prot)));
|
set_pte_atomic(kpte, mk_pte(page, canon_pgprot(prot)));
|
||||||
} else {
|
} else {
|
||||||
err = split_large_page(kpte, address);
|
err = split_large_page(kpte, address);
|
||||||
|
|
Loading…
Reference in New Issue