Bug 94757 - powerpc64, arm64 & 64Kb kernel pagesize not working with nouveau
Summary: powerpc64, arm64 & 64Kb kernel pagesize not working with nouveau
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/nouveau (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Nouveau Project
QA Contact: Xorg Project Team
URL: https://bugs.debian.org/790690
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-30 09:31 UTC by Mathieu Malaterre
Modified: 2019-12-04 09:11 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Mathieu Malaterre 2016-03-30 09:31:10 UTC
The recent Debian kernels for powerpc64 are configured with a 64Kb kernel
pagesize.
This works slightly better in terms of performance, however the nouveau display
driver does not currently work kernel pagesizes other than 4Kb size when
running XOrg and powerpc64. It works ok if only using the console though.

Currently, users must recompile the kernel unfortunately and configure with 4Kb
kernel pagesize as this is what nouveau will only work with for now.
This is a hindrance to making people want to adopt debian as their preffered
linux distro with powerpc64 G5 powermac machines.

Im currently running vanilla 3.18.16 configured with 4Kb and nouveau can be
made to work without too many dramas.
Comment 1 Mathieu Malaterre 2016-03-30 09:32:10 UTC
Original bug report is: https://bugs.debian.org/790690
Comment 2 Mathieu Malaterre 2016-03-30 09:33:27 UTC
As explained here:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790694#27

[...]
I saw that bug report as well.  I'm not sure what to do about it -
other distributions were also using 64K pages for 64-bit PowerPC the
last time I looked, and there may be good reasons to do that.
[...]

So it would make sense to make nouveau capable of handling 64K pages for 64-bits PowerPC.
Comment 3 Ilia Mirkin 2016-03-30 14:44:03 UTC
Unfortunately it's not just a switch to flip on. A lot of the current code is very confused about cpu pages vs gpu pages (which are always 4K). Also one would need a bunch of handling code to deal with sub-cpu-page-sized allocations on the GPU (or conversely just disallow those entirely).

Nouveau is known to not work properly on non-4K-cpu-page-size, at least with some GPUs (maybe even all).

AFAIK the benefits of using 64K-pages are virtually non-existent outside the HPC space (each cached 1 byte file takes up 64K of memory, so it goes a lot faster). But that's certainly not an argument for not supporting 64K pages in nouveau.

The argument for not supporting 64K pages is -ENOPATCH :) AFAIK benh tried for a while and failed. This was ~2y ago.
Comment 4 Mathieu Malaterre 2016-03-30 14:53:10 UTC
Understood. I've reported that back to the Debian kernel team, let's see if we can have 4K page back for PPC64:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790694#52
Comment 5 Mathieu Malaterre 2016-03-31 06:01:36 UTC
As a side note, would it be possible to have a better error message. Something along:

printk( "Sorry nouveau only support 4K pages" );
Comment 6 Ben Skeggs 2016-04-06 22:05:04 UTC
I have a WIP chunk of work which will hopefully address this issue as a side-effect.  It's not ready for general consumption yet, but I'll update the bug once it is.
Comment 7 Benjamin Herrenschmidt 2016-08-25 10:57:55 UTC
There's an old patch of mind floating on the lists somewhere that did make it somewhat work on my G5's nv43 but it only addressed part of the problem (the kernel framebuffer basically).

There's also an issue in that the per-context registers that are meant to be mapped into userspace are only 4K appart.

nVidia binary driver on POWER8 (for compute) works around that by using the _PAGE_4K_PFN hack we have which allows a driver to create a user mapping for a 64K page that is made of 16 times the same underlying HW 4K page.

That requires unfortunately some trickery to deal with on both side of the user/kernel interface, so it's not a "drop-in" fix in the existing stack.
Comment 8 Benjamin Herrenschmidt 2016-08-25 10:58:24 UTC
s/mind/mine ;-)
Comment 9 Jeremy Linton 2016-12-02 21:29:15 UTC
This problem happens on Fedora/RHEL & Centos for ARM64 as well, because those distributions are using 64k pages.
Comment 10 Martin Peres 2019-12-04 09:11:19 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/driver/xf86-video-nouveau/issues/258.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.