Re: [PATCH v3 04/15] kunit: Add documentation for warning backtrace suppression API

2024-04-09 Thread David Gow
hat might overcomplicate it a bit. It also might be nice to document the individual macros with kerneldoc comments. (Though, that could equally fit in patch #1). Still, this is the most important bit, so I'm happy to have it as-is. Reviewed-by: David Gow Cheers, -- David > v2: > - Rebase

Re: [PATCH v3 02/15] kunit: bug: Count suppressed warning backtraces

2024-04-09 Thread David Gow
gt; architectures due to include file recursion, so use a plain integer > for now. > > Acked-by: Dan Carpenter > Reviewed-by: Kees Cook > Tested-by: Linux Kernel Functional Testing > Signed-off-by: Guenter Roeck > --- Looks good to me, thanks. Reviewed-by: David Gow Ch

Re: [PATCH v3 03/15] kunit: Add test cases for backtrace warning suppression

2024-04-09 Thread David Gow
On Wed, 3 Apr 2024 at 21:19, Guenter Roeck wrote: > > Add unit tests to verify that warning backtrace suppression works. > > If backtrace suppression does _not_ work, the unit tests will likely > trigger unsuppressed backtraces, which should actually help to get > the affected architectures /

Re: [PATCH v3 01/15] bug/kunit: Core support for suppressing warning backtraces

2024-04-09 Thread David Gow
On Wed, 3 Apr 2024 at 21:19, Guenter Roeck wrote: > > Some unit tests intentionally trigger warning backtraces by passing > bad parameters to API functions. Such unit tests typically check the > return value from those calls, not the existence of the warning backtrace. > > Such intentionally

Re: linux-next: build failure after merge of the kunit-next tree

2024-02-29 Thread David Gow
On Thu, 29 Feb 2024 at 23:07, Shuah Khan wrote: > > Hi Stephen, > > On 2/28/24 21:26, Stephen Rothwell wrote: > > Hi all, > > > > After merging the kunit-next tree, today's linux-next build (x86_64 > > allmodconfig) failed like this: > > > > In file included from

[PATCH v2] drm: tests: Fix invalid printf format specifiers in KUnit tests

2024-02-27 Thread David Gow
thew Auld Acked-by: Christian König Tested-by: Guenter Roeck Reviewed-by: Justin Stitt Signed-off-by: David Gow --- Changes since v1: https://lore.kernel.org/linux-kselftest/20240221092728.1281499-8-david...@google.com/ - Split this patch out, as the others have been applied already. - Reba

Re: [PATCH 2/9] lib/cmdline: Fix an invalid format specifier in an assertion msg

2024-02-21 Thread David Gow
On Thu, 22 Feb 2024 at 04:10, 'Justin Stitt' via KUnit Development wrote: > > Hi, > > On Wed, Feb 21, 2024 at 05:27:15PM +0800, David Gow wrote: > > The correct format specifier for p - n (both p and n are pointers) is > > %td, as the type should be ptrdiff_t. >

[PATCH 9/9] kunit: Annotate _MSG assertion variants with gnu printf specifiers

2024-02-21 Thread David Gow
not have the __printf attribute, so gcc couldn't warn on incorrect agruments. It turns out there were quite a few tests with such incorrect arguments. Add the __printf() specifier now that we've fixed these errors, to prevent them from recurring. Suggested-by: Linus Torvalds Signed-off-by: David Gow

[PATCH 8/9] drm/xe/tests: Fix printf format specifiers in xe_migrate test

2024-02-21 Thread David Gow
the error code manually with PTR_ERR(). (This also results in a nicer output when the error code is known.) Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Signed-off-by: David Gow --- drivers/gpu/drm/xe/tests/xe_migrate.c | 8 1 file changed, 4 insert

[PATCH 7/9] drm: tests: Fix invalid printf format specifiers in KUnit tests

2024-02-21 Thread David Gow
should be more useful anyway. Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test") Fixes: fca7526b7d89 ("drm/tests/drm_buddy: fix build failure on 32-bit targets") Fixes: fc8d29e298cf ("drm: selftest: convert drm_mm selftest to KUnit") Signed-off-b

[PATCH 6/9] net: test: Fix printf format specifier in skb_segment kunit test

2024-02-21 Thread David Gow
rather than a number if available, which should make the output more readable, too). Fixes: b3098d32ed6e ("net: add skb_segment kunit test") Signed-off-by: David Gow --- net/core/gso_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/gso_test.c

[PATCH 5/9] rtc: test: Fix invalid format specifier.

2024-02-21 Thread David Gow
'days' is a s64 (from div_s64), and so should use a %lld specifier. This was found by extending KUnit's assertion macros to use gcc's __printf attribute. Fixes: 1d1bb12a8b18 ("rtc: Improve performance of rtc_time64_to_tm(). Add tests.") Signed-off-by: David Gow --- drivers/rtc/lib_

