[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF6AEGve4OYRYvSim6_7ihYZb-HuwQkBqm8D_=1MRxDHhhQFag@mail.gmail.com>
Date: Tue, 3 May 2022 07:13:55 -0700
From: Rob Clark <robdclark@...il.com>
To: Lucas Stach <l.stach@...gutronix.de>
Cc: dri-devel <dri-devel@...ts.freedesktop.org>,
Rob Clark <robdclark@...omium.org>,
David Airlie <airlied@...ux.ie>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
open list <linux-kernel@...r.kernel.org>,
Luca Weiss <luca@...tu.xyz>, Sean Paul <sean@...rly.run>,
freedreno <freedreno@...ts.freedesktop.org>
Subject: Re: [PATCH] drm/msm: Limit command submission when no IOMMU
On Tue, May 3, 2022 at 5:12 AM Lucas Stach <l.stach@...gutronix.de> wrote:
>
> Am Montag, dem 02.05.2022 um 10:29 -0700 schrieb Rob Clark:
> > From: Rob Clark <robdclark@...omium.org>
> >
> > Running the GPU without an IOMMU is not really a supported (or sane)
> > configuration. Yet it can be useful during SoC bringup (ie. if the
> > iommu driver doesn't work yet).
> >
> > Lets limit it to users who already have /dev/mem access, to avoid the
> > chance that a user accidentially configures kernel without IOMMU
> > support.
>
> I haven't followed MSM too closely, so ctx->aspace may also include the
> GPU MMU, but if this really only includes the IOMMU (as the commit
> message implies) then this breaks Freedreno on i.MX5.
it includes the gpu mmu, so a2xx should be fine.
BR,
-R
> Regards,
> Lucas
>
> >
> > Signed-off-by: Rob Clark <robdclark@...omium.org>
> > ---
> > drivers/gpu/drm/msm/msm_gem_submit.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
> > index 23b68bc945f6..9cd8c8708990 100644
> > --- a/drivers/gpu/drm/msm/msm_gem_submit.c
> > +++ b/drivers/gpu/drm/msm/msm_gem_submit.c
> > @@ -734,6 +734,11 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
> > if (args->pad)
> > return -EINVAL;
> >
> > + if (unlikely(!ctx->aspace) && !capable(CAP_SYS_RAWIO)) {
> > + DRM_ERROR_RATELIMITED("IOMMU support or CAP_SYS_RAWIO required!\n");
> > + return -EPERM;
> > + }
> > +
> > /* for now, we just have 3d pipe.. eventually this would need to
> > * be more clever to dispatch to appropriate gpu module:
> > */
>
>
Powered by blists - more mailing lists