From: Sean V Kelley Subject: Re: [PATCH] drm/i915: fix vxd392 memory corruption on VLV and >4GB Date: Sat, 8 Mar 2014 11:42:17 -0800 Message-ID: <20140308194217.GB27451@tallgrass.jf.intel.com> References: <1394241231-17242-1-git-send-email-sean.v.kelley@intel.com> <20140308092554.GE20302@nuc-i3427.alporthouse.com> <20140308100749.GJ25837@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1643898405==" Return-path: Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FF5DFA594 for ; Sat, 8 Mar 2014 11:41:33 -0800 (PST) Received: by mail-pd0-f175.google.com with SMTP id x10so5384815pdj.6 for ; Sat, 08 Mar 2014 11:41:33 -0800 (PST) In-Reply-To: <20140308100749.GJ25837@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org, Alan Cox , Fei Jiang List-Id: intel-gfx@lists.freedesktop.org --===============1643898405== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xXmbgvnjoT4axfJE" Content-Disposition: inline --xXmbgvnjoT4axfJE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Saturday 08 Mar 2014 at 11:07:50 (+0100), Daniel Vetter writes : > On Sat, Mar 08, 2014 at 09:25:54AM +0000, Chris Wilson wrote: > > On Fri, Mar 07, 2014 at 05:13:51PM -0800, Sean V Kelley wrote: > > > On VLV systems addressing 4GB of memory or greater, memory corruption= was seen > > > when initializing and attempting to render VP8 hardware decode surfac= es using > > > the VXD392 HW IP block. > > >=20 > > > The VXD MMU has a limitation to addressing only 32bits. On 64bit ker= nel and > > > user space builds this can cause problems for use of that IP block. > > >=20 > > > When 2G memory is inserted, fw buffer pfn was at 0x5f62b, which is be= low 4GB. > > > While for 4GB of memory the fw buffer pfn was 0x162ea9 with a physica= l address > > > at 0x162ea9000, above 4GB. > > >=20 > > > So although the memory is 4GB in the test hardware (Bayleybay CRB), a= large > > > physical region (for example 3G-4G) can be occupied by onboard system > > > resources. > > >=20 > > > Enabling ZONE_DMA32 and setting the correct mask DMA for this device > > > resolves the issue kernel side. > >=20 > > That's a shame. I guess this is restricted to a subset of byt? > > =20 > > > Cc: Jesse Barnes > > > Cc: Alan Cox > > > Cc: Fei Jiang > > > Signed-off-by: Sean V Kelley > > > --- > > > drivers/gpu/drm/i915/i915_dma.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > >=20 > > > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i= 915_dma.c > > > index e4d2b9f..b8c6efc 100644 > > > --- a/drivers/gpu/drm/i915/i915_dma.c > > > +++ b/drivers/gpu/drm/i915/i915_dma.c > > > @@ -1636,7 +1636,7 @@ int i915_driver_load(struct drm_device *dev, un= signed long flags) > > > * behaviour if any general state is accessed within a page above 4= GB, > > > * which also needs to be handled carefully. > >=20 > > Also add a sentence here giving a quick explanation as to why we need to > > quirk IS_VLV as well. > >=20 > > > */ > > > - if (IS_BROADWATER(dev) || IS_CRESTLINE(dev)) > > > + if (IS_BROADWATER(dev) || IS_CRESTLINE(dev) || IS_VALLEYVIEW(dev)) > > > dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(32)); >=20 > Nack because: > - the vxd392 isn't merged upstream Sure, I just wanted to get some feedback. Yeah, in it's current state my driver port will not be acceptable upstream until I cleanup the deprecated= API from the driver, remove my wrappers/hooks from the i915, and make similar API ch= anges to the user mode driver. That is a work-in-progress for me now. > - we can allocate shared buffers from vxd392 and have the restriction just > there > - for shared buffers allocated in i915 imo the right approach is to move > offending pages around when vxd392 attaches - i.e. we need to check the > attached device's dma masks and if there's something offending, migrate > the buffer with a differen shmem allocation mask. Iirc Alan Cox had > patches to do just that (but for swapoff, still the same idea though). Will keep that in mind. I have been getting some feedback from Alan too. Thanks, Sean >=20 > Cheers, Daniel > > > =20 > > > aperture_size =3D dev_priv->gtt.mappable_end; > >=20 > > --=20 > > Chris Wilson, Intel Open Source Technology Centre > > _______________________________________________ > > Intel-gfx mailing list > > Intel-gfx@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx >=20 > --=20 > Daniel Vetter > Software Engineer, Intel Corporation > +41 (0) 79 365 57 48 - http://blog.ffwll.ch --xXmbgvnjoT4axfJE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJTG3KZAAoJEEScsp9M+IBYroUP/1PHv/DAvGYeF6T7Ase8r0pT GPpVnqCpSpqzm6Ty1a+RuZTbrCnC396OfZwOpfV5nuoCbFoGIdHwbQbgMygqdfml XUXMTGS0BzCPS6QVOW624Av659/mgd6bndQDxF6fC8mG/Y0XQLev556uOk8Qq0GN VeQnUeDwg1VlkEnrwibpzc3a/HuzsKEcvaLHQmZhGpdXqeCNq8oBcjzA4ZSd3QbB tUPIHs3fLIu+GADM1KA4tdT4PZsNm7xMovmD825ZWOTEtMwRX62rVo88R0ReQ2VE z+3YZLgz4qMvXUrIrIOZkkrQ2+BiWXTBPRbErGBO0VPTYZr65Waeh+dMfvOkMxAm I9Ep4QiY2g7vYfL2G7u69xUAvt+/4L9kp2sJwuJSm08lZ+HwAeVJO5E5t6iQJnRe i1LDJRMhCA7hJMZtU/HbLkFT13l03f8+uB8eo5R6FhCcKosL2/lqAmSZA/wF6sB7 cy0IhK4VZFcTcDnsUgLWtIRRVXa8KnehZ+Mzgme5f4ulgaO+xpbyo/XldsDkhXH4 QSkUScIu2Uy1WbCax+/qodstC3DfoHtqka0kwKFVhtmM0d8HdnaEcy79b7dqpVQE DG5a1TZR/o9H9mVLYXStEko/O9IJDyWCBHYNEoITulfGNPlPv62CLefAYHxVeRsm LXO8/5c9oN8klZwyqL2Y =VNoV -----END PGP SIGNATURE----- --xXmbgvnjoT4axfJE-- --===============1643898405== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1643898405==--