[PATCH 4/9] time: test: Fix incorrect format specifier

2024-02-21 Thread David Gow
'days' is a s64 (from div_s64), and so should use a %lld specifier. This was found by extending KUnit's assertion macros to use gcc's __printf attribute. Fixes: 276010551664 ("time: Improve performance of time64_to_tm()") Signed-off-by: David Gow --- kernel/time/time_test.c | 2

[PATCH 3/9] lib: memcpy_kunit: Fix an invalid format specifier in an assertion msg

2024-02-21 Thread David Gow
The 'i' passed as an assertion message is a size_t, so should use '%zu', not '%d'. This was found by annotating the _MSG() variants of KUnit's assertions to let gcc validate the format strings. Fixes: bb95ebbe89a7 ("lib: Introduce CONFIG_MEMCPY_KUNIT_TEST") Signed-off-by: David Gow

[PATCH 2/9] lib/cmdline: Fix an invalid format specifier in an assertion msg

2024-02-21 Thread David Gow
of the architecture being built). Fixes: 0ea09083116d ("lib/cmdline: Allow get_options() to take 0 to validate the input") Signed-off-by: David Gow --- lib/cmdline_kunit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cmdline_kunit.c b/lib/cmdline_kunit.c index d4

[PATCH 1/9] kunit: test: Log the correct filter string in executor_test

2024-02-21 Thread David Gow
ering attributes") Signed-off-by: David Gow --- lib/kunit/executor_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kunit/executor_test.c b/lib/kunit/executor_test.c index 22d4ee86dbed..3f7f967e3688 100644 --- a/lib/kunit/executor_test.c +++ b/lib/kunit/executor_test.c

[PATCH 0/9] kunit: Fix printf format specifier issues in KUnit assertions

2024-02-21 Thread David Gow
these (or equivalent) in for 6.9 if possible, so please do take a look if possible. Thanks, -- David Reported-by: Linus Torvalds Closes: https://lore.kernel.org/linux-kselftest/CAHk-=wgjmoqudo5f8shh1f4rzzwzapnvcw643m5-yj+bfsf...@mail.gmail.com/ David Gow (9): kunit: test: Log the correct filter

[PATCH 3/3] drm/vc4: tests: Use KUNIT_DEFINE_ACTION_WRAPPER

2023-11-10 Thread David Gow
, so replace the manual implementation. Signed-off-by: David Gow --- This patch should be a no-op, just moving to use a standard macro to implement these wrappers rather than hand-coding them. Let me know if you'd prefer to take these in separately via the drm trees, or if you're okay with having

[PATCH 2/3] drm/tests: Use KUNIT_DEFINE_ACTION_WRAPPER()

2023-11-10 Thread David Gow
reduces the boilerplate needed. Signed-off-by: David Gow --- This patch should be a no-op, just moving to use a standard macro to implement these wrappers rather than hand-coding them. Let me know if you'd prefer to take these in separately via the drm trees, or if you're okay with having

[PATCH 1/3] kunit: Add a macro to wrap a deferred action function

2023-11-10 Thread David Gow
/linux/issues/1750 Signed-off-by: David Gow --- This is a follow-up to the RFC here: https://lore.kernel.org/linux-kselftest/20230915050125.3609689-1-david...@google.com/ There's no difference in the macro implementation, just an update to the KUnit tests to use it. This version is intended

Re: [PATCH 2/3] kunit: Add kunit_move_action_to_top_or_reset() to reorder actions

2023-09-22 Thread David Gow
On Wed, 20 Sept 2023 at 14:12, Arthur Grillo wrote: > > On Kunit, if we allocate a resource A and B on this order, with its > deferred actions to free them. The resource stack would be something > like this: > > +-+ > | free(B) | > +-+ > | ...

Re: [PATCH v5 9/9] drm: selftest: convert drm_mm selftest to KUnit

2023-07-25 Thread David Gow
; Considering the current adoption of the KUnit framework, convert the > > > DRM mm selftest to the KUnit API. > > > > > > Signed-off-by: Arthur Grillo > > > Tested-by: David Gow > > > Acked-by: Daniel Latypov > > > Reviewed-by: Javier M

Re: [PATCH] kunit: drm: make DRM buddy test compatible with other pages sizes

