[Intel-gfx] [PATCH] drm/i915: Disable stolen memory when DMAR is active

Chris Wilson chris at chris-wilson.co.uk
Wed Mar 5 16:32:54 CET 2014


On Wed, Mar 05, 2014 at 04:17:17PM +0100, Daniel Vetter wrote:
> On Fri, Feb 28, 2014 at 12:14:02PM +0000, Chris Wilson wrote:
> > We have reports of heavy screen corruption if we try to use the stolen
> > memory reserved by the BIOS whilst the DMA-Remapper is active. This
> > quirk may be only specific to a few machines or BIOSes, but first lets
> > apply the big hammer and always disable use of stolen memory when DMAR
> > is active.
> > 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68535
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> > ---
> >  drivers/gpu/drm/i915/i915_gem_stolen.c | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> > index 984ada1b0084..13a849afe479 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> > @@ -325,11 +325,25 @@ void i915_gem_cleanup_stolen(struct drm_device *dev)
> >  	drm_mm_takedown(&dev_priv->mm.stolen);
> >  }
> >  
> > +static bool need_dmar_wa(struct drm_device *dev)
> > +{
> > +#ifdef CONFIG_INTEL_IOMMU
> > +	if (INTEL_INFO(dev)->gen >= 6 && intel_iommu_gfx_mapped)
> 
> Why the gen check in here? Without that we could just check
> intel_iommu_gfx_mapped and shovel the #ifdef into stolen init. No need to
> spread it out like that imo.

It's almost as if it was cut'n'paste from another VTd w/a. I'm worried
that this is too big a hammer. I would have expected more complaints if
VTd was this broken since 3.9. Otoh, it is a severe bug.
-chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list