45 lines
1.6 KiB
Diff
45 lines
1.6 KiB
Diff
From e7c42c3a9fa0c442ae59a15ccf256224c27ef745 Mon Sep 17 00:00:00 2001
|
|
From: David Smith <dsmith@redhat.com>
|
|
Date: Mon, 25 Apr 2016 10:02:36 -0500
|
|
Subject: [PATCH] Fix PR19990 by updating runtime/linux/access_process_vm.h.
|
|
|
|
* runtime/linux/access_process_vm.h (__access_process_vm_): Use
|
|
get_user_pages_remote() when available.
|
|
* buildrun.cxx (compile_pass): Added export test for
|
|
'get_user_pages_remote()'.
|
|
---
|
|
buildrun.cxx | 1 +
|
|
runtime/linux/access_process_vm.h | 4 ++++
|
|
2 files changed, 5 insertions(+)
|
|
|
|
diff --git a/buildrun.cxx b/buildrun.cxx
|
|
index cac46d42ff86..30082ac841bf 100644
|
|
--- a/buildrun.cxx
|
|
+++ b/buildrun.cxx
|
|
@@ -455,6 +455,7 @@ compile_pass (systemtap_session& s)
|
|
"STAPCONF_MODULE_LAYOUT", NULL);
|
|
output_autoconf(s, o, "autoconf-mod_kallsyms.c",
|
|
"STAPCONF_MOD_KALLSYMS", NULL);
|
|
+ output_exportconf(s, o, "get_user_pages_remote", "STAPCONF_GET_USER_PAGES_REMOTE");
|
|
|
|
o << module_cflags << " += -include $(STAPCONF_HEADER)" << endl;
|
|
|
|
diff --git a/runtime/linux/access_process_vm.h b/runtime/linux/access_process_vm.h
|
|
index a2114c60d9c9..214d4e2546bf 100644
|
|
--- a/runtime/linux/access_process_vm.h
|
|
+++ b/runtime/linux/access_process_vm.h
|
|
@@ -32,7 +32,11 @@ __access_process_vm_ (struct task_struct *tsk, unsigned long addr, void *buf,
|
|
int bytes, ret, offset;
|
|
void *maddr;
|
|
|
|
+#ifdef STAPCONF_GET_USER_PAGES_REMOTE
|
|
+ ret = get_user_pages_remote (tsk, mm, addr, 1, write, 1, &page, &vma);
|
|
+#else
|
|
ret = get_user_pages (tsk, mm, addr, 1, write, 1, &page, &vma);
|
|
+#endif
|
|
if (ret <= 0)
|
|
break;
|
|
|
|
--
|
|
2.8.1
|
|
|