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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 84A6AC4361B for ; Sun, 20 Dec 2020 11:10:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D87982313B for ; Sun, 20 Dec 2020 11:10:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D87982313B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=uniontech.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9DA5089498; Sun, 20 Dec 2020 11:10:15 +0000 (UTC) Received: from regular1.263xmail.com (unknown [211.150.70.198]) by gabe.freedesktop.org (Postfix) with ESMTPS id D85856E041 for ; Fri, 18 Dec 2020 08:52:20 +0000 (UTC) Received: from localhost (unknown [192.168.167.13]) by regular1.263xmail.com (Postfix) with ESMTP id 3654B7BD; Fri, 18 Dec 2020 16:52:07 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-SKE-CHECKED: 1 X-ABS-CHECKED: 1 Received: from firstlove-e500.uniontech.com (unknown [58.246.122.242]) by smtp.263.net (postfix) whith ESMTP id P20464T140378424461056S1608281527159800_; Fri, 18 Dec 2020 16:52:07 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: chenli@uniontech.com X-SENDER: chenli@uniontech.com X-LOGIN-NAME: chenli@uniontech.com X-FST-TO: christian.koenig@amd.com X-SENDER-IP: 58.246.122.242 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 Date: Fri, 18 Dec 2020 16:52:13 +0800 Message-ID: <87v9czxzr6.wl-chenli@uniontech.com> From: Chen Li To: Christian =?ISO-8859-1?Q?K=F6nig?= Subject: Re: [PATCH] drm/[amdgpu|radeon]: fix memset on io mem In-Reply-To: <0a449ae3-c55b-e1da-836c-3192eea5cb92@amd.com> References: <877dpiz4sf.wl-chenli@uniontech.com> <4277816d-db00-7e81-a2fb-069aeee18e8b@amd.com> <875z51zwsq.wl-chenli@uniontech.com> <90b625e2-2409-d13b-2456-483ad4eef18f@amd.com> <873605z1du.wl-chenli@uniontech.com> <7920fd29-3f95-2109-07ee-15659e80dc40@amd.com> <877dpgimec.wl-chenli@uniontech.com> <87y2hvydox.wl-chenli@uniontech.com> <0a449ae3-c55b-e1da-836c-3192eea5cb92@amd.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Mailman-Approved-At: Sun, 20 Dec 2020 11:10:15 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , Chen Li , dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, 18 Dec 2020 16:10:12 +0800, Christian K=F6nig wrote: > = > Am 18.12.20 um 04:51 schrieb Chen Li: > > [SNIP] > >>>> If your ARM base board can't do that for some then you can't use the= hardware > >>>> with that board. > >>> Good to know, thanks! BTW, have you ever seen or heard boards like mi= ne which cannot mmap device memory correctly from userspace correctly? > >> Unfortunately yes. We haven't been able to figure out what exactly goe= s wrong in > >> those cases. > > Ok. one more question: only e8860 or all radeon cards have this issue? > = > This applies to all hardware with dedicated memory which needs to be mapp= ed to > userspace. > = > That includes all graphics hardware from AMD as well as NVidia and probab= ly a > whole bunch of other PCIe devices. Can mmio on these devices work fine in kernel space? I cannot see the diffe= rence here except user space should use uncacheable mmap to map virtual mem= ory to device space(though I don't know how to use uncacheable mmap), while= kernel use uncache ioremap. = > = > >>> The graphics address remapping table (GART),[1] also known as t= he graphics aperture remapping table,[2] or graphics translation table (GTT= ),[3] is an I/O memory management unit (IOMMU) used by Accelerated Graphics= Port (AGP) and PCI Express (PCIe) graphics cards. > >> GART or GTT refers to the translation tables graphics hardware use to = access > >> system memory. > >> = > >> Something like 15 years ago we used the IOMMU functionality from AGP to > >> implement that. But modern hardware (PCIe) uses some specialized hardw= are in the > >> GPU for that. > >> = > >> Regards, > >> Christian. > >> = > >> = > >> = > > Good to know, thanks! So modern GART/GTT is like tlb, and iommu is forc= used on translating address and not manager the tlb. > = > You are getting closer in your understanding, but the TLB is the Translat= ion > lookaside buffer. Basically a cache of recent VM translations which is pr= esent > is all page table translations (GART, IOMMU, CPU etc...). > = > The key difference is where the page table translation happens on modern > hardware: > 1. For the GART/GTT it is inside the GPU to translate between GPU interna= l and > bus addresses. > 2. For IOMMU it is inside the root complex of the PCIe to translate betwe= en bus > addresses and physical addresses. > 3. For CPU page tables it is inside the CPU core to translate between vir= tual > addresses and physical addresses. > = > Regards, > Christian. > = > = Awesome explaination! Thanks in a ton! _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel