From: Geert Uytterhoeven <geert@linux-m68k.org>
To: David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Krzysztof Karas <krzysztof.karas@intel.com>,
Sebastian Brzezinka <sebastian.brzezinka@intel.com>,
Krzysztof Niemiec <krzysztof.niemiec@intel.com>,
Maarten Lankhorst <dev@lankhorst.se>,
Andi Shyti <andi.shyti@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH v2] gpu: GPU_BUDDY_KUNIT_TEST should not select GPU_BUDDY
Date: Tue, 25 Aug 2026 17:29:59 +0200 [thread overview]
Message-ID: <e67a2cb0d599b75ae365882913c543e7b0c5b8a3.1787671708.git.geert@linux-m68k.org> (raw)
Enabling a (modular) test should not silently enable additional kernel
functionality, as that may increase the attack vector for a product.
Fix this by reverting the select to a dependency. Make sure the GPU
buddy allocator can be tested without enabling another driver that uses
DRM_BUDDY by making GPU_BUDDY visible if KUNIT is enabled.
The page based buddy allocator for GPU memory is only used by DRM.
Hence add a dependency on DRM to GPU_BUDDY, to prevent asking the user
about this code when configuring a kernel without DRM support.
Update drivers/gpu/tests/.kunitconfig accordingly.
Fixes: 8fe3fc37564920ae ("gpu: Fix dependencies in CONFIG_GPU_BUDDY_KUNIT_TEST")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
v2:
- Update drivers/gpu/tests/.kunitconfig.
---
drivers/gpu/Kconfig | 5 +++--
drivers/gpu/tests/.kunitconfig | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/Kconfig b/drivers/gpu/Kconfig
index 3bcf08260d73a782..d881ab6f7a006a3b 100644
--- a/drivers/gpu/Kconfig
+++ b/drivers/gpu/Kconfig
@@ -1,14 +1,15 @@
# SPDX-License-Identifier: GPL-2.0
config GPU_BUDDY
- bool
+ bool "Page based buddy allocator for GPU memory" if KUNIT
+ depends on DRM || COMPILE_TEST
help
A page based buddy allocator for GPU memory.
config GPU_BUDDY_KUNIT_TEST
tristate "KUnit tests for GPU buddy allocator" if !KUNIT_ALL_TESTS
depends on KUNIT
- select GPU_BUDDY
+ depends on GPU_BUDDY
default KUNIT_ALL_TESTS
help
KUnit tests for the GPU buddy allocator.
diff --git a/drivers/gpu/tests/.kunitconfig b/drivers/gpu/tests/.kunitconfig
index fd611b3dfe09c4f6..c103afc02c9ede16 100644
--- a/drivers/gpu/tests/.kunitconfig
+++ b/drivers/gpu/tests/.kunitconfig
@@ -1,2 +1,4 @@
CONFIG_KUNIT=y
+CONFIG_COMPILE_TEST=y
+CONFIG_GPU_BUDDY=y
CONFIG_GPU_BUDDY_KUNIT_TEST=y
--
2.43.0
next reply other threads:[~2026-08-25 15:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 15:29 Geert Uytterhoeven [this message]
2026-08-25 18:55 ` Andi Shyti
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=e67a2cb0d599b75ae365882913c543e7b0c5b8a3.1787671708.git.geert@linux-m68k.org \
--to=geert@linux-m68k.org \
--cc=airlied@gmail.com \
--cc=andi.shyti@linux.intel.com \
--cc=dev@lankhorst.se \
--cc=dri-devel@lists.freedesktop.org \
--cc=krzysztof.karas@intel.com \
--cc=krzysztof.niemiec@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sebastian.brzezinka@intel.com \
--cc=simona@ffwll.ch \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®