From: Stephen Boyd <sboyd@kernel.org>
To: Daniel Latypov <dlatypov@google.com>, David Gow <davidgow@google.com>
Cc: Brendan Higgins <brendanhiggins@google.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
KUnit Development <kunit-dev@googlegroups.com>,
<linux-kselftest@vger.kernel.org>,
Shuah Khan <skhan@linuxfoundation.org>,
linux-clk@vger.kernel.org, Maxime Ripard <maxime@cerno.tech>
Subject: Re: [PATCH] clk: explicitly disable CONFIG_UML_PCI_OVER_VIRTIO in .kunitconfig
Date: Tue, 26 Jul 2022 13:07:39 -0700 [thread overview]
Message-ID: <20220726200741.2DDA2C433C1@smtp.kernel.org> (raw)
In-Reply-To: <CABVgOS=bm5TmEBd8jxuTPJy426OgC14ryqn4FLQR1pHNf5uhsw@mail.gmail.com>
Quoting David Gow (2022-07-11 23:44:08)
>
> So, as I understand it, casting a regular pointer to an __iomem
> pointer (as the clk test does) isn't technically correct, though it
> does work on almost every architecture out there. If we want some way
> of intercepting I/O access, then then that'll need to be handled by
> the various read()/write() functions.
Yep. It's test code though so it seemed ok at the time.
>
> UML doesn't support iomem at all out of the box, and logic_iomem is a
> way of implementing it which allow us to attach handler functions to
> blocks of memory, albeit with more constraints about what addresses
> get used. Brendan started implementing a "fake hardware" interface on
> top of this here, though it's still in-progress:
> https://kunit-review.googlesource.com/c/linux/+/5272/4
Cool.
>
> Ultimately, I think the 'correct' solution here will be
> logic_iomem-based, but doing that nicely will probably require one of
> two things:
> - logic_iomem to support non-UML architectures as well (becoming a
> generic "insert a 'fake' device here" system)
> - logic_iomem to have some way of "passing through" access to an io
> memory region through to the normal underlying memory.
>
> Ideally, we'll have both, and maybe even defaults which will allow
> hacks like this to continue working (perhaps with a warning?). That'll
> require some significant (and probably not uncontroversial) work on
> how iomem accesses work in general, though, possibly with performance
> impact.
Does it matter to pass through to real iomem? I'd think we wouldn't want
to actually affect real hardware in test code. Instead we'd like to fake
it and then look at the result, like how the clk test works.
>
> The other option of using function redirection on the io read()
> write() functions exists, and would be a bit simpler in the
> short-term, but would probably result in a lot of tests reimplementing
> this, and also would have some performance impacts, as the I/O
> accesses wouldn't be able to be inlined if KUNIT is enabled.
>
That sounds OK to me because nobody is enabling KUNIT in production,
right?
next prev parent reply other threads:[~2022-07-26 20:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 16:27 [PATCH] clk: explicitly disable CONFIG_UML_PCI_OVER_VIRTIO in .kunitconfig Daniel Latypov
2022-07-11 20:48 ` Stephen Boyd
2022-07-11 23:03 ` Daniel Latypov
2022-07-12 6:44 ` David Gow
2022-07-26 20:07 ` Stephen Boyd [this message]
2022-07-26 20:26 ` Daniel Latypov
2022-07-27 7:33 ` David Gow
2022-07-12 7:19 ` David Gow
2022-07-13 21:08 ` Brendan Higgins
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=20220726200741.2DDA2C433C1@smtp.kernel.org \
--to=sboyd@kernel.org \
--cc=brendanhiggins@google.com \
--cc=davidgow@google.com \
--cc=dlatypov@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=maxime@cerno.tech \
--cc=skhan@linuxfoundation.org \
/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