Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=63c1dcf4bc9a26b1d8baa9a8c7cc1b2e1e694011 Commit: 63c1dcf4bc9a26b1d8baa9a8c7cc1b2e1e694011 Parent: 626c2c9d065da0cbd9997e112501487958fde690 Author: Thomas Gleixner <[EMAIL PROTECTED]> AuthorDate: Mon Feb 4 16:48:05 2008 +0100 Committer: Ingo Molnar <[EMAIL PROTECTED]> CommitDate: Mon Feb 4 16:48:05 2008 +0100
x86: CPA use the existing pfn in split as well When splitting large pages, we ge the pfn from the existing entry instead of calculating it ourself. This removes the last remaining range restriction of the cpa code. Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]> Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]> --- arch/x86/mm/pageattr.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 6c55fbd..a629cea 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -221,8 +221,7 @@ static int split_large_page(pte_t *kpte, unsigned long address) { pgprot_t ref_prot = pte_pgprot(pte_clrhuge(*kpte)); gfp_t gfp_flags = GFP_KERNEL; - unsigned long flags; - unsigned long addr; + unsigned long flags, addr, pfn; pte_t *pbase, *tmp; struct page *base; unsigned int i, level; @@ -253,8 +252,12 @@ static int split_large_page(pte_t *kpte, unsigned long address) paravirt_alloc_pt(&init_mm, page_to_pfn(base)); #endif - for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) - set_pte(&pbase[i], pfn_pte(addr >> PAGE_SHIFT, ref_prot)); + /* + * Get the target pfn from the original entry: + */ + pfn = pte_pfn(*kpte); + for (i = 0; i < PTRS_PER_PTE; i++, pfn++) + set_pte(&pbase[i], pfn_pte(pfn, ref_prot)); /* * Install the new, split up pagetable. Important detail here: - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html