Fixing nouveau for >4k PAGE_SIZE

2013-12-11 Thread Ben Skeggs
On Fri, Nov 29, 2013 at 4:01 PM, Benjamin Herrenschmidt wrote: > On Thu, 2013-08-29 at 16:49 +1000, Ben Skeggs wrote: > >> > Additionally the current code is broken in that the upper layer in >> > vm/base.c doesn't increment "pte" by the right amount. >> > >> > Now, if those two assertions can be

[Nouveau] Fixing nouveau for >4k PAGE_SIZE

2013-12-11 Thread Patrick Baggett
I'm looking forward to something that fixes page size bugs. I still have the SPARC box that I reported but #58984 [1] on and I'm ready to test changes. Is there an easy way to apply these patches to nouveau master and try it out? SPARC has (default) 8KB page size, though, not 64KB. [1]

Fixing nouveau for >4k PAGE_SIZE

2013-11-29 Thread Benjamin Herrenschmidt
On Thu, 2013-08-29 at 16:49 +1000, Ben Skeggs wrote: > > Additionally the current code is broken in that the upper layer in > > vm/base.c doesn't increment "pte" by the right amount. > > > > Now, if those two assertions can be made always true: > > > > - Those two functions (map_sg and

Fixing nouveau for >4k PAGE_SIZE

2013-08-29 Thread Ben Skeggs
On Sun, Aug 11, 2013 at 7:35 PM, Benjamin Herrenschmidt wrote: > On Sun, 2013-08-11 at 11:02 +0200, Maarten Lankhorst wrote: > >> > diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c >> > b/drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c >> > index 5c7433d..c314a5f 100644 >> > ---

Re: Fixing nouveau for 4k PAGE_SIZE

2013-08-29 Thread Ben Skeggs
On Sun, Aug 11, 2013 at 7:35 PM, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Sun, 2013-08-11 at 11:02 +0200, Maarten Lankhorst wrote: diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c b/drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c index 5c7433d..c314a5f 100644

Fixing nouveau for >4k PAGE_SIZE

2013-08-11 Thread Benjamin Herrenschmidt
On Sun, 2013-08-11 at 11:02 +0200, Maarten Lankhorst wrote: > > diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c > > b/drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c > > index 5c7433d..c314a5f 100644 > > --- a/drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c > > +++

Fixing nouveau for >4k PAGE_SIZE

2013-08-11 Thread Benjamin Herrenschmidt
On Sun, 2013-08-11 at 17:06 +1000, Benjamin Herrenschmidt wrote: > I think I found at least two cases where "12" was used where it should > have been PAGE_SHIFT (basically ttm_mem_reg->num_pages). This > is only the tip of the iceberg, so this isn't a formal patch submission, > but I would

Fixing nouveau for >4k PAGE_SIZE

2013-08-11 Thread Benjamin Herrenschmidt
On Sun, 2013-08-11 at 08:17 +0200, Maarten Lankhorst wrote: > > So I'm still a bit confused :-) > > > The fun has been doubled because TTM expects PAGE units, so some of > the PAGE_SHIFT's are > genuine. Some may be a result of PAGE_SHIFT == 12, so honestly I don't > know the specific ones.

Fixing nouveau for >4k PAGE_SIZE

2013-08-11 Thread Benjamin Herrenschmidt
On Sun, 2013-08-11 at 10:41 +1000, Benjamin Herrenschmidt wrote: > Now, to do that, I need a better understanding of the various things > in there since I'm not familiar with nouveau at all. What I think I've > figured out is with a few questions, it would be awesome if you could > answer them so

Fixing nouveau for >4k PAGE_SIZE

2013-08-11 Thread Maarten Lankhorst
Op 11-08-13 10:04, Benjamin Herrenschmidt schreef: > On Sun, 2013-08-11 at 17:06 +1000, Benjamin Herrenschmidt wrote: > >> I think I found at least two cases where "12" was used where it should >> have been PAGE_SHIFT (basically ttm_mem_reg->num_pages). This >> is only the tip of the iceberg, so