2023-04-19 Thread David Gow
> Fixes: 92937f170d3f ("drm/selftests: add drm buddy alloc range testcase") > Signed-off-by: Nico Pache > --- Nice catch! This makes sense to me (and doesn't regress anything on my various 4k-page machines, at least). Reviewed-by: David Gow Cheers, -- David > drivers/g

[PATCH 2/2] drm: test: Fix 32-bit issue in drm_buddy_test

2023-03-29 Thread David Gow
reproduces randomly, as the parameters passed to the buddy allocator in this test are random. The seed 0xb2e06022 reproduced it fine here. For now, just hardcode an is_power_of_2() implementation using x & (x - 1). Signed-off-by: David Gow --- There are actually a couple of is_power_of_2

[PATCH 1/2] drm: buddy_allocator: Fix buddy allocator init on 32-bit systems

2023-03-29 Thread David Gow
(). This version instead recalculates the size based on the order. Reported-by: Luís Mendes Link: https://lore.kernel.org/lkml/CAEzXK1oghXAB_KpKpm=-cvidqbnah0qfgytssjzgvvyj4u7...@mail.gmail.com/T/ Signed-off-by: David Gow --- drivers/gpu/drm/drm_buddy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

Re: [PATCH] drm/format-helper: Use KUNIT_EXPECT_MEMEQ macro

2023-01-31 Thread David Gow
, not the KUnit one (it doesn't apply to the kselftest/kunit tree as-is). Reviewed-by: David Gow Cheers, -- David > drivers/gpu/drm/tests/drm_format_helper_test.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/tests/dr

Re: [PATCH 00/24] drm: Introduce Kunit Tests to VC4

2022-11-24 Thread David Gow
ipard > To: Thomas Zimmermann > Cc: Dave Stevenson > Cc: Javier Martinez Canillas > Cc: Greg Kroah-Hartman > Cc: Maíra Canal > Cc: Brendan Higgins > Cc: David Gow > Cc: linux-kselft...@vger.kernel.org > Cc: kunit-...@googlegroups.com > Cc: dri-devel@lists.freedesk

Re: KUnit issues - Was: [igt-dev] [PATCH RFC v2 8/8] drm/i915: check if current->mm is not NULL

2022-11-07 Thread David Gow
On Thu, Nov 3, 2022 at 11:23 PM Mauro Carvalho Chehab wrote: > > Hi, > > I'm facing a couple of issues when testing KUnit with the i915 driver. > > The DRM subsystem and the i915 driver has, for a long time, his own > way to do unit tests, which seems to be added before KUnit. > > I'm now

Re: [PATCH] drm: tests: Fix a buffer overflow in format_helper_test

2022-10-21 Thread David Gow
On Wed, Oct 19, 2022 at 7:36 PM Maíra Canal wrote: > > [cc Javier] > > Hi David, > > On 10/19/22 04:32, David Gow wrote: > > The xrgb2101010 format conversion test (unlike for other formats) does > > an endianness conversion on the results. However, it always con

Re: [PATCH] drm: tests: Fix a buffer overflow in format_helper_test

2022-10-21 Thread David Gow
On Thu, Oct 20, 2022 at 4:03 PM Javier Martinez Canillas wrote: > > On 10/19/22 19:29, José Expósito wrote: > > [...] > > >> drivers/gpu/drm/tests/drm_format_helper_test.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git

[PATCH] drm: tests: Fix a buffer overflow in format_helper_test

2022-10-19 Thread David Gow
.*xrgb2101010 Reported-by: Linux Kernel Functional Testing Fixes: 453114319699 ("drm/format-helper: Add KUnit tests for drm_fb_xrgb_to_xrgb2101010()") Signed-off-by: David Gow --- This is a fix for the issue reported here: https://lore.kernel.org/dri-devel/CA+G9fYs

Re: not ok 1 - single_pixel_source_buffer: The buggy address belongs to the physical page

2022-10-18 Thread David Gow
On Tue, Oct 18, 2022 at 3:54 PM Javier Martinez Canillas wrote: > > [adding a few folks to Cc list that might help with this issue] > > Hello Naresh, > > Thanks a lot for your report. > > On 10/18/22 08:40, Naresh Kamboju wrote: > > Following kunit tests started failing on Linux mainline. > > -

Re: [PATCH v2 2/2] drm/tests: Split drm_test_dp_mst_sideband_msg_req_decode into parameterized tests

2022-09-30 Thread David Gow
On Fri, Sep 30, 2022 at 6:33 AM Michał Winiarski wrote: > > On Tue, Sep 27, 2022 at 07:12:06PM -0300, Maíra Canal wrote: > > The drm_test_dp_mst_sideband_msg_req_decode repeats the same test > > structure with different parameters. This could be better represented > > by parameterized tests,

Re: [PATCH] drm/ttm: provide default page protection for UML

2021-09-03 Thread David Gow
On Thu, Sep 2, 2021 at 10:46 PM Daniel Vetter wrote: > > On Thu, Sep 02, 2021 at 07:19:01AM +0100, Anton Ivanov wrote: > > On 02/09/2021 06:52, Randy Dunlap wrote: > > > On 9/1/21 10:48 PM, Anton Ivanov wrote: > > > > On 02/09/2021 03:01, Randy Dunlap wrote: > > > > > boot_cpu_data [struct