Index: xen-unstable.hg/xen/arch/ia64/xen/faults.c
===================================================================
--- xen-unstable.hg.orig/xen/arch/ia64/xen/faults.c	2007-12-06 16:55:15.000000000 +0900
+++ xen-unstable.hg/xen/arch/ia64/xen/faults.c	2007-12-06 16:57:06.000000000 +0900
@@ -183,6 +183,7 @@ void ia64_do_page_fault(unsigned long ad
 	}
 
  again:
+#if 0
 	/* This is to handle page faults for EFI memory from guests
 	 * N.B: This is probably safe for dom0, but
 	 * completely unsafe for domU */
@@ -199,6 +200,23 @@ void ia64_do_page_fault(unsigned long ad
 		       attr & (EFI_MEMORY_UC|EFI_MEMORY_WC|EFI_MEMORY_WT)) )
 			attr = 0;
 	}
+#endif
+       /* All that matters here is that if we are accessing EFI memory
+        * we note that by setting EFI_MEMORY_WB for cached access
+        * or EFI_MEMORY_UC for uncached access. The actuall efi attibutes
+        * are not of any interest as we can deduce the needed values.
+        * This avoids an expensive call to efi_mem_attributes().
+        *
+        * The RID check prevents domains from accessing this memory.
+        *
+        * This check is also duplicated in assembly in alt_dtlb_miss
+        */
+	if (address >> 59 == __IA64_EFI_CACHED_OFFSET >> 59 &&
+			ia64_get_rr(7UL << 61) == XEN_EFI_RID)
+		attr = EFI_MEMORY_WB;
+	else if (address >> 59 == __IA64_EFI_UNCACHED_OFFSET >> 59 &&
+		 ia64_get_rr(6UL << 61) == XEN_EFI_RID)
+		attr = EFI_MEMORY_UC;
 	if (attr)
 		printk("EFI memory fault addr=0x%016lx attr=0x%016lx "
 		       "kr2=0x%016lx guest_mode=%d rr[%d]=0x%016lx\n",