Fixing nouveau for >4k PAGE_SIZE

2013-08-11 Thread Benjamin Herrenschmidt
Hi folks ! So I've been trying to figure out what it would take to make nouveau work properly on architectures where PAGE_SIZE isn't 4k such as most ppc64's. An initial patch from Dave fixed a bogon in nv41.c nv41_vm_map_sg() which was trying to handle the case at that low level, but this isn't

Fixing nouveau for >4k PAGE_SIZE

2013-08-11 Thread Maarten Lankhorst
Op 11-08-13 07:36, Benjamin Herrenschmidt schreef: > On Sun, 2013-08-11 at 10:41 +1000, Benjamin Herrenschmidt wrote: >> Now, to do that, I need a better understanding of the various things >> in there since I'm not familiar with nouveau at all. What I think I've >> figured out is with a few

Re: Fixing nouveau for 4k PAGE_SIZE

2013-08-11 Thread Maarten Lankhorst
Op 11-08-13 07:36, Benjamin Herrenschmidt schreef: On Sun, 2013-08-11 at 10:41 +1000, Benjamin Herrenschmidt wrote: Now, to do that, I need a better understanding of the various things in there since I'm not familiar with nouveau at all. What I think I've figured out is with a few questions,

Re: Fixing nouveau for 4k PAGE_SIZE

2013-08-11 Thread Benjamin Herrenschmidt
On Sun, 2013-08-11 at 08:17 +0200, Maarten Lankhorst wrote: So I'm still a bit confused :-) The fun has been doubled because TTM expects PAGE units, so some of the PAGE_SHIFT's are genuine. Some may be a result of PAGE_SHIFT == 12, so honestly I don't know the specific ones. Right, and

Re: Fixing nouveau for 4k PAGE_SIZE

2013-08-11 Thread Benjamin Herrenschmidt
On Sun, 2013-08-11 at 17:06 +1000, Benjamin Herrenschmidt wrote: I think I found at least two cases where 12 was used where it should have been PAGE_SHIFT (basically ttm_mem_reg-num_pages). This is only the tip of the iceberg, so this isn't a formal patch submission, but I would appreciate

Re: Fixing nouveau for 4k PAGE_SIZE

2013-08-11 Thread Maarten Lankhorst
Op 11-08-13 10:04, Benjamin Herrenschmidt schreef: On Sun, 2013-08-11 at 17:06 +1000, Benjamin Herrenschmidt wrote: I think I found at least two cases where 12 was used where it should have been PAGE_SHIFT (basically ttm_mem_reg-num_pages). This is only the tip of the iceberg, so this isn't a

Re: Fixing nouveau for 4k PAGE_SIZE

2013-08-11 Thread Benjamin Herrenschmidt
On Sun, 2013-08-11 at 11:02 +0200, Maarten Lankhorst wrote: diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c b/drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c index 5c7433d..c314a5f 100644 --- a/drivers/gpu/drm/nouveau/core/engine/fifo/nv40.c +++

Fixing nouveau for 4k PAGE_SIZE

2013-08-10 Thread Benjamin Herrenschmidt
Hi folks ! So I've been trying to figure out what it would take to make nouveau work properly on architectures where PAGE_SIZE isn't 4k such as most ppc64's. An initial patch from Dave fixed a bogon in nv41.c nv41_vm_map_sg() which was trying to handle the case at that low level, but this isn't

Re: Fixing nouveau for 4k PAGE_SIZE

2013-08-10 Thread Benjamin Herrenschmidt
On Sun, 2013-08-11 at 10:41 +1000, Benjamin Herrenschmidt wrote: Now, to do that, I need a better understanding of the various things in there since I'm not familiar with nouveau at all. What I think I've figured out is with a few questions, it would be awesome if you could answer them so I