Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 675310 - x11-drivers/nvidia-drivers-415.25 with >=sys-kernel/gentoo-sources-4.4.168 - .../work/kernel/common/inc/nv-mm.h:44:9: error: too many arguments to function ‘get_user_pages’
Summary: x11-drivers/nvidia-drivers-415.25 with >=sys-kernel/gentoo-sources-4.4.168 - ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords:
: 678578 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-01-13 08:32 UTC by Thomas Sachau
Modified: 2019-02-26 09:03 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,75.98 KB, text/plain)
2019-01-13 08:32 UTC, Thomas Sachau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Sachau gentoo-dev 2019-01-13 08:32:25 UTC
Created attachment 560824 [details]
build.log

emerge --info:

Portage 2.3.48-multilib (python 2.7.15-final-0, default/linux/amd64/17.0/hardened, gcc-8.2.0, glibc-2.28-r4, 4.4.162-gentoo x86_64)
=================================================================
System uname: Linux-4.4.162-gentoo-x86_64-Intel-R-_Core-TM-_i7-4790_CPU_@_3.60GHz-with-gentoo-2.6
KiB Mem:    32922440 total,   3943072 free
KiB Swap:    1048572 total,    636076 free
Head commit of repository gentoo: 103e0ded4239c5e1d75276b7a353e0e75e4f4333

sh bash 4.4_p23
ld GNU ld (Gentoo 2.31.1 p5) 2.31.1
app-shells/bash:          4.4_p23::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.5.5-r1::gentoo, 3.6.6::gentoo
dev-util/cmake:           3.13.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.40.3::gentoo
sys-apps/sandbox:         2.15::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.14.1-r2::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r3::gentoo
sys-devel/gcc:            5.4.0-r6::gentoo, 7.3.0-r6::gentoo, 8.2.0-r6::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.20::gentoo (virtual/os-headers)
sys-libs/glibc:           2.28-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: git+ssh://git@git.gentoo.org/repo/gentoo.git
    priority: -1000
    eclass-overrides: gentoo local

local
    location: /usr/local/portage
    masters: gentoo
    priority: 0
    eclass-overrides: gentoo local

eclipse
    location: /var/lib/layman/eclipse
    masters: gentoo
    priority: 50
    eclass-overrides: gentoo local

enlightenment
    location: /var/lib/layman/enlightenment
    masters: gentoo
    priority: 50
    eclass-overrides: gentoo local

java
    location: /var/lib/layman/java
    masters: gentoo
    priority: 50
    eclass-overrides: gentoo local

multilib-portage
    location: /var/lib/layman/multilib-portage
    masters: gentoo
    priority: 50
    eclass-overrides: gentoo local

sunrise
    location: /var/lib/layman/sunrise
    masters: gentoo
    priority: 50
    eclass-overrides: gentoo local

Installed sets: @fonts
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles force-multilib ipc-sandbox merge-sync metadata-transfer network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms sign splitdebug strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="en de"
MAKEOPTS="-j6 --load-average=8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="3dnow X alsa amd64 crypt cups custom-cflags custom-cxxflags custom-optimization cxx gpm hardened java5 java6 libtirpc mmx ncurses nls nptl nsplugin ogg openmp opus pam pie readline scanner seccomp sse sse2 ssl ssp system-sqlite unicode v4l vorbis xattr xinerama xtpax zlib" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" L10N="en-GB de" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" MULTILIB_ABI="amd64 x86" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_6 python2_7 python2_6" RUBY_TARGETS="ruby25" SANE_BACKENDS="hp hp3500 hp3900 hp4200 hp5400 hp5590 hpljm1005 hpsj5s hs2p" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Marco 2019-01-15 11:50:59 UTC
Same here... since kernel 4.4.168 the NVIDIA driver doesn't compile anymore (stops with "error: too many arguments to function ‘get_user_pages’"). With kernel 4.4.167, everything still works.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2019-01-15 12:50:52 UTC
No upstream bug report yet?
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2019-01-15 13:08:01 UTC
https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.168

