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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89665C433F5 for ; Mon, 20 Dec 2021 09:31:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229537AbhLTJbd (ORCPT ); Mon, 20 Dec 2021 04:31:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbhLTJbc (ORCPT ); Mon, 20 Dec 2021 04:31:32 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D65ADC06173F for ; Mon, 20 Dec 2021 01:31:31 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id j9so18841563wrc.0 for ; Mon, 20 Dec 2021 01:31:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Htm2M/1UPb5WYk7y28mkq1tTi0RGZ2Jp48YbGwwH0kA=; b=ZF/MduX4/4cT+oBmR4T+v8wQ+QDwsxOJuqK9/wRsJS6zcgT2AKpV/tkvOsOZ5L5v6m 6lR2L48gW5VYExLPAmgVcEuReMeF3qKNn0fEl4cDu9N7mwYe03+7XG7yhhRMXGiShQAG VuATgjbbmIZ4i7mM+4AGwwVET8Ejjexw+StR8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to; bh=Htm2M/1UPb5WYk7y28mkq1tTi0RGZ2Jp48YbGwwH0kA=; b=Cr93fdc8J2TMQUh3OrelO7Q4Lea+VWKa19FNtMUJFpTL6arU8gnGs4c1SeVahRf4hf ENQZvDHj0bA02KBCE1AxXb51CgU6aTkEFNh6JIEwn1IZI3KzDhdjR7UFAk9yMEQWgPd8 fv1vXwPC+6pjc6c1OFLDl3OXkV27YzUvtL+5hf8Ty9BTk6POoMyFZcfJE+gcfwzPgRiJ X81sAq6q3IOsB1+sjPs2A++3IT+02NygZYddQctPt9gTs2CBBVOMadGP5//XwFrHerDf dIDEg/AUdqRE84WmP6PyxuagSRlj37B/+pr5hqR/1l53Nn4mwVYlqswuhdBIk7su4rHx W8UA== X-Gm-Message-State: AOAM532XfaGN7mREKv6tqambprZtUeSMpzU9o6cqDxxbSnOdVnhKUxFy OT1ftc1iqDUUIgqZxZKHoXpyvw== X-Google-Smtp-Source: ABdhPJzIKEWyHUlLuEcrr0JV7s9D8oMvc34Me/oLD7Mq3UMFLkvWeDwegpHqyN1hAZyC9N8Yil8rXg== X-Received: by 2002:a05:6000:148:: with SMTP id r8mr11746823wrx.333.1639992690397; Mon, 20 Dec 2021 01:31:30 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id r17sm15109035wmq.11.2021.12.20.01.31.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 01:31:29 -0800 (PST) Date: Mon, 20 Dec 2021 10:31:27 +0100 From: Daniel Vetter To: Jason Gunthorpe Cc: Christian =?iso-8859-1?Q?K=F6nig?= , Shunsuke Mie , Zhu Yanjun , Alex Deucher , Daniel Vetter , Doug Ledford , Jianxin Xiong , Leon Romanovsky , Maor Gottlieb , Sean Hefty , Sumit Semwal , dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org, Linux Kernel Mailing List , linux-rdma , Damian Hobson-Garcia , Takanari Hayama , Tomohito Esaki Subject: Re: [RFC PATCH v4 0/2] RDMA/rxe: Add dma-buf support Message-ID: Mail-Followup-To: Jason Gunthorpe , Christian =?iso-8859-1?Q?K=F6nig?= , Shunsuke Mie , Zhu Yanjun , Alex Deucher , Doug Ledford , Jianxin Xiong , Leon Romanovsky , Maor Gottlieb , Sean Hefty , Sumit Semwal , dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org, Linux Kernel Mailing List , linux-rdma , Damian Hobson-Garcia , Takanari Hayama , Tomohito Esaki References: <20211122110817.33319-1-mie@igel.co.jp> <20211207171447.GA6467@ziepe.ca> <20211210124204.GG6467@ziepe.ca> <880e25ad-4fe9-eacd-a971-993eaea37fc4@amd.com> <20211210132656.GH6467@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211210132656.GH6467@ziepe.ca> X-Operating-System: Linux phenom 5.10.0-8-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 10, 2021 at 09:26:56AM -0400, Jason Gunthorpe wrote: > On Fri, Dec 10, 2021 at 01:47:37PM +0100, Christian König wrote: > > Am 10.12.21 um 13:42 schrieb Jason Gunthorpe: > > > On Fri, Dec 10, 2021 at 08:29:24PM +0900, Shunsuke Mie wrote: > > > > Hi Jason, > > > > Thank you for replying. > > > > > > > > 2021年12月8日(水) 2:14 Jason Gunthorpe : > > > > > On Fri, Dec 03, 2021 at 12:51:44PM +0900, Shunsuke Mie wrote: > > > > > > Hi maintainers, > > > > > > > > > > > > Could you please review this patch series? > > > > > Why is it RFC? > > > > > > > > > > I'm confused why this is useful? > > > > > > > > > > This can't do copy from MMIO memory, so it shouldn't be compatible > > > > > with things like Gaudi - does something prevent this? > > > > I think if an export of the dma-buf supports vmap, CPU is able to access the > > > > mmio memory. > > > > > > > > Is it wrong? If this is wrong, there is no advantages this changes.. > > > I don't know what the dmabuf folks did, but yes, it is wrong. > > > > > > IOMEM must be touched using only special accessors, some platforms > > > crash if you don't do this. Even x86 will crash if you touch it with > > > something like an XMM optimized memcpy. > > > > > > Christian? If the vmap succeeds what rules must the caller use to > > > access the memory? > > > > See dma-buf-map.h and especially struct dma_buf_map. > > > > MMIO memory is perfectly supported here and actually the most common case. > > Okay that looks sane, but this rxe RFC seems to ignore this > completely. It stuffs the vaddr directly into a umem which goes to all > manner of places in the driver. > > ?? dma_buf_map is fairly new and we haven't rolled it out consistently yet. In the past 10 years we simply yolo'd this :-) Just an explanation, not an excuse for new code to not use dma_buf_map consistently now that we fixed this mistake. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch