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=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 BD880C433E2 for ; Tue, 8 Sep 2020 08:55:54 +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 7A16920678 for ; Tue, 8 Sep 2020 08:55:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="PGlAHISs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A16920678 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A2A9D6E5C5; Tue, 8 Sep 2020 08:55:50 +0000 (UTC) Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id 23E596E5C8 for ; Tue, 8 Sep 2020 08:55:49 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id s13so16437982wmh.4 for ; Tue, 08 Sep 2020 01:55:49 -0700 (PDT) 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:in-reply-to; bh=lPf7+5yaWPR4Bsu29CBYqFns/59BDsvYdpze1XOObUQ=; b=PGlAHISsJbb/iYgixfJKVAK0d3OOuP3SlP2TjTpoK/oyd/DkyWjQ7j9CtU74WPEw0A NkxDuWQKM4W+M6eiE0fRmROTwl4OHi/jQ6z3R8Ikhb+ljBKxuSnOMNBFuSVwV7AkQa34 kBB3vAMyk0pYZpn9c7JUOZ/xI0bfjYSUvtffY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=lPf7+5yaWPR4Bsu29CBYqFns/59BDsvYdpze1XOObUQ=; b=ExfXD3VTMrEmQk60tDhRk6O3oCwtUNOv2dgjVCQi6iuohMTRYAa64qZm8ab3j9B9jC 209700oBTzaRSpOd6c25p2isfzNDrlrYsnYVbOKJdWQq+u8Y7a+Jw1mUe4ivP5wIfKqC KhxZukY/TtqXArX2jATTJWXg+ewkvr07lp7IzIiT0ksHqfDKeJrubNUMPeH6x9jnQh3E +z++Bzhx0Y7ztjv7Gkz8mj/nVRHkcaKz6DoEFkjsoeuIocDfg9C22sevQVsUrs5+hCtd tePJIyRmLRfuour6zq0YbOFEq30cZHqaN+SqIxNB6IBh2XR1q3W+ZVtSJMS69D0uv2oe JoMg== X-Gm-Message-State: AOAM530bMlR1Yp2OfWpbfO+dYobCtWKtA4qWe30KDWhyDoguYwdYLHZq 3Sr4tmV7m31JC6SBGqzGZpjSZw== X-Google-Smtp-Source: ABdhPJzRIgnrsr1zISzj3JMMO+qHmnUUaLRMb8phFavthqU3M8id+c7krZN538k/E4IFJZLkveZLYQ== X-Received: by 2002:a1c:e256:: with SMTP id z83mr3369682wmg.33.1599555347784; Tue, 08 Sep 2020 01:55:47 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id l10sm30834268wru.59.2020.09.08.01.55.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 01:55:47 -0700 (PDT) Date: Tue, 8 Sep 2020 10:55:44 +0200 From: Daniel Vetter To: Gerd Hoffmann Subject: Re: [PATCH v4 1/1] drm: allow limiting the scatter list size. Message-ID: <20200908085544.GI2352366@phenom.ffwll.local> Mail-Followup-To: Gerd Hoffmann , dri-devel , Christian =?iso-8859-1?Q?K=F6nig?= , Alex Deucher , David Airlie , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Lucas Stach , Russell King , Christian Gmeiner , Rob Clark , Sean Paul , Ben Skeggs , Sandy Huang , Heiko =?iso-8859-1?Q?St=FCbner?= , Thierry Reding , Jonathan Hunter , Oleksandr Andrushchenko , "open list:RADEON and AMDGPU DRM DRIVERS" , open list , "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" , "moderated list:ARM/Rockchip SoC support" , "open list:ARM/Rockchip SoC support" , "open list:DRM DRIVERS FOR NVIDIA TEGRA" , "moderated list:DRM DRIVERS FOR XEN" References: <20200907112425.15610-1-kraxel@redhat.com> <20200907112425.15610-2-kraxel@redhat.com> <20200908054858.um34wojjv6uhi7d3@sirius.home.kraxel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200908054858.um34wojjv6uhi7d3@sirius.home.kraxel.org> X-Operating-System: Linux phenom 5.7.0-1-amd64 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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" , Daniel Vetter , "open list:DRM DRIVER FOR MSM ADRENO GPU" , Maarten Lankhorst , "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" , Maxime Ripard , Christian Gmeiner , "open list:DRM DRIVERS FOR NVIDIA TEGRA" , Sean Paul , "moderated list:ARM/Rockchip SoC support" , open list , Rob Clark , Thomas Zimmermann , Alex Deucher , "open list:DRM DRIVER FOR MSM ADRENO GPU" , Christian =?iso-8859-1?Q?K=F6nig?= , Lucas Stach Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Tue, Sep 08, 2020 at 07:48:58AM +0200, Gerd Hoffmann wrote: > On Mon, Sep 07, 2020 at 03:53:02PM +0200, Daniel Vetter wrote: > > On Mon, Sep 7, 2020 at 1:24 PM Gerd Hoffmann wrote: > > > > > > Add drm_device argument to drm_prime_pages_to_sg(), so we can > > > call dma_max_mapping_size() to figure the segment size limit > > > and call into __sg_alloc_table_from_pages() with the correct > > > limit. > > > > > > This fixes virtio-gpu with sev. Possibly it'll fix other bugs > > > too given that drm seems to totaly ignore segment size limits > > > so far ... > > > > > > v2: place max_segment in drm driver not gem object. > > > v3: move max_segment next to the other gem fields. > > > v4: just use dma_max_mapping_size(). > > > > > > Signed-off-by: Gerd Hoffmann > > > > Uh, are you sure this works in all cases for virtio? > > Sure, I've tested it ;) > > > 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. If this has happened then I think it'd be best if you remove that todo entry and update it, as part of the overall series to add dma_max_mapping_size and remove the quirks. Otherwise this all is a bit wtf material :-) -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx