lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 25 Feb 2024 21:42:06 -0600
From: Lucas De Marchi <lucas.demarchi@...el.com>
To: Arnd Bergmann <arnd@...nel.org>
CC: Oded Gabbay <ogabbay@...nel.org>, Thomas Hellström
	<thomas.hellstrom@...ux.intel.com>, Arnd Bergmann <arnd@...db.de>, "Maarten
 Lankhorst" <maarten.lankhorst@...ux.intel.com>, Maxime Ripard
	<mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, David Airlie
	<airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>, Rodrigo Vivi
	<rodrigo.vivi@...el.com>, Matthew Brost <matthew.brost@...el.com>, "Francois
 Dugast" <francois.dugast@...el.com>, Jani Nikula <jani.nikula@...el.com>,
	Tejas Upadhyay <tejas.upadhyay@...el.com>, Matthew Auld
	<matthew.auld@...el.com>, Mauro Carvalho Chehab <mchehab@...nel.org>, "Michal
 Wajdeczko" <michal.wajdeczko@...el.com>, Matt Roper
	<matthew.d.roper@...el.com>, Daniele Ceraolo Spurio
	<daniele.ceraolospurio@...el.com>, <intel-xe@...ts.freedesktop.org>,
	<dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] drm/xe/kunit: fix link failure with built-in xe

On Sat, Feb 24, 2024 at 01:14:59PM +0100, Arnd Bergmann wrote:
>From: Arnd Bergmann <arnd@...db.de>
>
>When the driver is built-in but the tests are in loadable modules,
>the helpers don't actually get put into the driver:
>
>ERROR: modpost: "xe_kunit_helper_alloc_xe_device" [drivers/gpu/drm/xe/tests/xe_test.ko] undefined!
>
>Change the Makefile to ensure they are always part of the driver
>even when the rest of the kunit tests are in loadable modules.
>
>The tests/xe_kunit_helpers.c file depends on DRM_KUNIT_TEST_HELPERS,
>so this has to always be selected by the main XE module now, rather
>than the actual tests. In turn, the "depends on (m || (y && KUNIT=y))"
>doesn't really do what it tried and can just be removed.

it actually did, which was to workaround issues prior to the commit you
are pointing out.  What it did  was to make sure xe.ko is m, or if it's
built-in, kunit is also built-in. Apparently the problem here is that
the xe_test.ko is missing the symbols.

See commit 08987a8b6820 ("drm/xe: Fix build with KUNIT=m").

I'm happy to remove it though if it's indeed not needed anymore.

Lucas De Marchi

>
>Fixes: 5095d13d758b ("drm/xe/kunit: Define helper functions to allocate fake xe device")
>Signed-off-by: Arnd Bergmann <arnd@...db.de>
>---
> drivers/gpu/drm/xe/Kconfig       | 3 ++-
> drivers/gpu/drm/xe/Kconfig.debug | 1 -
> drivers/gpu/drm/xe/Makefile      | 6 ++++--
> 3 files changed, 6 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig
>index 6d4428b19a4c..2948650680e1 100644
>--- a/drivers/gpu/drm/xe/Kconfig
>+++ b/drivers/gpu/drm/xe/Kconfig
>@@ -1,7 +1,7 @@
> # SPDX-License-Identifier: GPL-2.0-only
> config DRM_XE
> 	tristate "Intel Xe Graphics"
>-	depends on DRM && PCI && MMU && (m || (y && KUNIT=y))
>+	depends on DRM && PCI && MMU
> 	depends on ACPI_VIDEO || !ACPI
> 	select INTERVAL_TREE
> 	# we need shmfs for the swappable backing store, and in particular
>@@ -11,6 +11,7 @@ config DRM_XE
> 	select DRM_BUDDY
> 	select DRM_EXEC
> 	select DRM_KMS_HELPER
>+	select DRM_KUNIT_TEST_HELPERS if DRM_XE_KUNIT_TEST != n
> 	select DRM_PANEL
> 	select DRM_SUBALLOC_HELPER
> 	select DRM_DISPLAY_DP_HELPER
>diff --git a/drivers/gpu/drm/xe/Kconfig.debug b/drivers/gpu/drm/xe/Kconfig.debug
>index 549065f57a78..df02e5d17d26 100644
>--- a/drivers/gpu/drm/xe/Kconfig.debug
>+++ b/drivers/gpu/drm/xe/Kconfig.debug
>@@ -76,7 +76,6 @@ config DRM_XE_KUNIT_TEST
> 	depends on DRM_XE && KUNIT && DEBUG_FS
> 	default KUNIT_ALL_TESTS
> 	select DRM_EXPORT_FOR_TESTS if m
>-	select DRM_KUNIT_TEST_HELPERS
> 	help
> 	  Choose this option to allow the driver to perform selftests under
> 	  the kunit framework
>diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
>index 4c6ffe4b2172..b596e4482a9b 100644
>--- a/drivers/gpu/drm/xe/Makefile
>+++ b/drivers/gpu/drm/xe/Makefile
>@@ -158,8 +158,10 @@ xe-$(CONFIG_PCI_IOV) += \
> 	xe_lmtt_2l.o \
> 	xe_lmtt_ml.o
>
>-xe-$(CONFIG_DRM_XE_KUNIT_TEST) += \
>-	tests/xe_kunit_helpers.o
>+# include helpers for tests even when XE is built-in
>+ifdef CONFIG_DRM_XE_KUNIT_TEST
>+xe-y += tests/xe_kunit_helpers.o
>+endif
>
> # i915 Display compat #defines and #includes
> subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
>-- 
>2.39.2
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