From: Marc Zyngier <maz@kernel.org>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
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 11:31:31 +0100 [thread overview]
Message-ID: <86wmwio5x8.wl-maz@kernel.org> (raw)
In-Reply-To: <875y43f45p.fsf@epam.com>
Volodymyr,
On Fri, 22 Sep 2023 01:22:11 +0100,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com> wrote:
>
>
> Hi Mark,
s/k/c/
>
> 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?
It really depends how you look at it. We use DC CIVA as the standard
way to give a buffer to a device, as that's what the DMA API
does. Switching to a simple clean is possible, but I don't really see
what it brings you.
ITS commands are usually written as a single command followed by a
SYNC/VSYNC. That's a total a 8 64bit words, which makes a cache line
on 99.999% of the implementations.
What do you gain by keeping the cache line around? Not much. By the
time you go around the command queue and need the same data again, it
will have been evicted from your L1 already.
So while I don't see a problem with what you are suggesting, I also
think the change is pretty much irrelevant.
HTH,
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2023-09-22 10:31 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
2023-09-22 10:31 ` Marc Zyngier [this message]
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=86wmwio5x8.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=Volodymyr_Babchuk@epam.com \
--cc=bertrand.marquis@arm.com \
--cc=julien@xen.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.