Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:Update
systemtap-docs
systemtap-fix-get_user_pages_remote-test-for-4....
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File systemtap-fix-get_user_pages_remote-test-for-4.10-rc0-kernels.patch of Package systemtap-docs
From: Frank Ch. Eigler <fche@redhat.com> Date: Mon Dec 26 10:39:09 2016 -0500 Subject: Fix get_user_pages_remote() test for 4.10-rc0 kernels. Git-commit: 2676bba61284109b8f6f96921667613c15398a07 References: bsc#1031409 Signed-off-by: Tony Jones <tonyj@suse.de> Fix get_user_pages_remote() test for 4.10-rc0 kernels. This kernel API is undergoing considerable flux. diff --git a/buildrun.cxx b/buildrun.cxx index f5019b925..aaea64cb1 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -450,6 +450,8 @@ compile_pass (systemtap_session& s) output_exportconf(s, o, "get_user_pages_remote", "STAPCONF_GET_USER_PAGES_REMOTE"); output_autoconf(s, o, "autoconf-get_user_pages_remote-flags.c", "STAPCONF_GET_USER_PAGES_REMOTE_FLAGS", NULL); + output_autoconf(s, o, "autoconf-get_user_pages_remote-flags_locked.c", + "STAPCONF_GET_USER_PAGES_REMOTE_FLAGS_LOCKED", NULL); o << module_cflags << " += -include $(STAPCONF_HEADER)" << endl; diff --git a/runtime/linux/access_process_vm.h b/runtime/linux/access_process_vm.h index d9400d723..22a12207a 100644 --- a/runtime/linux/access_process_vm.h +++ b/runtime/linux/access_process_vm.h @@ -33,15 +33,20 @@ __access_process_vm_ (struct task_struct *tsk, unsigned long addr, void *buf, void *maddr; #ifdef STAPCONF_GET_USER_PAGES_REMOTE -#ifdef STAPCONF_GET_USER_PAGES_REMOTE_FLAGS +#if defined(STAPCONF_GET_USER_PAGES_REMOTE_FLAGS_LOCKED) + unsigned int flags = FOLL_FORCE; + if (write) + flags |= FOLL_WRITE; + ret = get_user_pages_remote (tsk, mm, addr, 1, flags, &page, &vma, NULL); +#elif defined(STAPCONF_GET_USER_PAGES_REMOTE_FLAGS) unsigned int flags = FOLL_FORCE; if (write) flags |= FOLL_WRITE; ret = get_user_pages_remote (tsk, mm, addr, 1, flags, &page, &vma); -#else /* !STAPCONF_GET_USER_PAGES_REMOTE_FLAGS */ - ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma); -#endif /* !STAPCONF_GET_USER_PAGES_REMOTE_FLAGS */ #else + ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma); +#endif +#else /* !STAPCONF_GET_USER_PAGES_REMOTE* */ ret = get_user_pages (tsk, mm, addr, 1, write, 1, &page, &vma); #endif if (ret <= 0) diff --git a/runtime/linux/autoconf-get_user_pages_remote-flags_locked.c b/runtime/linux/autoconf-get_user_pages_remote-flags_locked.c new file mode 100644 index 000000000..bb9b56717 --- /dev/null +++ b/runtime/linux/autoconf-get_user_pages_remote-flags_locked.c @@ -0,0 +1,33 @@ +#include <linux/mm.h> + +// +// The following kernel commit changed the get_user_pages_remote() +// function signature: +// +// commit 5b56d49fc31dbb0487e14ead790fc81ca9fb2c99 +// Author: Lorenzo Stoakes <lstoakes@gmail.com> +// Date: Wed Dec 14 15:06:52 2016 -0800 +// +// mm: add locked parameter to get_user_pages_remote() +// +// This changed the function signature from: +// +// long get_user_pages_remote(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); +// +// long get_user_pages_remote(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, int *locked); +// + +long gupr_wrapper2(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, int *locked) +{ + return get_user_pages_remote(tsk, mm, start, nr_pages, gup_flags, + pages, vmas, locked); +}
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor