[PATCH] [12/12] GBPAGES: Switch direct mapping setup over to set_pte

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <tglx@...>, <mingo@...>, <linux-kernel@...>
Date: Friday, February 1, 2008 - 5:53 am

[Actually not needed for gbpages, but an indepedent, but related cleanup]

Use set_pte() for setting up the 2MB pages in the direct mapping similar 
to what the earlier GBPAGES patches did for the 1GB PUDs.

Signed-off-by: Andi Kleen <ak@suse.de>

---
 arch/x86/mm/init_64.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Index: linux/arch/x86/mm/init_64.c
===================================================================
--- linux.orig/arch/x86/mm/init_64.c
+++ linux/arch/x86/mm/init_64.c
@@ -289,7 +289,6 @@ phys_pmd_init(pmd_t *pmd_page, unsigned 
 	int i = pmd_index(address);
 
 	for (; i < PTRS_PER_PMD; i++, address += PMD_SIZE) {
-		unsigned long entry;
 		pmd_t *pmd = pmd_page + pmd_index(address);
 
 		if (address >= end) {
@@ -303,9 +302,8 @@ phys_pmd_init(pmd_t *pmd_page, unsigned 
 		if (pmd_val(*pmd))
 			continue;
 
-		entry = __PAGE_KERNEL_LARGE|_PAGE_GLOBAL|address;
-		entry &= __supported_pte_mask;
-		set_pmd(pmd, __pmd(entry));
+		set_pte((pte_t *)pmd,
+			pfn_pte(address >> PAGE_SHIFT, PAGE_KERNEL_LARGE));
 	}
 }
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] [0/12] GBPAGES patchkit for 2.6.25 v3, Andi Kleen, (Fri Feb 1, 5:53 am)
Re: [PATCH] [0/12] GBPAGES patchkit for 2.6.25 v3, Thomas Gleixner, (Fri Feb 1, 8:25 am)
[PATCH] [12/12] GBPAGES: Switch direct mapping setup over to..., Andi Kleen, (Fri Feb 1, 5:53 am)
Re: [PATCH] [12/12] GBPAGES: Switch direct mapping setup ove..., Jeremy Fitzhardinge, (Fri Feb 1, 1:37 pm)
Re: [PATCH] [12/12] GBPAGES: Switch direct mapping setup ove..., Jeremy Fitzhardinge, (Fri Feb 1, 3:16 pm)
[PATCH] [3/12] GBPAGES: Add PUD_PAGE_SIZE, Andi Kleen, (Fri Feb 1, 5:53 am)