--- linux-2.6.9/arch/x86_64/mm/pageattr-xen.c.orig	2008-05-30 15:10:58.000000000 -0400
+++ linux-2.6.9/arch/x86_64/mm/pageattr-xen.c	2008-05-30 15:13:13.000000000 -0400
@@ -64,6 +64,7 @@
 
 void mm_pin(struct mm_struct *mm)
 {
+	unsigned long flags;
 	pml4_t * pml4 = (pml4_t *) mm->pgd + PTRS_PER_PGD;
 	if (xen_feature(XENFEAT_writable_page_tables))
 		return;
@@ -80,15 +81,16 @@
 	xen_pgd_pin(__pa(pml4));
 	set_pml4(pml4, mk_pml4(__pa(mm->pgd)));
 
-	spin_lock(&mm_unpinned_lock);
+	spin_lock_irqsave(&mm_unpinned_lock, flags);
 	list_del(&mm->context.unpinned);
-	spin_unlock(&mm_unpinned_lock);
+	spin_unlock_irqrestore(&mm_unpinned_lock, flags);
 
 	spin_unlock(&mm->page_table_lock);
 }
 
 void mm_unpin(struct mm_struct *mm)
 {
+	unsigned long flags;
 	pml4_t * pml4 = (pml4_t *) mm->pgd + PTRS_PER_PGD;
 	if (xen_feature(XENFEAT_writable_page_tables))
 		return;
@@ -109,9 +111,9 @@
 	mm_walk(mm, PAGE_KERNEL);
 	xen_tlb_flush();
 	mm->context.pinned = 0;
-	spin_lock(&mm_unpinned_lock);
+	spin_lock_irqsave(&mm_unpinned_lock, flags);
 	list_add(&mm->context.unpinned, &mm_unpinned);
-	spin_unlock(&mm_unpinned_lock);
+	spin_unlock_irqrestore(&mm_unpinned_lock, flags);
 
 	spin_unlock(&mm->page_table_lock);
 }
--- linux-2.6.9/arch/x86_64/kernel/ldt-xen.c.orig	2008-05-30 15:28:46.000000000 -0400
+++ linux-2.6.9/arch/x86_64/kernel/ldt-xen.c	2008-05-30 15:31:32.000000000 -0400
@@ -111,6 +111,7 @@
 {
 	struct mm_struct * old_mm;
 	int retval = 0;
+	unsigned long flags;
 
 	memset(&mm->context, 0, sizeof(mm->context));
 	init_MUTEX(&mm->context.sem);
@@ -121,9 +122,9 @@
 		up(&old_mm->context.sem);
 	}
 	if (retval == 0) {
-		spin_lock(&mm_unpinned_lock);
+		spin_lock_irqsave(&mm_unpinned_lock, flags);
 		list_add(&mm->context.unpinned, &mm_unpinned);
-		spin_unlock(&mm_unpinned_lock);
+		spin_unlock_irqrestore(&mm_unpinned_lock, flags);
 	}
 	return retval;
 }
@@ -134,6 +135,7 @@
  */
 void destroy_context(struct mm_struct *mm)
 {
+	unsigned long flags;
 	if (mm->context.size) {
 		if (mm == current->active_mm)
 			clear_LDT();
@@ -148,9 +150,9 @@
 		mm->context.size = 0;
 	}
 	if (!mm->context.pinned) {
-		spin_lock(&mm_unpinned_lock);
+		spin_lock_irqsave(&mm_unpinned_lock, flags);
 		list_del(&mm->context.unpinned);
-		spin_unlock(&mm_unpinned_lock);
+		spin_unlock_irqrestore(&mm_unpinned_lock, flags);
 	}
 }
 
