iommu/intel: Fix build failure with intel-gtt and !intel-iommu
PATCH 1/1 iommu/intel: Fix build failure with intel-gtt and !intel-iommu
Not sure if this is fixed already. I stumbled over it while compile-testing merges in the IOMMU tree.
Quoted 1 line
From
7d8438f41b3cfbb1094030d7cf5d06da0fd16308Mon Sep 17 00:00:00 2001
From: Joerg Roedel <[email protected]>
Date: Fri, 11 Nov 2011 14:42:53 +0100
Subject: [PATCH] iommu/intel: Fix build failure with intel-gtt and !intel-iommu
With v3.2-rc1 the following build error occurs when Intel IOMMU is off and Intel-GTT is on:
ERROR: "intel_iommu_gfx_mapped" [drivers/char/agp/intel-gtt.ko] undefined!
This patch fixes that.
--- drivers/char/agp/intel-gtt.c | 2 +- include/linux/intel-iommu.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletions(-)
drivers/char/agp/intel-gtt.c +1 -1
@@ -22,6 +22,7 @@#include <linux/pagemap.h> #include <linux/agp_backend.h> #include <linux/delay.h> +#include <linux/intel-iommu.h> #include <asm/smp.h> #include "agp.h" #include "intel-agp.h"
@@ -1186,7 +1187,6 @@ static void gen6_cleanup(void)/* Certain Gen5 chipsets require require idling the GPU before * unmapping anything from the GTT when VT-d is enabled. */ -extern int intel_iommu_gfx_mapped;static inline int needs_idle_maps (void ) {const unsigned short gpu_devid = intel_private.pcidev->device;
include/linux/intel-iommu.h +6 -0
@@ -363,4 +363,10 @@ extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);extern int dmar_ir_support (void ); +#ifdef CONFIG_INTEL_IOMMU +extern int intel_iommu_gfx_mapped; +#else +#define intel_iommu_gfx_mapped 1 +#endif /* CONFIG_INTEL_IOMMU */ +#endif
Signature · 9 lines
1.7.5.4 -- AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo, Andrew Bowd Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
Quoted 1 line · Joerg Roedel
+#define
intel_iommu_gfx_mapped1
That ought to be zero; if the IOMMU code isn't present, it's *definitely* not mapped through the IOMMU :)
But I'm fairly sure this was already noticed and a patch is on its way upstream already.
It's my fault — my original testing patches to expose this information from the IOMMU code did put it into a header file, but when I sent it upstream I missed that part of the patch, thus leading to the horrid 'extern int intel_iommu_gfx_mapped;' in intel-gtt.c that your patch removes.
Signature · 1 line
dwmw2
Quoted 6 lines · David Woodhouse
Quoted 1 line · Joerg Roedel
+#define
intel_iommu_gfx_mapped1That ought to be zero; if the IOMMU code isn't present, it's *definitely* not mapped through the IOMMU :)
Quoted 8 lines
But I'm fairly sure this was already noticed and a patch is on its way upstream already.
It's my fault — my original testing patches to expose this information from the IOMMU code did put it into a header file, but when I sent it upstream I missed that part of the patch, thus leading to the horrid 'extern int
intel_iommu_gfx_mapped;' inintel-gtt.cthat your patch removes.
No problem, it was easy to fix :) I'll keep that patch in my out-of-tree branch until it is fixed upstream.
Joerg
Signature · 5 lines
AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo, Andrew Bowd Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
Quoted 5 lines · David Woodhouse
Quoted 1 line · Joerg Roedel
+#define
intel_iommu_gfx_mapped1That ought to be zero; if the IOMMU code isn't present, it's *definitely* not mapped through the IOMMU :)
Okay, I change this to 0 in my patch.
Quoted 2 lines
But I'm fairly sure this was already noticed and a patch is on its way upstream already.
It is not yet fixed upstream. I plan to send fixes to Linus soon. Any objection against me including this if its not fixed until then?
Joerg
Signature · 5 lines
AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo, Andrew Bowd Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
Quoted 8 lines
Quoted 5 lines
But I'm fairly sure this was already noticed and a patch is on its way upstream already.
It is not yet fixed upstream. I plan to send fixes to Linus soon. Any objection against me including this if its not fixed until then?
Does a08185a3eb658854b29c05bcbfac0f85038ffe9f in Linus tree not fix it?
Dave.
Quoted 10 lines · Dave Airlie
Quoted 8 lines
Quoted 5 lines
But I'm fairly sure this was already noticed and a patch is on its way upstream already.
It is not yet fixed upstream. I plan to send fixes to Linus soon. Any objection against me including this if its not fixed until then?
Does
a08185a3eb658854b29c05bcbfac0f85038ffe9fin Linus tree not fix it?
Oops, tested the wrong tree. It is fixed indeed. Sorry for the noise :)
Joerg
Signature · 5 lines
AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo, Andrew Bowd Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632