From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA5E7C4743D for ; Sun, 6 Jun 2021 18:14:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE1CA61185 for ; Sun, 6 Jun 2021 18:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230131AbhFFSQ3 (ORCPT ); Sun, 6 Jun 2021 14:16:29 -0400 Received: from mailgate.ics.forth.gr ([139.91.1.2]:18870 "EHLO mailgate.ics.forth.gr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbhFFSQ1 (ORCPT ); Sun, 6 Jun 2021 14:16:27 -0400 Received: from av3.ics.forth.gr (av3in.ics.forth.gr [139.91.1.77]) by mailgate.ics.forth.gr (8.15.2/ICS-FORTH/V10-1.8-GATE) with ESMTP id 156IEZjU052680 for ; Sun, 6 Jun 2021 21:14:35 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; d=ics.forth.gr; s=av; c=relaxed/simple; q=dns/txt; i=@ics.forth.gr; t=1623003270; x=1625595270; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=npEuPgoCmYcLXuGAj3lk3Z8Qz7Q4T7SBKRpOBm5UgpU=; b=hHDfDtMKpOyRtSkZhq7xBlnJ04RmBqARosUatJPpiYEEAzkTDz1/XCIEtmvaKA2H daXiSsGxxQHvUqI8eom59MU6ie0qGSaGBwLNtNm1B791BSOh5ZYYDoNjNRrVJh1w zGcZkeCFcE44viI0P1K0UjoF2LFnUgiFsRgdLXVL54xUxenQC+d6wNaXB2aBZ6oJ cChED7Low7gW8a8BEwjJxbKbqatGFFSxC/Zuk6C1LBZgC0amSvQsvocRGyVjX6Gp T3vfxsBf3pR3EtsL74RYViiMqz1ybhsQJM/M4gMqT9TneJcaHArVYCC1ZJrvZ/7Z iS5aqRjvzHkdA5Fx7bSqNw==; X-AuditID: 8b5b014d-96ef2700000067b6-54-60bd108627a9 Received: from enigma.ics.forth.gr (webmail.ics.forth.gr [139.91.151.35]) by av3.ics.forth.gr (Symantec Messaging Gateway) with SMTP id 53.4A.26550.6801DB06; Sun, 6 Jun 2021 21:14:30 +0300 (EEST) X-ICS-AUTH-INFO: Authenticated user: at ics.forth.gr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sun, 06 Jun 2021 21:14:28 +0300 From: Nick Kossifidis To: Guo Ren Cc: Christoph Hellwig , Drew Fustini , Anup Patel , Palmer Dabbelt , wefu@redhat.com, lazyparser@gmail.com, linux-riscv , Linux Kernel Mailing List , linux-arch , linux-sunxi@lists.linux.dev, Guo Ren , Paul Walmsley , Nick Kossifidis , Benjamin Koch , Matteo Croce , Wei Fu Subject: Re: [PATCH RFC 0/3] riscv: Add DMA_COHERENT support Organization: FORTH In-Reply-To: References: <1621400656-25678-1-git-send-email-guoren@kernel.org> <20210519052048.GA24853@lst.de> <20210519064435.GA3076809@x1> <20210519065352.GA31590@lst.de> Message-ID: <29733b0931d9dd6a2f0b6919067c7efe@mailhost.ics.forth.gr> X-Sender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79EEUvpo09sCXHcPkcz+JLf7QndFLY5YDOvEktxRqKhFnNRcSIARuBeSEgD AAA= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Στις 2021-05-20 04:45, Guo Ren έγραψε: > On Wed, May 19, 2021 at 2:53 PM Christoph Hellwig wrote: >> >> On Tue, May 18, 2021 at 11:44:35PM -0700, Drew Fustini wrote: >> > This patch series looks like it might be useful for the StarFive JH7100 >> > [1] [2] too as it has peripherals on a non-coherent interconnect. GMAC, >> > USB and SDIO require that the L2 cache must be manually flushed after >> > DMA operations if the data is intended to be shared with U74 cores [2]. >> >> Not too much, given that the SiFive lineage CPUs have an uncached >> window, that is a totally different way to allocate uncached memory. > It's a very big MIPS smell. What's the attribute of the uncached > window? (uncached + strong-order/ uncached + weak, most vendors still > use AXI interconnect, how to deal with a bufferable attribute?) In > fact, customers' drivers use different ways to deal with DMA memory in > non-coherent SOC. Most riscv SOC vendors are from ARM, so giving them > the same way in DMA memory is a smart choice. So using PTE attributes > is more suitable. > > See: > https://github.com/riscv/virtual-memory/blob/main/specs/611-virtual-memory-diff.pdf > 4.4.1 > The draft supports custom attribute bits in PTE. > Not only it doesn't support custom attributes on PTEs: "Bits63–54 are reserved for future standard use and must be zeroed by software for forward compatibility." It also goes further to say that: "if any of these bits are set, a page-fault exception is raised"