[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGS_qxp=UAJ19zQOZKP8ywPiNAj4wT80ubH2YW060mmADoqBcw@mail.gmail.com>
Date: Mon, 11 Jul 2022 08:10:36 -0700
From: Daniel Latypov <dlatypov@...gle.com>
To: Maxime Ripard <maxime@...no.tech>
Cc: brendanhiggins@...gle.com, davidgow@...gle.com,
linux-kernel@...r.kernel.org, kunit-dev@...glegroups.com,
linux-kselftest@...r.kernel.org, skhan@...uxfoundation.org,
José Expósito <jose.exposito89@...il.com>,
Mike Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, linux-clk@...r.kernel.org
Subject: Re: [PATCH v3] kunit: tool: Enable virtio/PCI by default on UML
On Mon, Jul 11, 2022 at 7:46 AM Maxime Ripard <maxime@...no.tech> wrote:
>
> Unfortunately, this breaks the clock tests in next-20220711:
> $ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/clk/.kunitconfig --raw_output
Thanks, this is indeed an issue.
I remember noticing this in early April.
I incorrectly remembered that a fix had been sent.
A more minimal reproducer:
$ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/clk
'clk-gate-test.clk_gate_test_enable'
The part of the test that becomes problematic with this patch (i.e.
enabling logic iomem) is the cast on line 143.
130 struct clk_gate_test_context {
131 void __iomem *fake_mem;
132 struct clk_hw *hw;
133 struct clk_hw *parent;
134 u32 fake_reg; /* Keep at end, KASAN can detect out of bounds */
135 };
136
137 static struct clk_gate_test_context
*clk_gate_test_alloc_ctx(struct kunit *test)
138 {
139 struct clk_gate_test_context *ctx;
140
141 test->priv = ctx = kunit_kzalloc(test, sizeof(*ctx),
GFP_KERNEL);
142 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
143 ctx->fake_mem = (void __force __iomem *)&ctx->fake_reg;
144
145 return ctx;
146 }
A simple fix we could carry in the KUnit branch is this:
diff --git a/drivers/clk/.kunitconfig b/drivers/clk/.kunitconfig
index cdbc7d7deba9..2fbeb71316f8 100644
--- a/drivers/clk/.kunitconfig
+++ b/drivers/clk/.kunitconfig
@@ -2,3 +2,4 @@ CONFIG_KUNIT=y
CONFIG_COMMON_CLK=y
CONFIG_CLK_KUNIT_TEST=y
CONFIG_CLK_GATE_KUNIT_TEST=y
+CONFIG_UML_PCI_OVER_VIRTIO=n
The new ability to disable it comes from
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit&id=8a7c6f859a20ca36a9e3ce71662de697898c9ef5
Thoughts?
Daniel
Powered by blists - more mailing lists