mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-24 05:04:00 +08:00
x86: change 64-bit __change_page_attr() to struct page
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
34eff1d75b
commit
0d82494ebd
@ -67,7 +67,7 @@ split_large_page(unsigned long address, pgprot_t ref_prot)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
__change_page_attr(unsigned long address, unsigned long pfn, pgprot_t prot)
|
__change_page_attr(unsigned long address, struct page *page, pgprot_t prot)
|
||||||
{
|
{
|
||||||
struct page *kpte_page;
|
struct page *kpte_page;
|
||||||
pte_t *kpte;
|
pte_t *kpte;
|
||||||
@ -86,7 +86,7 @@ repeat:
|
|||||||
prot = canon_pgprot(prot);
|
prot = canon_pgprot(prot);
|
||||||
|
|
||||||
if (level == 4) {
|
if (level == 4) {
|
||||||
set_pte(kpte, pfn_pte(pfn, prot));
|
set_pte(kpte, mk_pte(page, prot));
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* split_large_page will take the reference for this
|
* split_large_page will take the reference for this
|
||||||
@ -135,7 +135,7 @@ int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot)
|
|||||||
unsigned long pfn = __pa(address) >> PAGE_SHIFT;
|
unsigned long pfn = __pa(address) >> PAGE_SHIFT;
|
||||||
|
|
||||||
if (!kernel_map || pte_present(pfn_pte(0, prot))) {
|
if (!kernel_map || pte_present(pfn_pte(0, prot))) {
|
||||||
err = __change_page_attr(address, pfn, prot);
|
err = __change_page_attr(address, pfn_to_page(pfn), prot);
|
||||||
if (err)
|
if (err)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ int change_page_attr_addr(unsigned long address, int numpages, pgprot_t prot)
|
|||||||
addr2 = __START_KERNEL_map + __pa(address);
|
addr2 = __START_KERNEL_map + __pa(address);
|
||||||
/* Make sure the kernel mappings stay executable */
|
/* Make sure the kernel mappings stay executable */
|
||||||
prot2 = pte_pgprot(pte_mkexec(pfn_pte(0, prot)));
|
prot2 = pte_pgprot(pte_mkexec(pfn_pte(0, prot)));
|
||||||
err = __change_page_attr(addr2, pfn, prot2);
|
err = __change_page_attr(addr2, pfn_to_page(pfn), prot2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
up_write(&init_mm.mmap_sem);
|
up_write(&init_mm.mmap_sem);
|
||||||
|
Loading…
Reference in New Issue
Block a user