File xen3-patch-2.6.35 of Package drm

From: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Linux: 2.6.35
Patch-mainline: 2.6.35

 This patch contains the differences between 2.6.34 and 2.6.35.

Acked-by: Jeff Mahoney <jeffm@suse.com>
Automatically created from "patches.kernel.org/patch-2.6.35" by xen-port-patches.py

---
 drivers/gpu/drm/ttm/ttm_page_alloc.c |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -507,6 +507,19 @@ static int ttm_alloc_new_pages(struct li
 	for (i = 0, cpages = 0; i < count; ++i) {
 		p = alloc_page(gfp_flags);
 
+#ifdef CONFIG_XEN
+		if (p && (gfp_flags & __GFP_DMA32)) {
+			r = xen_limit_pages_to_max_mfn(p, 0, 32);
+			if (r) {
+				__free_page(p);
+				printk(KERN_ERR TTM_PFX
+				       "Cannot restrict page (%d).", r);
+				p = NULL;
+			} else if (gfp_flags & __GFP_ZERO)
+				clear_page(page_address(p));
+		}
+#endif
+
 		if (!p) {
 			pr_err("Unable to get page %u\n", i);
 
@@ -746,6 +759,22 @@ static int ttm_get_pages(struct page **p
 				return -ENOMEM;
 			}
 
+#ifdef CONFIG_XEN
+			if (flags & TTM_PAGE_FLAG_DMA32) {
+				int rc = xen_limit_pages_to_max_mfn(p, 0, 32);
+
+				if (rc) {
+					__free_page(p);
+					printk(KERN_ERR TTM_PFX
+					       "Unable to restrict page (%d).",
+					       rc);
+					return rc;
+				}
+				if (flags & TTM_PAGE_FLAG_ZERO_ALLOC)
+					clear_page(page_address(p));
+			}
+#endif
+
 			pages[r] = p;
 		}
 		return 0;