All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xensource.com
Subject: merge error in intel_agp_insert_sg_entries() in xen.git
Date: Sat, 12 Mar 2011 15:25:17 +0100	[thread overview]
Message-ID: <20110312142517.GA30949@aepfle.de> (raw)


There is a missing } in one of the patches for
drivers/char/agp/intel-agp.c:intel_agp_insert_sg_entries() in xen.git.
The diff I get looks like this:

--- linux-2.6.32/drivers/char/agp/intel-agp.c
+++ linux-2.6-jeremy-xen-stable-2.6.32.x/drivers/char/agp/intel-agp.c
@@ -10,14 +10,20 @@
 #include <linux/agp_backend.h>
 #include <asm/smp.h>
 #include "agp.h"
+#include <xen/page.h>
+#include <asm/xen/page.h>

 /*
  * If we have Intel graphics, we're not going to have anything other than
  * an Intel IOMMU. So make the correct use of the PCI DMA API contingent
  * on the Intel IOMMU support (CONFIG_DMAR).
  * Only newer chipsets need to bother with this, of course.
+ *
+ * Xen guests accessing graphics hardware also need proper translation
+ * between pseudo-physical addresses and real machine addresses, which
+ * is also achieved by using the DMA API.
  */
-#ifdef CONFIG_DMAR
+#if defined(CONFIG_DMAR) || defined(CONFIG_XEN)
 #define USE_PCI_DMA_API 1
 #endif

@@ -296,8 +302,20 @@ static void intel_agp_insert_sg_entries(
        int i, j;

        for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
+               phys_addr_t phys = page_to_phys(mem->pages[i]);
+               if (xen_pv_domain()) {
+                       phys_addr_t xen_phys = PFN_PHYS(pfn_to_mfn(
+                                       page_to_pfn(mem->pages[i])));
+                       if (xen_phys != phys) {
+                               printk(KERN_ERR "Compile kernel with " \
+                                       "CONFIG_DMAR to get rid of this " \
+                                       "warning!\n");
+                               WARN_ON_ONCE(xen_phys != phys);
+                               /* Fixup: */
+                               phys = xen_phys;
+                       }
                writel(agp_bridge->driver->mask_memory(agp_bridge,
-                               page_to_phys(mem->pages[i]), mask_type),
+                               phys, mask_type),
                       intel_private.gtt+j);
        }

@@

             reply	other threads:[~2011-03-12 14:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-12 14:25 Olaf Hering [this message]
2011-03-29 15:27 ` xen-unstable: check_barrier not declared on 32bit Olaf Hering
2011-03-29 15:35   ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110312142517.GA30949@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.