[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 22:02:39 +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=YrnjRjeA70pd1e/P97qqXsmHPDfkXcLUyIaVep3si5U=; b=ArQkYikU86PgO/xXBhDzCjG52JTIz7ZFxXO35B7GXtvcsPYfP+bvisK3PRBWgHABRQgE26cGtsCA7ywyYEhMS8TH4FxrJCKda3l7M61L5SFnW6ahuNEH1EXOnC073IS006VIHWZTzauc0ICrB3gnlAbmtYcwqL0Rm3BjsYMtw7hBIQ5reCemds/qlo1JUW9pLLlGhuC8THp0k8JjNCQN1YiMRuAuT2zMpvRMugznbxFkg8eslHyy34r3kGiL6JAJax0GAxp/YCLYT+bUc4rHkSGsI0sV/U/a1G5pyMuUop6S4z2MUVyNyFzG56wizzkcEqRhS5aav09IXfOidolkDQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oWhoxnP4hGRRASICsX60nPVkbdoobtmFE9+tmXW+lIStPJs2X3TO03aep4KWwszMkQADcm1B6Acsrw5FDMkijMcLVBQdHgIJFi1fCaqWYD5zspHoqDBOIQwyRxBXwjeYONMMCzHXrSjKaEVPGZAxfyq0kxsdUzsvxCunXJ2y2FeCyGNps1TNv+WKNvD4E+Kr2aViNs2y6scVZP2TAoOQX0unRxyDYXAENdy3TZRWiM4jl7ZjHppiUoZoOcOqFBAuCk66aVSArAv5OoQZWa7mkBsJQlFZiT6Qn+8PMlMbecmTctjSfvCCW8KyAAg8F8XGr4aoGXGxYt9Bcw3lw5qgeA==
- 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 22:03:02 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHZ6ux4LpE3chDIj0mOPudUv9951bAiHTaAgAAZXICAAA0EAIADt3gAgACvAICAAMDUgA==
- Thread-topic: [PATCH v1 2/3] ARM: GICv3 ITS: do not invalidate memory while sending a command
Hello Marc,
Marc Zyngier <maz@xxxxxxxxxx> writes:
> Volodymyr,
>
> On Fri, 22 Sep 2023 01:22:11 +0100,
> Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx> wrote:
>>
>>
>> Hi Mark,
>
> s/k/c/
Oh, I'm sorry.
>>
>> 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.
This is a great point. Thank you.
--
WBR, Volodymyr
|