mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 14/14] i386 / Introduce hypervisor lazy pinning hooks
@ 2005-08-11  4:58 zach
  0 siblings, 0 replies; only message in thread
From: zach @ 2005-08-11  4:58 UTC (permalink / raw)
  To: akpm, chrisl, chrisw, hpa, Keir.Fraser, linux-kernel,
	m+Ian.Pratt, mbligh, pratap, virtualization, zach, zwane

Xen uses lazy pinning of MM structures including the page table root and LDT,
which requires hooks at context creation and destruction time to maintain the
lazy list.

Patch-against: 2.6.13-rc5-mm1
Patch-keys: i386 mmu paravirt xen
Signed-off-by: Zachary Amsden <zach@vmware.com>
Index: linux-2.6.13/include/asm-i386/mmu_context.h
===================================================================
--- linux-2.6.13.orig/include/asm-i386/mmu_context.h	2005-08-10 17:06:52.000000000 -0700
+++ linux-2.6.13/include/asm-i386/mmu_context.h	2005-08-10 17:11:40.000000000 -0700
@@ -6,6 +6,7 @@
 #include <asm/atomic.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
+#include <mach_mmu.h>
 
 /*
  * Used for LDT copy/destruction.
@@ -15,12 +16,14 @@
 	struct mm_struct * old_mm;
 	int retval = 0;
 
+	memset(&mm->context, 0, sizeof(mm->context));
 	init_MUTEX(&mm->context.sem);
-	mm->context.size = 0;
 	old_mm = current->mm;
 	if (old_mm && unlikely(old_mm->context.size > 0)) {
 		retval = copy_ldt(&mm->context, &old_mm->context);
 	}
+	if (retval == 0)
+		add_lazy_mm(mm);
 	return retval;
 }
 
@@ -31,6 +34,7 @@
 {
 	if (unlikely(mm->context.size))
 		destroy_ldt(mm);
+	del_lazy_mm(mm);
 }
 
 static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
Index: linux-2.6.13/include/asm-i386/mach-default/mach_mmu.h
===================================================================
--- linux-2.6.13.orig/include/asm-i386/mach-default/mach_mmu.h	2005-08-10 17:11:40.000000000 -0700
+++ linux-2.6.13/include/asm-i386/mach-default/mach_mmu.h	2005-08-10 17:11:40.000000000 -0700
@@ -0,0 +1,10 @@
+#ifndef __ASM_MACH_MMU_H
+#define __ASM_MACH_MMU_H
+
+/*
+ * Stub hooks for lazy hypervisor pinning.
+ */
+#define add_lazy_mm(_mm)
+#define del_lazy_mm(_mm)
+
+#endif

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-11  4:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-11  4:58 [PATCH 14/14] i386 / Introduce hypervisor lazy pinning hooks zach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®