commit 8e50b8b07f462ab4b91bc1491b1c91bd75e4ad40
Author: Lorenzo Stoakes <lstoakes@gmail.com>
Date:   Thu Oct 13 01:20:16 2016 +0100

    mm: replace get_user_pages() write/force parameters with gup_flags
    
    commit 768ae309a96103ed02eb1e111e838c87854d8b51 upstream.
    
    This removes the 'write' and 'force' from get_user_pages() and replaces
    them with 'gup_flags' to make the use of FOLL_FORCE explicit in callers
    as use of this flag can result in surprising behaviour (and hence bugs)
    within the mm subsystem.
    
    Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
    Acked-by: Christian König <christian.koenig@amd.com>
    Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
    Acked-by: Michal Hocko <mhocko@suse.com>
    Reviewed-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    [bwh: Backported to 4.4:
     - Drop changes in rapidio, vchiq, goldfish
     - Keep the "write" variable in amdgpu_ttm_tt_pin_userptr() as it's still
       needed
     - Also update calls from various other places that now use
       get_user_pages_remote() upstream, which were updated there by commit
       9beae1ea8930 "mm: replace get_user_pages_remote() write/force ..."
     - Also update calls from hfi1 and ipath
     - Adjust context]
    Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2019-01-15 13:22:05 UTC
---> Mainline get_user_pages takes 5 arguments:

/usr/src/linux-4.20.2-gentoo/include/linux/mm.h:
long get_user_pages(unsigned long start, unsigned long nr_pages,
                unsigned int gup_flags, struct page **pages,
                struct vm_area_struct **vmas);


---> LTS with special backport takes 7 arguments:

/usr/src/linux-4.4.170-gentoo/include/linux/mm.h:
long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
            unsigned long start, unsigned long nr_pages,
            unsigned int gup_flags, struct page **pages,
            struct vm_area_struct **vmas);


kernel/conftest.sh:


            # Conftest #1: Check if get_user_pages accepts 6 arguments.
            # Return if true.
            # Fall through to conftest #2 on failure.

---> In 4.4.170 it does not: it takes 7 arguments and not 6 so it falls through to conftest #2.


            # Conftest #2: Check if get_user_pages has gup_flags instead of write and force parameters.
            # Return if available.
            # Fall through to default case if absent.

            echo "$CONFTEST_PREAMBLE
            #include <linux/mm.h>
            long get_user_pages(unsigned long start,
                                unsigned long nr_pages,
                                unsigned int gup_flags,
                                struct page **pages,
                                struct vm_area_struct **vmas) {
                return 0;
            }" > conftest$$.c

---> In 4.4.170 it does not: It takes 7 arguments and not 5.


            $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
            rm -f conftest$$.c

            if [ -f conftest$$.o ]; then
                echo "#undef NV_GET_USER_PAGES_HAS_WRITE_AND_FORCE_ARGS" | append_conftest "functions"
                echo "#undef NV_GET_USER_PAGES_HAS_TASK_STRUCT" | append_conftest "functions"
                rm -f conftest$$.o
                return


---> In 4.4.170 this does not work: get_user_pages is now assumed to take 6 arguments.
Comment 5 Marco 2019-02-07 13:46:16 UTC
There's also a bug entry on bugzilla.kernel.org about this issue:

Bug 202365 - broked nvidia and vbox drivers
-------------------------------------------
https://bugzilla.kernel.org/show_bug.cgi?id=202365
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2019-02-22 14:28:00 UTC
*** Bug 678578 has been marked as a duplicate of this bug. ***
Comment 7 Larry the Git Cow gentoo-dev 2019-02-23 14:56:22 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d35b944f7d98634d84623831ba7a525b3fbacad

commit 5d35b944f7d98634d84623831ba7a525b3fbacad
Author:     Jeroen Roovers <jer@gentoo.org>
AuthorDate: 2019-02-23 14:53:07 +0000
Commit:     Jeroen Roovers <jer@gentoo.org>
CommitDate: 2019-02-23 14:56:18 +0000

    x11-drivers/nvidia-drivers: Versions 390.116 410.104 418.43
    
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Fixes: https://bugs.gentoo.org/show_bug.cgi?id=675310
    Signed-off-by: Jeroen Roovers <jer@gentoo.org>

 x11-drivers/nvidia-drivers/Manifest                |  12 +
 .../nvidia-drivers/nvidia-drivers-390.116.ebuild   | 582 ++++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-410.104.ebuild   | 585 +++++++++++++++++++++
 .../nvidia-drivers/nvidia-drivers-418.43.ebuild    | 578 ++++++++++++++++++++
 4 files changed, 1757 insertions(+)
Comment 8 Nick Soveiko 2019-02-26 03:43:18 UTC
what about nvidia-drivers-340.107? can it be fixed as well?
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2019-02-26 09:03:24 UTC
(In reply to Nick Soveiko from comment #8)
> what about nvidia-drivers-340.107? can it be fixed as well?

You would have to ask Nvidia or come up with your own patches (as usual) or use an older kernel (/branch).