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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A601DC54EBD for ; Sun, 8 Jan 2023 16:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8sy5Tx8kCN6Iq7S46tOx2Fjku4guONng9PNaUVB02eU=; b=csU1cG72crMnJuuSqvHAouKTXO ruCor2PV7bN2RxbgkerNN7QxHXQ2Q5/+hWOBnX5cMXUkGJK7WbeYNHv71tRcG9ei5NI97OTt4sU8Z aZ8Et74a2dz+HPpghomuoZpJB0cmCyAZW3uiRwEOUQrVQ311zF13oF49Z2NnaMgJoeSw/uSWtUZW+ WsxcKwmTBDtvt3u4ocd6zCXFahERRslbKsMDWV8ODXMgbV940HRV//E2nI8wLZdSoEkhEu2wRNs7T NlSz39ikr2YTaT5zf7ZVu1n4aZG1rXZo9/7jOG3HZRnT1ilb+JkgCdY0HSqj7gdV4TIZFGtdGu2TO b1DB9xKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEYgH-00ENVM-Ib; Sun, 08 Jan 2023 16:37:57 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEYgE-00ENUP-UA for linux-riscv@lists.infradead.org; Sun, 08 Jan 2023 16:37:56 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 73CDFB80B4E; Sun, 8 Jan 2023 16:37:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCE04C433D2; Sun, 8 Jan 2023 16:37:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673195872; bh=fO7WILHy96bpYmLsV6EJE8l8P4rzMoGtSglPfFWyyZk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BkpmXJUec77Ct4qyTRMxHlDFF912yQ8lHfjCoQghpfy7WP4XnsBdrZrB0LOdBzNNU iKiQ9UuSLIyorj5ft5hlChk7sLsSPxjkA+h7lLTLMq3yeMgoeti5TTJNj4rdnahJub lChKxbRMuP1jzVHieuv5QYRi8U10UL+ss760XU7g04Icrhgf68nZl/wm9w7SEkLVxc Yh3l7CdSAceHD6MW3JafVfEnktt+8t2lR2kgAihYVrmFWscIVulDhGPRHETZLhItEE 4E7OXFAkXBu4heTWKLybIRU4sk7yFS7hKMWHAW3jThmCklimFULQThZ9MhjWXqY9Dm R3pLWgiTGQF0g== Date: Sun, 8 Jan 2023 16:37:45 +0000 From: Conor Dooley To: Arnd Bergmann Cc: Prabhakar , "Conor.Dooley" , Geert Uytterhoeven , Heiko =?iso-8859-1?Q?St=FCbner?= , guoren , Andrew Jones , Paul Walmsley , Palmer Dabbelt , Albert Ou , "open list:RISC-V ARCHITECTURE" , open list , devicetree@vger.kernel.org, Linux-Renesas , "Lad, Prabhakar" , Philipp Tomsich , Nathan Chancellor , Atish Patra , Anup Patel , Tsukasa OI , Jisheng Zhang , Mayuresh Chitale Subject: Re: [RFC PATCH v6 1/6] riscv: mm: dma-noncoherent: Switch using function pointers for cache management Message-ID: References: <20230106185526.260163-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20230106185526.260163-2-prabhakar.mahadev-lad.rj@bp.renesas.com> <6f7d06ef-d74d-4dfc-9b77-6ae83e0d7816@app.fastmail.com> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230108_083755_289583_A5046B62 X-CRM114-Status: GOOD ( 31.43 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3077708118462361802==" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org --===============3077708118462361802== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Uo+3eNsq3cPFx1XC" Content-Disposition: inline --Uo+3eNsq3cPFx1XC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 07, 2023 at 10:21:52PM +0000, Conor Dooley wrote: > On Sat, Jan 07, 2023 at 10:52:55PM +0100, Arnd Bergmann wrote: > > On Sat, Jan 7, 2023, at 00:29, Conor Dooley wrote: > > > On Fri, Jan 06, 2023 at 11:31:33PM +0100, Arnd Bergmann wrote: > > >> On Fri, Jan 6, 2023, at 19:55, Prabhakar wrote: > > >> > From: Lad Prabhakar > > >> > +struct riscv_cache_ops zicbom_cmo_ops =3D { > > >> > + .clean_range =3D &zicbom_cmo_clean_range, > > >> > + .inv_range =3D &zicbom_cmo_inval_range, > > >> > + .flush_range =3D &zicbom_cmo_flush_range, > > >> > +}; > > >> > +#else > > >> > +struct riscv_cache_ops zicbom_cmo_ops =3D { > > >> > + .clean_range =3D NULL, > > >> > + .inv_range =3D NULL, > > >> > + .flush_range =3D NULL, > > >> > + .riscv_dma_noncoherent_cmo_ops =3D NULL, > > >> > +}; > > >> > +#endif > > >> > +EXPORT_SYMBOL(zicbom_cmo_ops); > > >>=20 > > >> Same here: If the ZICBOM ISA is disabled, nothing should > > >> reference zicbom_cmo_ops. > > > > > >> Also, since ZICBOM is a standard > > >> extension, I think it makes sense to always have it enabled, > > >> at least whenever noncoherent DMA is supported, that way > > >> it can be the default that gets used in the absence of any > > >> nonstandard cache controller. > > > > > > While I think of it, this is not possible as Zicbom requires toolchain > > > support whereas the alternative methods for non-coherent DMA do not. > >=20 > > Ah, I see. Would it be possible to use the same .long trick > > as in the other ones though? Something like > >=20 > > #if CONFIG_AS_VERSION >=3D 23600 /* or whichever version */ >=20 >=20 > > /* proper inline asm */ > > #else > > /* .long hack */ > > #endif > >=20 > > That way everyone can use it, and the hack would automatically > > go away in a few years after linux requires a newer toolchain. >=20 > > Alternatively, the entire noncoherent-dma support could be > > made to depend on whichever toolchain introduced Zicbom. >=20 > Ehh, I don't think that's a great idea. It'd require far too recent a > toolchain IMO. >=20 > Ideally, in my opinion, we'd just do something like what Drew has > proposed for Zicboz, negating the need for a check at all: > https://lore.kernel.org/linux-riscv/20221027130247.31634-4-ajones@ventana= micro.com/ >=20 > Been waiting for that to be re-spun and Palmer to accept it before doing > the same thing for Zicbom. At present we have this in the arch Kconfig: >=20 > config TOOLCHAIN_HAS_ZICBOM > bool > default y > depends on !64BIT || $(cc-option,-mabi=3Dlp64 -march=3Drv64ima_zicbom) > depends on !32BIT || $(cc-option,-mabi=3Dilp32 -march=3Drv32ima_zicbom) > depends on LLD_VERSION >=3D 150000 || LD_VERSION >=3D 23800 >=20 > config RISCV_ISA_ZICBOM > bool "Zicbom extension support for non-coherent DMA operation" > depends on TOOLCHAIN_HAS_ZICBOM >=20 > The linker version check is entirely due to the linker having issues if > it sees zicbom in the ISA string in object files. >=20 > I'd been intending to do that for Zicbom anyway, so I guess I'll just go > do it & Prabhakar can attach it to his v7.. Should pop up here in a few minutes.. https://lore.kernel.org/linux-riscv/20230108163356.3063839-1-conor@kernel.o= rg/ Hopefully that both works & makes life easier. Certainly from a CI coverage point of view, relaxing toolchain requirements makes *my* life easier! --Uo+3eNsq3cPFx1XC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCY7rxWQAKCRB4tDGHoIJi 0ryGAQCWKOi3NHzJDMDfxuTDnh3ne6XEYr/c/TROBg8/5hibCAEA46nbu1SNDiOk LTkEJviTUBDND7tJdI8BwpGvy0eD0Q8= =KtoJ -----END PGP SIGNATURE----- --Uo+3eNsq3cPFx1XC-- --===============3077708118462361802== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv --===============3077708118462361802==--