This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug runtime/19990] New: on rawhide, the get_user_pages() function has changed
- From: "dsmith at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Mon, 25 Apr 2016 14:42:26 +0000
- Subject: [Bug runtime/19990] New: on rawhide, the get_user_pages() function has changed
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=19990
Bug ID: 19990
Summary: on rawhide, the get_user_pages() function has changed
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: runtime
Assignee: systemtap at sourceware dot org
Reporter: dsmith at redhat dot com
Target Milestone: ---
On rawhide (4.6.0-0.rc4.git3.1.fc25.x86_64), I'm getting the following compile
error:
====
stap nd_sys.stp -c ./preadv
In file included from /usr/local/share/systemtap/runtime/linux/runtime.h:209:0,
from /usr/local/share/systemtap/runtime/runtime.h:24,
from
/tmp/stap1vHU9T/stap_0b3271e6957c26e6ec5ff4ce3462c458_1435718_src.c:25:
/usr/local/share/systemtap/runtime/linux/access_process_vm.h: In function
â__access_process_vm_â:
/usr/local/share/systemtap/runtime/linux/access_process_vm.h:35:29: error:
passing argument 1 of âget_user_pagesâ makes integer from pointer without a
cast [-Werror=int-conversion]
ret = get_user_pages (tsk, mm, addr, 1, write, 1, &page, &vma);
^~~
In file included from include/linux/pid_namespace.h:6:0,
from include/linux/ptrace.h:8,
from include/linux/ftrace.h:13,
from include/linux/kprobes.h:42,
from /usr/local/share/systemtap/runtime/linux/runtime.h:21,
from /usr/local/share/systemtap/runtime/runtime.h:24,
from
/tmp/stap1vHU9T/stap_0b3271e6957c26e6ec5ff4ce3462c458_1435718_src.c:25:
include/linux/mm.h:1253:6: note: expected âlong unsigned intâ but argument is
of type âstruct task_struct *â
long get_user_pages(unsigned long start, unsigned long nr_pages,
^~~~~~~~~~~~~~
In file included from /usr/local/share/systemtap/runtime/linux/runtime.h:209:0,
from /usr/local/share/systemtap/runtime/runtime.h:24,
from
/tmp/stap1vHU9T/stap_0b3271e6957c26e6ec5ff4ce3462c458_1435718_src.c:25:
/usr/local/share/systemtap/runtime/linux/access_process_vm.h:35:34: error:
passing argument 2 of âget_user_pagesâ makes integer from pointer without a
cast [-Werror=int-conversion]
ret = get_user_pages (tsk, mm, addr, 1, write, 1, &page, &vma);
^~
In file included from include/linux/pid_namespace.h:6:0,
from include/linux/ptrace.h:8,
from include/linux/ftrace.h:13,
from include/linux/kprobes.h:42,
from /usr/local/share/systemtap/runtime/linux/runtime.h:21,
from /usr/local/share/systemtap/runtime/runtime.h:24,
from
/tmp/stap1vHU9T/stap_0b3271e6957c26e6ec5ff4ce3462c458_1435718_src.c:25:
include/linux/mm.h:1253:6: note: expected âlong unsigned intâ but argument is
of type âstruct mm_struct *â
long get_user_pages(unsigned long start, unsigned long nr_pages,
^~~~~~~~~~~~~~
In file included from /usr/local/share/systemtap/runtime/linux/runtime.h:209:0,
from /usr/local/share/systemtap/runtime/runtime.h:24,
from
/tmp/stap1vHU9T/stap_0b3271e6957c26e6ec5ff4ce3462c458_1435718_src.c:25:
/usr/local/share/systemtap/runtime/linux/access_process_vm.h:35:47: error:
passing argument 5 of âget_user_pagesâ makes pointer from integer without a
cast [-Werror=int-conversion]
ret = get_user_pages (tsk, mm, addr, 1, write, 1, &page, &vma);
^~~~~
In file included from include/linux/pid_namespace.h:6:0,
from include/linux/ptrace.h:8,
from include/linux/ftrace.h:13,
from include/linux/kprobes.h:42,
from /usr/local/share/systemtap/runtime/linux/runtime.h:21,
from /usr/local/share/systemtap/runtime/runtime.h:24,
from
/tmp/stap1vHU9T/stap_0b3271e6957c26e6ec5ff4ce3462c458_1435718_src.c:25:
include/linux/mm.h:1253:6: note: expected âstruct page **â but argument is of
type âintâ
long get_user_pages(unsigned long start, unsigned long nr_pages,
^~~~~~~~~~~~~~
In file included from /usr/local/share/systemtap/runtime/linux/runtime.h:209:0,
from /usr/local/share/systemtap/runtime/runtime.h:24,
from
/tmp/stap1vHU9T/stap_0b3271e6957c26e6ec5ff4ce3462c458_1435718_src.c:25:
/usr/local/share/systemtap/runtime/linux/access_process_vm.h:35:54: error:
passing argument 6 of âget_user_pagesâ makes pointer from integer without a
cast [-Werror=int-conversion]
ret = get_user_pages (tsk, mm, addr, 1, write, 1, &page, &vma);
^
In file included from include/linux/pid_namespace.h:6:0,
from include/linux/ptrace.h:8,
from include/linux/ftrace.h:13,
from include/linux/kprobes.h:42,
from /usr/local/share/systemtap/runtime/linux/runtime.h:21,
from /usr/local/share/systemtap/runtime/runtime.h:24,
from
/tmp/stap1vHU9T/stap_0b3271e6957c26e6ec5ff4ce3462c458_1435718_src.c:25:
include/linux/mm.h:1253:6: note: expected âstruct vm_area_struct **â but
argument is of type âintâ
long get_user_pages(unsigned long start, unsigned long nr_pages,
^~~~~~~~~~~~~~
In file included from /usr/local/share/systemtap/runtime/linux/runtime.h:209:0,
from /usr/local/share/systemtap/runtime/runtime.h:24,
from
/tmp/stap1vHU9T/stap_0b3271e6957c26e6ec5ff4ce3462c458_1435718_src.c:25:
/usr/local/share/systemtap/runtime/linux/access_process_vm.h:35:13: error: too
many arguments to function âget_user_pagesâ
ret = get_user_pages (tsk, mm, addr, 1, write, 1, &page, &vma);
^~~~~~~~~~~~~~
In file included from include/linux/pid_namespace.h:6:0,
from include/linux/ptrace.h:8,
from include/linux/ftrace.h:13,
from include/linux/kprobes.h:42,
from /usr/local/share/systemtap/runtime/linux/runtime.h:21,
from /usr/local/share/systemtap/runtime/runtime.h:24,
from
/tmp/stap1vHU9T/stap_0b3271e6957c26e6ec5ff4ce3462c458_1435718_src.c:25:
include/linux/mm.h:1253:6: note: declared here
long get_user_pages(unsigned long start, unsigned long nr_pages,
^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
scripts/Makefile.build:291: recipe for target
'/tmp/stap1vHU9T/stap_0b3271e6957c26e6ec5ff4ce3462c458_1435718_src.o' failed
make[1]: ***
[/tmp/stap1vHU9T/stap_0b3271e6957c26e6ec5ff4ce3462c458_1435718_src.o] Error 1
Makefile:1431: recipe for target '_module_/tmp/stap1vHU9T' failed
make: *** [_module_/tmp/stap1vHU9T] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed. [man error::pass4]
====
I believe this was caused by the following kernel commits:
====
commit a1f983174dd7e535e50ca850fcfb3b8d38149f39
Merge: 63a1281 c12d2da
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Thu Apr 14 19:31:34 2016 -0700
Merge branch 'mm-urgent-for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull mm gup cleanup from Ingo Molnar:
"This removes the ugly get-user-pages API hack, now that all upstream
code has been migrated to it"
("ugly" is putting it mildly. But it worked.. - Linus)
* 'mm-urgent-for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
mm/gup: Remove the macro overload API migration helpers from the
get_user*() APIs
commit c12d2da56d0e07d230968ee2305aaa86b93a6832
Author: Ingo Molnar <mingo@kernel.org>
Date: Mon Apr 4 10:24:58 2016 +0200
mm/gup: Remove the macro overload API migration helpers from the
get_user*() APIs
The pkeys changes brought about a truly hideous set of macros in:
cde70140fed8 ("mm/gup: Overload get_user_pages() functions")
... which macros are (ab-)using the fact that __VA_ARGS__ can be used
to shift parameter positions in macro arguments without breaking the
build and so can be used to call separate C functions depending on
the number of arguments of the macro.
This allowed easy migration of these 3 GUP APIs, as both these variants
worked at the C level:
old:
ret = get_user_pages(current, current->mm, address, 1, 1, 0, &page,
NULL);
new:
ret = get_user_pages(address, 1, 1, 0, &page, NULL);
... while we also generated a (functionally harmless but noticeable) build
time warning if the old API was used. As there are over 300 uses of these
APIs, this trick eased the migration of the API and avoided excessive
migration pain in linux-next.
Now, with its work done, get rid of all of that complication and ugliness:
3 files changed, 16 insertions(+), 140 deletions(-)
... where the linecount of the migration hack was further inflated by the
fact that there are NOMMU variants of these GUP APIs as well.
Much of the conversion was done in linux-next over the past couple of
months,
and Linus recently removed all remaining old API uses from the upstream
tree
in the following upstrea commit:
cb107161df3c ("Convert straggling drivers to new six-argument
get_user_pages()")
There was one more old-API usage in mm/gup.c, in the
CONFIG_HAVE_GENERIC_RCU_GUP
code path that ARM, ARM64 and PowerPC uses.
After this commit any old API usage will break the build.
[ Also fixed a PowerPC/HAVE_GENERIC_RCU_GUP warning reported by Stephen
Rothwell. ]
====
--
You are receiving this mail because:
You are the assignee for the bug.