[PATCH] [6/36] CPA Handle 4K split pages at boot on 64bit

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>, <mingo@...>, <tglx@...>, <jbeulich@...>, <venkatesh.pallipadi@...>
Date: Wednesday, January 16, 2008 - 6:15 pm

Port the code to check for already split 4K pages at boot over from
32bit to 64bit.

Note: should be probably put before PAT patches to avoid bisect failures later
Signed-off-by: Andi Kleen <ak@suse.de>

---
 arch/x86/mm/pageattr_64.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: linux/arch/x86/mm/pageattr_64.c
===================================================================
--- linux.orig/arch/x86/mm/pageattr_64.c
+++ linux/arch/x86/mm/pageattr_64.c
@@ -160,11 +160,8 @@ __change_page_attr(unsigned long address
 	} else
 		BUG();
 
-	/* on x86-64 the direct mapping set at boot is not using 4k pages */
-	BUG_ON(PageReserved(kpte_page));
-
 	save_page(kpte_page);
-	if (page_private(kpte_page) == 0)
+	if (!PageReserved(kpte_page) && page_private(kpte_page) == 0)
 		revert_page(address, ref_prot);
 	return 0;
 } 
@@ -243,6 +240,8 @@ void global_flush_tlb(void)
 
 	list_for_each_entry_safe(pg, next, &l, lru) {
 		list_del(&pg->lru);
+		if (PageReserved(pg))
+			continue;
 		clear_bit(PG_arch_1, &pg->flags);
 		if (page_private(pg) != 0)
 			continue;
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] [35/36] Remove set_kernel_exec, Andi Kleen, (Wed Jan 16, 6:15 pm)
[PATCH] [36/36] Clean up pte_exec, Andi Kleen, (Wed Jan 16, 6:15 pm)
[PATCH] [14/36] CPA: Add simple self test at boot, Andi Kleen, (Wed Jan 16, 6:15 pm)
[PATCH] [10/36] Add pte_pgprot on i386, Andi Kleen, (Wed Jan 16, 6:15 pm)
[PATCH] [9/36] Add pte accessors for the global bit, Andi Kleen, (Wed Jan 16, 6:15 pm)
[PATCH] [8/36] CPA: Do a simple self test at boot, Andi Kleen, (Wed Jan 16, 6:15 pm)
[PATCH] [6/36] CPA Handle 4K split pages at boot on 64bit, Andi Kleen, (Wed Jan 16, 6:15 pm)
[PATCH] [4/36] CPA: Undo white space changes, Andi Kleen, (Wed Jan 16, 6:15 pm)
[PATCH] [1/36] Undo pat cpa patch, Andi Kleen, (Wed Jan 16, 6:14 pm)