[PATCH] drm/xe: Select INTEL_VSEC to fix build dependency

Su Hui posted 1 patch 9 months, 3 weeks ago
drivers/gpu/drm/xe/Kconfig | 1 +
1 file changed, 1 insertion(+)
[PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
Posted by Su Hui 9 months, 3 weeks ago
When build randconfig, there is an error:
ld: drivers/gpu/drm/xe/xe_vsec.o: in function `xe_vsec_init':
xe_vsec.c:(.text+0x182): undefined reference to `intel_vsec_register'

When CONFIG_DRM_XE=y and CONFIG_INTEL_VSEC=m is set, ld couldn't find
'intel_vsec_register'. Select INTEL_VSEC to fix this error.

Fixes: 0c45e76fcc62 ("drm/xe/vsec: Support BMG devices")
Signed-off-by: Su Hui <suhui@nfschina.com>
---
 drivers/gpu/drm/xe/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
index b51a2bde73e2..7a60d96d2dd6 100644
--- a/drivers/gpu/drm/xe/Kconfig
+++ b/drivers/gpu/drm/xe/Kconfig
@@ -44,6 +44,7 @@ config DRM_XE
 	select WANT_DEV_COREDUMP
 	select AUXILIARY_BUS
 	select HMM_MIRROR
+	select INTEL_VSEC
 	help
 	  Experimental driver for Intel Xe series GPUs
 
-- 
2.30.2
Re: [PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
Posted by kernel test robot 9 months, 2 weeks ago
Hi Su,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-xe/drm-xe-next]
[also build test ERROR on linus/master v6.14-rc5 next-20250304]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Su-Hui/drm-xe-Select-INTEL_VSEC-to-fix-build-dependency/20250227-153437
base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link:    https://lore.kernel.org/r/20250227073205.1248282-1-suhui%40nfschina.com
patch subject: [PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
config: loongarch-randconfig-001-20250304 (https://download.01.org/0day-ci/archive/20250305/202503052153.gQnXU123-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250305/202503052153.gQnXU123-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503052153.gQnXU123-lkp@intel.com/

All errors (new ones prefixed by >>, old ones prefixed by <<):

WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fpga/tests/fpga-mgr-test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fpga/tests/fpga-bridge-test.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fpga/tests/fpga-region-test.o
>> ERROR: modpost: "intel_vsec_register" [drivers/gpu/drm/xe/xe.ko] undefined!

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for INTEL_VSEC
   Depends on [n]: X86_PLATFORM_DEVICES [=n] && PCI [=y]
   Selected by [m]:
   - DRM_XE [=m] && HAS_IOMEM [=y] && DRM [=m] && PCI [=y] && MMU [=y] && (m [=m] && MODULES [=y] || KUNIT [=y]=y [=y])
   WARNING: unmet direct dependencies detected for FB_IOMEM_HELPERS
   Depends on [n]: HAS_IOMEM [=y] && FB_CORE [=n]
   Selected by [m]:
   - DRM_XE_DISPLAY [=y] && HAS_IOMEM [=y] && DRM [=m] && DRM_XE [=m] && DRM_XE [=m]=m [=m] && HAS_IOPORT [=y]

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
Posted by Su Hui 9 months, 2 weeks ago
On 2025/3/5 21:15, kernel test robot wrote:
> Hi Su,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on drm-xe/drm-xe-next]
> [also build test ERROR on linus/master v6.14-rc5 next-20250304]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Su-Hui/drm-xe-Select-INTEL_VSEC-to-fix-build-dependency/20250227-153437
> base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
> patch link:    https://lore.kernel.org/r/20250227073205.1248282-1-suhui%40nfschina.com
> patch subject: [PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
> config: loongarch-randconfig-001-20250304 (https://download.01.org/0day-ci/archive/20250305/202503052153.gQnXU123-lkp@intel.com/config)
> compiler: loongarch64-linux-gcc (GCC) 14.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250305/202503052153.gQnXU123-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202503052153.gQnXU123-lkp@intel.com/
>
> All errors (new ones prefixed by >>, old ones prefixed by <<):
>
> WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fpga/tests/fpga-mgr-test.o
> WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fpga/tests/fpga-bridge-test.o
> WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fpga/tests/fpga-region-test.o
>>> ERROR: modpost: "intel_vsec_register" [drivers/gpu/drm/xe/xe.ko] undefined!
> Kconfig warnings: (for reference only)
>     WARNING: unmet direct dependencies detected for INTEL_VSEC
>     Depends on [n]: X86_PLATFORM_DEVICES [=n] && PCI [=y]
>     Selected by [m]:
>     - DRM_XE [=m] && HAS_IOMEM [=y] && DRM [=m] && PCI [=y] && MMU [=y] && (m [=m] && MODULES [=y] || KUNIT [=y]=y [=y])
>     WARNING: unmet direct dependencies detected for FB_IOMEM_HELPERS
>     Depends on [n]: HAS_IOMEM [=y] && FB_CORE [=n]
>     Selected by [m]:
>     - DRM_XE_DISPLAY [=y] && HAS_IOMEM [=y] && DRM [=m] && DRM_XE [=m] && DRM_XE [=m]=m [=m] && HAS_IOPORT [=y]
>
Thanks for these reported, this patch has some problems and is discarded.

As Lucas's and Jani's suggestion, there are some other solutions, but I 
can't
make sure these solutions won't generate such building errors like this one.
So I want to use some tools to make sure this dependency is absolutely 
right.
I saw there were some thoughts about kconfig-sat[1], maybe it can help. 
I guess
using SAT is a nice solution for this problem, but I'm not famlilar with 
SAT.

So it need some time (maybe more) for me to send a v2 patch.

[1] https://kernelnewbies.org/KernelProjects/linux-sat

Su Hui
Re: [PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
Posted by kernel test robot 9 months, 2 weeks ago
Hi Su,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-xe/drm-xe-next]
[also build test ERROR on linus/master v6.14-rc5 next-20250304]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Su-Hui/drm-xe-Select-INTEL_VSEC-to-fix-build-dependency/20250227-153437
base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link:    https://lore.kernel.org/r/20250227073205.1248282-1-suhui%40nfschina.com
patch subject: [PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20250305/202503050332.hlxQQDQk-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250305/202503050332.hlxQQDQk-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503050332.hlxQQDQk-lkp@intel.com/

All errors (new ones prefixed by >>):

>> ld.lld: error: undefined symbol: intel_vsec_register
   >>> referenced by xe_vsec.c
   >>>               drivers/gpu/drm/xe/xe_vsec.o:(xe_vsec_init) in archive vmlinux.a

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for INTEL_VSEC
   Depends on [n]: X86_PLATFORM_DEVICES [=n] && PCI [=y]
   Selected by [y]:
   - DRM_XE [=y] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && (m [=m] && MODULES [=y] || KUNIT [=y]=y [=y])

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
Posted by kernel test robot 9 months, 3 weeks ago
Hi Su,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-xe/drm-xe-next]
[also build test WARNING on linus/master v6.14-rc4 next-20250228]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Su-Hui/drm-xe-Select-INTEL_VSEC-to-fix-build-dependency/20250227-153437
base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link:    https://lore.kernel.org/r/20250227073205.1248282-1-suhui%40nfschina.com
patch subject: [PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
config: x86_64-kismet-CONFIG_INTEL_VSEC-CONFIG_DRM_XE-0-0 (https://download.01.org/0day-ci/archive/20250302/202503020347.z00djbJE-lkp@intel.com/config)
reproduce: (https://download.01.org/0day-ci/archive/20250302/202503020347.z00djbJE-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503020347.z00djbJE-lkp@intel.com/

kismet warnings: (new ones prefixed by >>)
>> kismet: WARNING: unmet direct dependencies detected for INTEL_VSEC when selected by DRM_XE
   WARNING: unmet direct dependencies detected for INTEL_VSEC
     Depends on [n]: X86_PLATFORM_DEVICES [=n] && PCI [=y]
     Selected by [y]:
     - DRM_XE [=y] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && (m [=m] && MODULES [=y] || KUNIT [=y]=y [=y])

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
Posted by Lucas De Marchi 9 months, 3 weeks ago
On Thu, Feb 27, 2025 at 03:32:06PM +0800, Su Hui wrote:
>When build randconfig, there is an error:
>ld: drivers/gpu/drm/xe/xe_vsec.o: in function `xe_vsec_init':
>xe_vsec.c:(.text+0x182): undefined reference to `intel_vsec_register'
>
>When CONFIG_DRM_XE=y and CONFIG_INTEL_VSEC=m is set, ld couldn't find
>'intel_vsec_register'. Select INTEL_VSEC to fix this error.
>
>Fixes: 0c45e76fcc62 ("drm/xe/vsec: Support BMG devices")
>Signed-off-by: Su Hui <suhui@nfschina.com>
>---
> drivers/gpu/drm/xe/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
>index b51a2bde73e2..7a60d96d2dd6 100644
>--- a/drivers/gpu/drm/xe/Kconfig
>+++ b/drivers/gpu/drm/xe/Kconfig
>@@ -44,6 +44,7 @@ config DRM_XE
> 	select WANT_DEV_COREDUMP
> 	select AUXILIARY_BUS
> 	select HMM_MIRROR
>+	select INTEL_VSEC

intel_vsec is an x86 platform driver. I think we probably want to add a
config that depends on INTEL_VSEC rather than selecting it like this.
At the very least we need and `if x86` and also make sure the driver
works without that part.

Lucas De Marchi


> 	help
> 	  Experimental driver for Intel Xe series GPUs
>
>-- 
>2.30.2
>
Re: [PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
Posted by Su Hui 9 months, 3 weeks ago
On 2025/2/28 00:03, Lucas De Marchi wrote:
> On Thu, Feb 27, 2025 at 03:32:06PM +0800, Su Hui wrote:
>> When build randconfig, there is an error:
>> ld: drivers/gpu/drm/xe/xe_vsec.o: in function `xe_vsec_init':
>> xe_vsec.c:(.text+0x182): undefined reference to `intel_vsec_register'
>>
>> When CONFIG_DRM_XE=y and CONFIG_INTEL_VSEC=m is set, ld couldn't find
>> 'intel_vsec_register'. Select INTEL_VSEC to fix this error.
>>
>> Fixes: 0c45e76fcc62 ("drm/xe/vsec: Support BMG devices")
>> Signed-off-by: Su Hui <suhui@nfschina.com>
>> ---
>> drivers/gpu/drm/xe/Kconfig | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
>> index b51a2bde73e2..7a60d96d2dd6 100644
>> --- a/drivers/gpu/drm/xe/Kconfig
>> +++ b/drivers/gpu/drm/xe/Kconfig
>> @@ -44,6 +44,7 @@ config DRM_XE
>>     select WANT_DEV_COREDUMP
>>     select AUXILIARY_BUS
>>     select HMM_MIRROR
>> +    select INTEL_VSEC
>
> intel_vsec is an x86 platform driver. I think we probably want to add a
> config that depends on INTEL_VSEC rather than selecting it like this.
> At the very least we need and `if x86` and also make sure the driver
> works without that part.
>
There is a recursive dependency between INTEL_VSEC and DRM_XE:

         symbol DRM_XE depends on INTEL_VSEC
         symbol INTEL_VSEC depends on X86_PLATFORM_DEVICES
         symbol X86_PLATFORM_DEVICES is selected by DRM_XE

So if using 'depends on INTEL_VSEC', we should remove 'select 
X86_PLATFORM_DEVICES', like this one:

  config DRM_XE
         tristate "Intel Xe Graphics"
         depends on DRM && PCI && MMU && (m || (y && KUNIT=y))
+       depends on !X86 || INTEL_VSEC || INTEL_VSEC=n
+       depends on !X86 || !ACPI || ACPI_WMI
         select INTERVAL_TREE
         # we need shmfs for the swappable backing store, and in particular
         # the shmem_readpage() which depends upon tmpfs
@@ -27,8 +29,6 @@ config DRM_XE
         select BACKLIGHT_CLASS_DEVICE if ACPI
         select INPUT if ACPI
         select ACPI_VIDEO if X86 && ACPI
-       select X86_PLATFORM_DEVICES if X86 && ACPI
-       select ACPI_WMI if X86 && ACPI

The 'select X86_PLATFORM_DEVICES' is introduced by 67a9e86dc130 
("drm/xe: select
X86_PLATFORM_DEVICES when ACPI_WMI is selected"), so both ACPI_WMI need 
to be changed.

Another choice is using 'select INTEL_VSEC if X86' and no need to change 
other things.
Any suggestion for these two choices?


Re: [PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
Posted by Jani Nikula 9 months, 3 weeks ago
On Thu, 27 Feb 2025, Su Hui <suhui@nfschina.com> wrote:
> When build randconfig, there is an error:
> ld: drivers/gpu/drm/xe/xe_vsec.o: in function `xe_vsec_init':
> xe_vsec.c:(.text+0x182): undefined reference to `intel_vsec_register'
>
> When CONFIG_DRM_XE=y and CONFIG_INTEL_VSEC=m is set, ld couldn't find
> 'intel_vsec_register'. Select INTEL_VSEC to fix this error.

Documentation/kbuild/kconfig-language.rst:

  Note:
	select should be used with care. select will force
	a symbol to a value without visiting the dependencies.
	By abusing select you are able to select a symbol FOO even
	if FOO depends on BAR that is not set.
	In general use select only for non-visible symbols
	(no prompts anywhere) and for symbols with no dependencies.
	That will limit the usefulness but on the other hand avoid
	the illegal configurations all over.

This should likely be either

	depends on INTEL_VSEC || INTEL_VSEC=n

or

	depends on INTEL_VSEC


BR,
Jani.



>
> Fixes: 0c45e76fcc62 ("drm/xe/vsec: Support BMG devices")
> Signed-off-by: Su Hui <suhui@nfschina.com>
> ---
>  drivers/gpu/drm/xe/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
> index b51a2bde73e2..7a60d96d2dd6 100644
> --- a/drivers/gpu/drm/xe/Kconfig
> +++ b/drivers/gpu/drm/xe/Kconfig
> @@ -44,6 +44,7 @@ config DRM_XE
>  	select WANT_DEV_COREDUMP
>  	select AUXILIARY_BUS
>  	select HMM_MIRROR
> +	select INTEL_VSEC
>  	help
>  	  Experimental driver for Intel Xe series GPUs

-- 
Jani Nikula, Intel
Re: [PATCH] drm/xe: Select INTEL_VSEC to fix build dependency
Posted by Su Hui 9 months, 3 weeks ago
On 2025/2/27 18:47, Jani Nikula wrote:
> On Thu, 27 Feb 2025, Su Hui <suhui@nfschina.com> wrote:
>> When build randconfig, there is an error:
>> ld: drivers/gpu/drm/xe/xe_vsec.o: in function `xe_vsec_init':
>> xe_vsec.c:(.text+0x182): undefined reference to `intel_vsec_register'
>>
>> When CONFIG_DRM_XE=y and CONFIG_INTEL_VSEC=m is set, ld couldn't find
>> 'intel_vsec_register'. Select INTEL_VSEC to fix this error.
> Documentation/kbuild/kconfig-language.rst:
>
>    Note:
> 	select should be used with care. select will force
> 	a symbol to a value without visiting the dependencies.
> 	By abusing select you are able to select a symbol FOO even
> 	if FOO depends on BAR that is not set.
> 	In general use select only for non-visible symbols
> 	(no prompts anywhere) and for symbols with no dependencies.
> 	That will limit the usefulness but on the other hand avoid
> 	the illegal configurations all over.
>
> This should likely be either
>
> 	depends on INTEL_VSEC || INTEL_VSEC=n
>
> or
>
> 	depends on INTEL_VSEC

Hi, Jani:

I tried to use 'depends on' at first. But there is a recursive dependency:

     error: recursive dependency detected!
         symbol DRM_XE depends on INTEL_VSEC
         symbol INTEL_VSEC depends on X86_PLATFORM_DEVICES
         symbol X86_PLATFORM_DEVICES is selected by DRM_XE
         For a resolution refer to 
Documentation/kbuild/kconfig-language.rst
     subsection "Kconfig recursive dependency limitations".


I will try it again with 'depends on', need some time to check this 
recursive
dependency problem.

Su Hui

>
>
>
>> Fixes: 0c45e76fcc62 ("drm/xe/vsec: Support BMG devices")
>> Signed-off-by: Su Hui <suhui@nfschina.com>
>> ---
>>   drivers/gpu/drm/xe/Kconfig | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
>> index b51a2bde73e2..7a60d96d2dd6 100644
>> --- a/drivers/gpu/drm/xe/Kconfig
>> +++ b/drivers/gpu/drm/xe/Kconfig
>> @@ -44,6 +44,7 @@ config DRM_XE
>>   	select WANT_DEV_COREDUMP
>>   	select AUXILIARY_BUS
>>   	select HMM_MIRROR
>> +	select INTEL_VSEC
>>   	help
>>   	  Experimental driver for Intel Xe series GPUs