From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Marc Zyngier <maz@kernel.org>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Stewart Hildebrand <stewart.hildebrand@amd.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Bertrand Marquis <bertrand.marquis@arm.com>,
Julien Grall <julien@xen.org>
Subject: Re: [PATCH v1 2/3] ARM: GICv3 ITS: do not invalidate memory while sending a command
Date: Fri, 22 Sep 2023 00:22:11 +0000 [thread overview]
Message-ID: <875y43f45p.fsf@epam.com> (raw)
In-Reply-To: <597db9f5-b959-4b75-9410-0d0c16e3acda@xen.org>
Hi Mark,
I am writing to you, because you are GICv3 maintainer in Linux. We are
updating ITS driver in Xen and we have a question about cache
maintenance WRT memory shared with ITS. As I can see, the Linux ITS
driver uses gic_flush_dcache_to_poc() all over the code. This boils down
to "dc civac" instruction which does both clean and invalidate. But do
we really need to invalidate a cache when we are sending an ITS command?
In my understanding it is sufficient to clean a cache only and Linux
uses clean&invalidate just out of convenience. Is this correct?
Below you can find our discussion about this.
Julien Grall <julien@xen.org> writes:
> On 19/09/2023 15:36, Volodymyr Babchuk wrote:
>> Julien Grall <julien@xen.org> writes:
>>> On 19/09/2023 12:28, Volodymyr Babchuk wrote:
>>>> There is no need to invalidate cache entry because we just wrote into a
>>>> memory region. Writing itself guarantees that cache entry is valid.
>>>
>>> The goal of invalidate is to remove the line from the cache. So I
>>> don't quite understand the reasoning here.
>>>
>> Well, I may be wrong, but what is the goal in removing line from the
>> cache? As I see this, we want to be sure that ITS sees data written in
>> the memory, so we should flush a cache line. But why do we need to
>> remove it from CPU's cache?
>
> I don't exactly know. From a brief look I agree with you. However, our
> driver is based on Linux where the clean & invalidate is also used. So
> I am a little be cautious to remove it.
>
> The way forward would be to ask the Marc Zyngier (GICv3 maintainer)
> why it was added in Linux. Then we can decide whether this can be
> removed in Xen.
>
> Cheers,
--
WBR, Volodymyr
next prev parent reply other threads:[~2023-09-22 0:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-19 11:28 [PATCH v1 0/3] ARM: ITS: implement TODO and fix issues with cache Volodymyr Babchuk
2023-09-19 11:28 ` [PATCH v1 1/3] ARM: GICv3 ITS: issue INVALL command after mapping host events Volodymyr Babchuk
2023-09-19 12:22 ` Julien Grall
2023-09-19 11:28 ` [PATCH v1 2/3] ARM: GICv3 ITS: do not invalidate memory while sending a command Volodymyr Babchuk
2023-09-19 13:02 ` Julien Grall
2023-09-19 14:36 ` Volodymyr Babchuk
2023-09-19 15:19 ` Julien Grall
2023-09-22 0:22 ` Volodymyr Babchuk [this message]
2023-09-22 10:31 ` Marc Zyngier
2023-09-22 22:02 ` Volodymyr Babchuk
2023-09-19 11:28 ` [PATCH v1 3/3] ARM: GICv3 ITS: flush all buffers, not just command queue Volodymyr Babchuk
2023-09-19 13:10 ` Julien Grall
2023-09-19 13:14 ` Julien Grall
2023-09-19 19:17 ` Stewart Hildebrand
2023-09-19 19:07 ` [PATCH v1 0/3] ARM: ITS: implement TODO and fix issues with cache Stewart Hildebrand
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=875y43f45p.fsf@epam.com \
--to=volodymyr_babchuk@epam.com \
--cc=bertrand.marquis@arm.com \
--cc=julien@xen.org \
--cc=maz@kernel.org \
--cc=sstabellini@kernel.org \
--cc=stewart.hildebrand@amd.com \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.