NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/51065: nouveau recently broken for GTX770 (NVE4/GK104)



The following reply was made to PR kern/51065; it has been noted by GNATS.

From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: coypu%sdf.org@localhost
Cc: gnats-bugs%NetBSD.org@localhost
Subject: Re: kern/51065: nouveau recently broken for GTX770 (NVE4/GK104)
Date: Sun, 17 Apr 2016 02:23:58 +0000

 This is a multi-part message in MIME format.
 --=_4C1B30PcKfQj3orCYQtm9Vx8cN8uIRq4
 
 I would also be interested in seeing the results of just the attached
 patch on HEAD, without the previous patch I sent.  Specifically, I
 would like to see what tries to use mmio registers >=0x800000, which
 <https://envytools.readthedocs.org/en/latest/hw/mmio.html> suggests
 has only fifo channels and vram -- which I expect the driver to try to
 use via a different path.
 
 I expect the attached patch to trigger a panic -- I'm interested in
 the stack trace when that happens.
 
 --=_4C1B30PcKfQj3orCYQtm9Vx8cN8uIRq4
 Content-Type: text/plain; charset="ISO-8859-1"; name="nvkassert"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="nvkassert.patch"
 
 Index: sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/subdev.h
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/src/sys/external/bsd/drm2/dist/drm/nouveau/core/include/=
 core/subdev.h,v
 retrieving revision 1.2
 diff -p -u -r1.2 subdev.h
 --- sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/subdev.h	6 Aug=
  2014 13:35:13 -0000	1.2
 +++ sys/external/bsd/drm2/dist/drm/nouveau/core/include/core/subdev.h	16 Ap=
 r 2016 19:00:08 -0000
 @@ -67,6 +67,9 @@ nv_rd08(void *obj, u32 addr)
  {
  	struct nouveau_subdev *subdev =3D nv_subdev(obj);
  #ifdef __NetBSD__
 +	KASSERTMSG(addr < subdev->mmiosz,
 +	    "out of range addr 0x%"PRIx32" mmiosz %"PRIxMAX,
 +	    addr, (uintmax_t)subdev->mmiosz);
  	u8 data =3D bus_space_read_stream_1(subdev->mmiot, subdev->mmioh, addr);
  #else
  	u8 data =3D ioread8(subdev->mmio + addr);
 @@ -80,6 +83,9 @@ nv_rd16(void *obj, u32 addr)
  {
  	struct nouveau_subdev *subdev =3D nv_subdev(obj);
  #ifdef __NetBSD__
 +	KASSERTMSG(addr < subdev->mmiosz - 1,
 +	    "out of range addr 0x%"PRIx32" mmiosz %"PRIxMAX,
 +	    addr, (uintmax_t)subdev->mmiosz);
  	u16 data =3D bus_space_read_stream_2(subdev->mmiot, subdev->mmioh, addr);
  #else
  	u16 data =3D ioread16_native(subdev->mmio + addr);
 @@ -93,6 +99,9 @@ nv_rd32(void *obj, u32 addr)
  {
  	struct nouveau_subdev *subdev =3D nv_subdev(obj);
  #ifdef __NetBSD__
 +	KASSERTMSG(addr < subdev->mmiosz - 3,
 +	    "out of range addr 0x%"PRIx32" mmiosz %"PRIxMAX,
 +	    addr, (uintmax_t)subdev->mmiosz);
  	u32 data =3D bus_space_read_stream_4(subdev->mmiot, subdev->mmioh, addr);
  #else
  	u32 data =3D ioread32_native(subdev->mmio + addr);
 @@ -107,6 +116,9 @@ nv_wr08(void *obj, u32 addr, u8 data)
  	struct nouveau_subdev *subdev =3D nv_subdev(obj);
  	nv_spam(subdev, "nv_wr08 0x%06x 0x%02x\n", addr, data);
  #ifdef __NetBSD__
 +	KASSERTMSG(addr < subdev->mmiosz,
 +	    "out of range addr 0x%"PRIx32" mmiosz %"PRIxMAX,
 +	    addr, (uintmax_t)subdev->mmiosz);
  	bus_space_write_stream_1(subdev->mmiot, subdev->mmioh, addr, data);
  #else
  	iowrite8(data, subdev->mmio + addr);
 @@ -119,6 +131,9 @@ nv_wr16(void *obj, u32 addr, u16 data)
  	struct nouveau_subdev *subdev =3D nv_subdev(obj);
  	nv_spam(subdev, "nv_wr16 0x%06x 0x%04x\n", addr, data);
  #ifdef __NetBSD__
 +	KASSERTMSG(addr < subdev->mmiosz - 1,
 +	    "out of range addr 0x%"PRIx32" mmiosz %"PRIxMAX,
 +	    addr, (uintmax_t)subdev->mmiosz);
  	bus_space_write_stream_2(subdev->mmiot, subdev->mmioh, addr, data);
  #else
  	iowrite16_native(data, subdev->mmio + addr);
 @@ -131,6 +146,9 @@ nv_wr32(void *obj, u32 addr, u32 data)
  	struct nouveau_subdev *subdev =3D nv_subdev(obj);
  	nv_spam(subdev, "nv_wr32 0x%06x 0x%08x\n", addr, data);
  #ifdef __NetBSD__
 +	KASSERTMSG(addr < subdev->mmiosz - 3,
 +	    "out of range addr 0x%"PRIx32" mmiosz %"PRIxMAX,
 +	    addr, (uintmax_t)subdev->mmiosz);
  	bus_space_write_stream_4(subdev->mmiot, subdev->mmioh, addr, data);
  #else
  	iowrite32_native(data, subdev->mmio + addr);
 
 --=_4C1B30PcKfQj3orCYQtm9Vx8cN8uIRq4--
 


Home | Main Index | Thread Index | Old Index