[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 2/3] ARM: GICv3 ITS: do not invalidate memory while sending a command


  • To: Marc Zyngier <maz@xxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Fri, 22 Sep 2023 00:22:11 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hvbdx4I4KaKuUT27x1PSNP1d0aUtfPXenaL//QoDjIE=; b=XYip8JoHbfKE5c9qxhcoFkxQAuVVmxKg7ojw9O5qsztZEd1GZVKRddhOJ036vh97rI5ICVtnw3VmWd/H+u00sHICqv1/nFu0m/P6gIIYTAUBrQLYr2zrM3wuZHdDJjpxS8GWWWRaMHiYqaZExTGvpUqugOB9zx3x9Bc6qKHpLiBA2VuumrCJoweqoQhwp6Qvm4KiUhbsPFHyoP5DPF3KLLFi5PhmKlxW3Mztl4hPeT/gEWjAx/fAhWrlTQ8l7//UK96+pknfYb2eWh54zcHX4JLb77xKnRAWYrPwJwncYfr32kLwVU7x3UKiMcWj7Ki2nyvPhlxjM2fi7m0gbGC5bQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O9C0hK7FDQstp4e3f5TuF5aoLAWY7dFKAb5dvZW0eqkETn7m2Yr+78lB4BtIcZ7p7aRhWx3fUg95tSNHoYlY0HwY3o4YsS3xdM3JNd72PNZ1kbRqhYgSpBP/RXd6+UOHuC/iUVuflP1wZ8jkse/JS2prXEj2pv+hDsmkFyIaSdOFsKoTLUmB+V9p3qRuodi2+O+lzgz2hFy4Sy6gNes3OrLTzoIIRBwY2BEydFSgsnOPfJkjozFAxuHYQXUJLDv8ATQe6CWRzA5lTkvjjQe9VEGIjeyamp1U4dR4PcD/oQ+uHv0BhSWaQ/ZOQhK7LVAKhkcUh7DDzuWdxjigjrMJOQ==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Fri, 22 Sep 2023 00:22:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZ6ux4LpE3chDIj0mOPudUv9951bAiHTaAgAAZXICAAA0EAIADt3gA
  • Thread-topic: [PATCH v1 2/3] ARM: GICv3 ITS: do not invalidate memory while sending a command

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@xxxxxxx> writes:

> On 19/09/2023 15:36, Volodymyr Babchuk wrote:
>> Julien Grall <julien@xxxxxxx> 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.