Commit b86a6767 authored by Zhang Zekun's avatar Zhang Zekun
Browse files

iommu/iova: move IOVA_MAX_GLOBAL_MAGS outside of IOMMU_SUPPORT

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I7I3P1


CVE: NA

--------------------------------------------

The commit 0227a749 introduce
a config CONFIG_IOVA_MAX_GLOBAL_MAGS, but it relies on IOMMU_SUPPORT.
Some drivers can compile without IOMMU_SUPPORT, but still include
include/linux/iova.h, which can cause compile problem. Fix this
by moving the definition of CONFIG_IOVA_MAX_GLOBAL_MAGS out of
IOMMU_SUPPORT.

The error compile message is showned as below:

In file included from ./include/linux/intel-iommu.h:14,
                 from ./include/drm/intel-gtt.h:8,
                 from drivers/char/agp/intel-agp.c:15:
./include/linux/iova.h:29:25: error: ‘CONFIG_IOVA_MAX_GLOBAL_MAGS’ undeclared here (not in a function)
   29 | #define MAX_GLOBAL_MAGS CONFIG_IOVA_MAX_GLOBAL_MAGS /* magazines per bin */
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/iova.h:34:30: note: in expansion of macro ‘MAX_GLOBAL_MAGS’
   34 |  struct iova_magazine *depot[MAX_GLOBAL_MAGS];
      |                              ^~~~~~~~~~~~~~~
In file included from ./include/linux/intel-iommu.h:14,
                 from ./include/drm/intel-gtt.h:8,
                 from drivers/char/agp/intel-gtt.c:27:
./include/linux/iova.h:29:25: error: ‘CONFIG_IOVA_MAX_GLOBAL_MAGS’ undeclared here (not in a function)
   29 | #define MAX_GLOBAL_MAGS CONFIG_IOVA_MAX_GLOBAL_MAGS /* magazines per bin */
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/iova.h:34:30: note: in expansion of macro ‘MAX_GLOBAL_MAGS’
   34 |  struct iova_magazine *depot[MAX_GLOBAL_MAGS];
      |                              ^~~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:286: drivers/char/agp/intel-agp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:286: drivers/char/agp/intel-gtt.o] Error 1
make[2]: *** [scripts/Makefile.build:503: drivers/char/agp] Error 2
make[1]: *** [scripts/Makefile.build:503: drivers/char] Error 2
make[1]: *** Waiting for unfinished jobs....

Signed-off-by: default avatarZhang Zekun <zhangzekun11@huawei.com>
parent 82c66282
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -437,6 +437,9 @@ config SMMU_BYPASS_DEV

	  This feature will be replaced by ACPI IORT RMR node, which will be
	  upstreamed in mainline.

endif # IOMMU_SUPPORT

config IOVA_MAX_GLOBAL_MAGS
	int "Set the max iova global magzines in iova rcache"
	range 16 2048
@@ -446,6 +449,3 @@ config IOVA_MAX_GLOBAL_MAGS
	  it can be a bottle neck when lots of cpus are contending to use it.
	  If you are suffering from the speed of allocing iova with more than
	  128 cpus, try to tune this config larger.


endif # IOMMU_SUPPORT