[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 1/1] drm: allow limiting the scatter list size.
- To: Gerd Hoffmann <kraxel@xxxxxxxxxx>
- From: Daniel Vetter <daniel@xxxxxxxx>
- Date: Tue, 8 Sep 2020 10:55:44 +0200
- Cc: Daniel Vetter <daniel@xxxxxxxx>, dri-devel <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, Christian König <christian.koenig@xxxxxxx>, Alex Deucher <alexander.deucher@xxxxxxx>, David Airlie <airlied@xxxxxxxx>, Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>, Maxime Ripard <mripard@xxxxxxxxxx>, Thomas Zimmermann <tzimmermann@xxxxxxx>, Lucas Stach <l.stach@xxxxxxxxxxxxxx>, Russell King <linux+etnaviv@xxxxxxxxxxxxxxx>, Christian Gmeiner <christian.gmeiner@xxxxxxxxx>, Rob Clark <robdclark@xxxxxxxxx>, Sean Paul <sean@xxxxxxxxxx>, Ben Skeggs <bskeggs@xxxxxxxxxx>, Sandy Huang <hjc@xxxxxxxxxxxxxx>, Heiko Stübner <heiko@xxxxxxxxx>, Thierry Reding <thierry.reding@xxxxxxxxx>, Jonathan Hunter <jonathanh@xxxxxxxxxx>, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>, "open list:RADEON and AMDGPU DRM DRIVERS" <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>, open list <linux-kernel@xxxxxxxxxxxxxxx>, "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" <etnaviv@xxxxxxxxxxxxxxxxxxxxx>, "open list:DRM DRIVER FOR MSM ADRENO GPU" <linux-arm-msm@xxxxxxxxxxxxxxx>, "open list:DRM DRIVER FOR MSM ADRENO GPU" <freedreno@xxxxxxxxxxxxxxxxxxxxx>, "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" <nouveau@xxxxxxxxxxxxxxxxxxxxx>, "moderated list:ARM/Rockchip SoC support" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "open list:ARM/Rockchip SoC support" <linux-rockchip@xxxxxxxxxxxxxxxxxxx>, "open list:DRM DRIVERS FOR NVIDIA TEGRA" <linux-tegra@xxxxxxxxxxxxxxx>, "moderated list:DRM DRIVERS FOR XEN" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 08 Sep 2020 08:55:51 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Mail-followup-to: Gerd Hoffmann <kraxel@xxxxxxxxxx>, dri-devel <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, Christian König <christian.koenig@xxxxxxx>, Alex Deucher <alexander.deucher@xxxxxxx>, David Airlie <airlied@xxxxxxxx>, Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>, Maxime Ripard <mripard@xxxxxxxxxx>, Thomas Zimmermann <tzimmermann@xxxxxxx>, Lucas Stach <l.stach@xxxxxxxxxxxxxx>, Russell King <linux+etnaviv@xxxxxxxxxxxxxxx>, Christian Gmeiner <christian.gmeiner@xxxxxxxxx>, Rob Clark <robdclark@xxxxxxxxx>, Sean Paul <sean@xxxxxxxxxx>, Ben Skeggs <bskeggs@xxxxxxxxxx>, Sandy Huang <hjc@xxxxxxxxxxxxxx>, Heiko Stübner <heiko@xxxxxxxxx>, Thierry Reding <thierry.reding@xxxxxxxxx>, Jonathan Hunter <jonathanh@xxxxxxxxxx>, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>, "open list:RADEON and AMDGPU DRM DRIVERS" <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>, open list <linux-kernel@xxxxxxxxxxxxxxx>, "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" <etnaviv@xxxxxxxxxxxxxxxxxxxxx>, "open list:DRM DRIVER FOR MSM ADRENO GPU" <linux-arm-msm@xxxxxxxxxxxxxxx>, "open list:DRM DRIVER FOR MSM ADRENO GPU" <freedreno@xxxxxxxxxxxxxxxxxxxxx>, "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" <nouveau@xxxxxxxxxxxxxxxxxxxxx>, "moderated list:ARM/Rockchip SoC support" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "open list:ARM/Rockchip SoC support" <linux-rockchip@xxxxxxxxxxxxxxxxxxx>, "open list:DRM DRIVERS FOR NVIDIA TEGRA" <linux-tegra@xxxxxxxxxxxxxxx>, "moderated list:DRM DRIVERS FOR XEN" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
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 <kraxel@xxxxxxxxxx> 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 <kraxel@xxxxxxxxxx>
> >
> > 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
|