+ yet-another-function-to-load-cr3-register.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Yet another function to load cr3 register
has been added to the -mm tree.  Its filename is
     yet-another-function-to-load-cr3-register.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: Yet another function to load cr3 register
From: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>

There is (was) yet another function to load something into
the cr3 register. We don't need it.

Signed-off-by: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 arch/x86_64/kernel/smp.c         |    2 +-
 include/asm-x86_64/mmu_context.h |    9 ++-------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff -puN arch/x86_64/kernel/smp.c~yet-another-function-to-load-cr3-register arch/x86_64/kernel/smp.c
--- a/arch/x86_64/kernel/smp.c~yet-another-function-to-load-cr3-register
+++ a/arch/x86_64/kernel/smp.c
@@ -76,7 +76,7 @@ static inline void leave_mm(int cpu)
 	if (read_pda(mmu_state) == TLBSTATE_OK)
 		BUG();
 	cpu_clear(cpu, read_pda(active_mm)->cpu_vm_mask);
-	load_cr3(swapper_pg_dir);
+	write_cr3(__pa(swapper_pg_dir));
 }
 
 /*
diff -puN include/asm-x86_64/mmu_context.h~yet-another-function-to-load-cr3-register include/asm-x86_64/mmu_context.h
--- a/include/asm-x86_64/mmu_context.h~yet-another-function-to-load-cr3-register
+++ a/include/asm-x86_64/mmu_context.h
@@ -22,11 +22,6 @@ static inline void enter_lazy_tlb(struct
 #endif
 }
 
-static inline void load_cr3(pgd_t *pgd)
-{
-	asm volatile("movq %0,%%cr3" :: "r" (__pa(pgd)) : "memory");
-}
-
 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 
 			     struct task_struct *tsk)
 {
@@ -39,7 +34,7 @@ static inline void switch_mm(struct mm_s
 		write_pda(active_mm, next);
 #endif
 		cpu_set(cpu, next->cpu_vm_mask);
-		load_cr3(next->pgd);
+		write_cr3(__pa(next->pgd));
 
 		if (unlikely(next->context.ldt != prev->context.ldt)) 
 			load_LDT_nolock(&next->context, cpu);
@@ -54,7 +49,7 @@ static inline void switch_mm(struct mm_s
 			 * tlb flush IPI delivery. We must reload CR3
 			 * to make sure to use no freed page tables.
 			 */
-			load_cr3(next->pgd);
+			write_cr3(__pa(next->pgd));
 			load_LDT_nolock(&next->context, cpu);
 		}
 	}
_

Patches currently in -mm which might be from gcosta@xxxxxxxxxx are

x86_64-remove-duplicated-code-for-reading-control-registers.patch
yet-another-function-to-load-cr3-register.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux