From: Daniel Vetter Subject: Re: [PATCH v4 1/1] drm: allow limiting the scatter list size. Date: Tue, 8 Sep 2020 13:37:12 +0200 Message-ID: <20200908113712.GL2352366@phenom.ffwll.local> References: <20200907112425.15610-1-kraxel@redhat.com> <20200907112425.15610-2-kraxel@redhat.com> <20200908054858.um34wojjv6uhi7d3@sirius.home.kraxel.org> <20200908085544.GI2352366@phenom.ffwll.local> <20200908100253.b22sff23737l77bo@sirius.home.kraxel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20200908100253.b22sff23737l77bo-+1R1O5xHTTbdA3i/FDNR4v2rGJfVMZC7@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "amd-gfx" To: Gerd Hoffmann Cc: Heiko =?iso-8859-1?Q?St=FCbner?= , David Airlie , "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" , dri-devel , Sandy Huang , Thierry Reding , Oleksandr Andrushchenko , "open list:RADEON and AMDGPU DRM DRIVERS" , Jonathan Hunter , "open list:ARM/Rockchip SoC support" , Ben Skeggs , Russell King , "moderated list:DRM DRIVERS FOR XEN" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , Maarten Lankhorst , "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" List-Id: nouveau.vger.kernel.org On Tue, Sep 08, 2020 at 12:02:53PM +0200, Gerd Hoffmann wrote: > > > > The comments I've found suggest very much not ... Or is that all very > > > > old stuff only that no one cares about anymore? > > > > > > I think these days it is possible to override dma_ops per device, which > > > in turn allows virtio to deal with the quirks without the rest of the > > > kernel knowing about these details. > > > > > > I also think virtio-gpu can drop the virtio_has_dma_quirk() checks, just > > > use the dma api path unconditionally and depend on virtio core having > > > setup dma_ops in a way that it JustWorks[tm]. I'll look into that next. > > > > The comment above vring_use_dma_api() suggests that this has not yet > > happened, that's why I'm asking. > > Hmm, wading through the code, seems it indeed happen yet, even though my > testing didn't show any issues. Probably pure luck because devices and > cpus have the same memory view on x86. Guess I need to try this on > ppc64 to see it actually failing ... > > So dropping the virtio_has_dma_quirk() checks isn't going to fly. > > Using dma_max_mapping_size() should be fine though. It might use a > lower limit than needed for virtio, but it should not break things. Makes sense. On this patch here: Reviewed-by: Daniel Vetter And I guess would be good if virtio pushes a bit more towards using the dma api abstraction fully so we can get rid of these hacks. Virtio feels like a driver that really should be using dma-api and not dig around behind it because "it' makes stuff 0.5% faster" or so, since being virtualized it's already not the king of speed anyway :-) Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch