1 diff -Nur blcr-0.8.5/acinclude.m4 blcr-0.8.6_b4/acinclude.m4
2 --- blcr-0.8.5/acinclude.m4 2013-01-05 01:59:58.000000000 +0100
3 +++ blcr-0.8.6_b4/acinclude.m4 2014-10-21 02:14:39.000000000 +0200
5 # along with this program; if not, write to the Free Software
6 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
8 -# $Id: acinclude.m4,v 1.177.14.17 2013/01/05 00:59:58 phargrov Exp $
9 -AC_REVISION($Revision: 1.177.14.17 $)
10 +# $Id: acinclude.m4,v 1.177.14.22 2014/10/21 00:14:39 phargrov Exp $
11 +AC_REVISION($Revision: 1.177.14.22 $)
13 # Match all kernels major/minor we might accept
14 -m4_define([cr_kern_maj_min_patt],[[\(2\.6\|3\.[0-9][0-9]*\)\.]])[]dnl No SUBLEVEL or following
15 -m4_define([cr_kern_maj_min_perl],[[(2\.6|3\.[0-9]+)\.]])[]dnl No SUBLEVEL or following
16 +m4_define([cr_kern_maj_min_patt],[[\(2\.6\|3\.[0-9][0-9]*\)[-.]]])[]dnl No SUBLEVEL or following
17 +m4_define([cr_kern_maj_min_perl],[[(2\.6|3\.[0-9]+)[-.]]])[]dnl No SUBLEVEL or following
19 # cr_substr(STRING,OFFSET,[LEN])
20 # ------------------------------------------------------
22 open(F, "echo '=${stamp}->UTS_RELEASE<-' | ${cpp_cmd} -include ${path} - |") || exit 1;
25 - if ((my $uts) = /=${stamp}->"(]cr_kern_maj_min_perl[[0-9].*)"<-/o) {
26 + if ((my $uts) = /=${stamp}->"(]cr_kern_maj_min_perl[.*)"<-/o) {
31 if test -z "$cr_tmp"; then
32 # If a dependency does not exist, then make may complain.
33 # The -k and 2>/dev/null take care of that.
34 - cr_tmp=`(make -k echo_kver --no-print-directory -C $2 -f - 2>/dev/null | grep '^cr_kern_maj_min_patt') <<'_EOF_'
35 + cr_tmp=`(${MAKE} -k echo_kver --no-print-directory -C $2 -f - 2>/dev/null | grep '^cr_kern_maj_min_patt') <<'_EOF_'
37 @echo '$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)'
41 AC_MSG_RESULT([$cr_result])
43 - # Check that version is acceptible (exact match, or a prefix with the next char non-numeric)
44 + # Check that version is acceptible (exact match, or a prefix with the next char non-numeric), including matches forced by --with-linux-src-ver
45 case "$cr_linux_obj_ver" in
46 [${cr_result}|${cr_result}[!0-9]*]) # the outer [] is m4 quoting
47 cr_linux_src_ver="$cr_result";;
48 - *) cr_linux_src_ver='';;
49 + *) cr_linux_src_ver=''
50 + if test x"$cr_result" = x"$LINUX_SRC_VER"; then
51 + AC_MSG_WARN([Accepting $2 as kernel source due to --with-linux-src-ver=$LINUX_SRC_VER])
52 + cr_linux_src_ver="$LINUX_SRC_VER"
61 CR_IF([test -z "$cr_linux_src_ver"],
62 - [AC_MSG_ERROR([Could not locate source directory corresponding to build directory '${LINUX_OBJ}'. Please use --with-linux-src=FULL_PATH_TO_KERNEL_SRC])])
63 + [AC_MSG_ERROR([Could not locate source directory corresponding to build directory '${LINUX_OBJ}'. Please use --with-linux-src=FULL_PATH_TO_KERNEL_SRC to specify a directory and/or --with-linux-src-ver=VERSION to force use of a source directory with a version which does not appear to match the build])])
66 # _CR_CHECK_LINUX_OBJ(VER_PATT,DIR,VAR)
68 CR_IF([test -n "$cr_linux_obj_ver"],[CR_FIND_LINUX_SRC($cr_linux_obj_ver)])
69 CR_IF([test -n "$cr_linux_src_ver" -a -n "$cr_linux_obj_ver"],[
70 case "$cr_linux_obj_ver" in
71 - 2.6.*) HAVE_LINUX_2_6=yes;;
72 - 3.*.*) HAVE_LINUX_3=yes;;
73 + 2.6.[[0-9]]*) HAVE_LINUX_2_6=yes;;
74 + 3.[[0-9]]*) HAVE_LINUX_3=yes;;
76 LINUX_VER="$cr_linux_obj_ver"
77 CR_KERNEL=`echo $cr_linux_obj_ver | tr - _`
79 echo 'int foo = 0;' >> conftestdir/conftest.c
80 echo 'obj-m := conftest.o' >conftestdir/Makefile
82 - echo "make -C ${LINUX_SRC} builddir=\"`pwd`/conftestdir\" ${KBUILD_MAKE_ARGS} CC=\"${KCC}\" V=1" >&5
83 - make -C ${LINUX_SRC} builddir="`pwd`/conftestdir" ${KBUILD_MAKE_ARGS} CC="${KCC}" V=1 >conftestdir/output 2>&1 </dev/null
84 + echo "${MAKE} -C ${LINUX_SRC} builddir=\"`pwd`/conftestdir\" ${KBUILD_MAKE_ARGS} CC=\"${KCC}\" V=1" >&5
85 + ${MAKE} -C ${LINUX_SRC} builddir="`pwd`/conftestdir" ${KBUILD_MAKE_ARGS} CC="${KCC}" V=1 >conftestdir/output 2>&1 </dev/null
86 if test $? = 0; then cr_tmp=`grep -m1 conftest\\.c conftestdir/output | [sed -e "s:^[ ]*${KCC}::"]`; fi
87 cat conftestdir/output >&5
88 if test "${cr_tmp:+OK}" != OK; then
90 -Wp,-MMD,*) continue;;
92 -I*) arg=`echo $arg | [sed -e "s:-I:-I${LINUX_OBJ}/:"]`;;
93 + -Werror=strict-prototypes) continue;; # Breaks "int main()" in our probes
96 cr_cvname="$cr_cvname $arg"
100 extern int __libc_allocate_rtsig(int);
105 FILE *f=fopen("conftestval", "w");
106 diff -Nur blcr-0.8.5/autogen.sh blcr-0.8.6_b4/autogen.sh
107 --- blcr-0.8.5/autogen.sh 2012-12-22 00:32:49.000000000 +0100
108 +++ blcr-0.8.6_b4/autogen.sh 2014-10-07 01:12:43.000000000 +0200
110 # along with this program; if not, write to the Free Software
111 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
113 -# $Id: autogen.sh,v 1.7.38.3 2012/12/21 23:32:49 phargrov Exp $
114 +# $Id: autogen.sh,v 1.7.38.4 2014/10/06 23:12:43 phargrov Exp $
119 for dir in . ./config; do
120 - ( cd $dir && rm -f config.guess config.sub depcomp install-sh libtool ltmain.sh missing mkinstalldirs )
121 + ( cd $dir && rm -f config.guess config.sub depcomp install-sh libtool ltmain.sh missing mkinstalldirs test-driver )
123 rm -rf autom4te.cache
126 rm -f config.sub config.guess
128 automake --include-deps --add-missing --copy
129 +if test -e config/test-driver; then # Disable parallel tests:
130 + rm config/test-driver
131 + perl -pi -e 's/^#AUTOMAKE_OPTIONS/AUTOMAKE_OPTIONS/;' -- tests/Makefile.am
132 + automake --include-deps --add-missing --copy
135 if [ -x config.status ]; then
136 echo "################################################################"
137 diff -Nur blcr-0.8.5/configure.ac blcr-0.8.6_b4/configure.ac
138 --- blcr-0.8.5/configure.ac 2013-01-26 01:04:25.000000000 +0100
139 +++ blcr-0.8.6_b4/configure.ac 2014-10-21 02:14:39.000000000 +0200
141 # Process this file with autoconf to produce a configure script.
143 # Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c)
144 -# 2012, The Regents of the University of California, through Lawrence
145 +# 2014, The Regents of the University of California, through Lawrence
146 # Berkeley National Laboratory (subject to receipt of any required
147 # approvals from the U.S. Dept. of Energy). All rights reserved.
150 # along with this program; if not, write to the Free Software
151 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
153 -# $Id: configure.ac,v 1.410.2.52 2013/01/26 00:04:25 phargrov Exp $
154 +# $Id: configure.ac,v 1.410.2.63 2014/10/21 00:14:39 phargrov Exp $
157 ################################################################################
159 # AC_INIT wants to see constants, not shell vars, so we define these with m4.
160 m4_define(RELEASE_MAJOR, 0)
161 m4_define(RELEASE_MINOR, 8)
162 -m4_define(RELEASE_PATCH, 5)
163 +m4_define(RELEASE_PATCH, 6_b4)
165 m4_define(RELEASE_VERSION, RELEASE_MAJOR.RELEASE_MINOR.RELEASE_PATCH)
166 AC_INIT([blcr],[RELEASE_VERSION], [http://ftg.lbl.gov/checkpoint])
168 ################################################################################
169 # Boilerplate for versions and copyrights in generated files
170 ################################################################################
171 -AC_REVISION($Revision: 1.410.2.52 $)
172 +AC_REVISION($Revision: 1.410.2.63 $)
174 Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c)
175 2012, The Regents of the University of California, through Lawrence
177 AC_ARG_WITH([linux-src],
178 [AC_HELP_STRING([--with-linux-src=DIR],[specify full path to Linux kernel source directory if needed (default is to search in some standard locations)])],
179 [AS_IF([test x"$with_linux_src" != xyes],[LINUX_SRC_ARG=$with_linux_src])],)
180 +AC_ARG_WITH([linux-src-ver],
181 + [AC_HELP_STRING([--with-linux-src-ver=VERSION],[force configure to accept a given kernel source version to use, even if it does not appear to match the build])],
182 + [AS_IF([test x"$with_linux_src_ver" != xyes],[LINUX_SRC_VER=$with_linux_src_ver])],)
184 # Let user specify location of kernel System.map and/or vmlinux
185 AC_ARG_WITH([system-map],
187 CR_CHECK_KERNEL_HEADER([asm/desc.h],[#include <linux/sched.h>])
188 CR_CHECK_KERNEL_HEADER([asm/vsyscall32.h])
189 CR_CHECK_KERNEL_HEADER([asm/i387.h])
190 -CR_CHECK_KERNEL_HEADER([asm/switch_to.h])
191 -CR_CHECK_KERNEL_HEADER([asm/tls.h])
192 +CR_CHECK_KERNEL_HEADER([asm/switch_to.h],[#include <linux/sched.h>])
193 +CR_CHECK_KERNEL_HEADER([asm/tls.h],[#include <linux/sched.h>])
195 CR_CHECK_KERNEL_HEADER([linux/utsrelease.h])
196 CR_CHECK_KERNEL_HEADER([generated/utsrelease.h])
197 @@ -1019,6 +1022,8 @@
198 if test "${HAVE_NAMEIDATA_PATH}${HAVE_NAMEIDATA_DENTRY}" != "1"; then
199 CR_BAD_KERNEL([unable to determine composition of struct nameidata])
201 +CR_CHECK_KERNEL_MEMBER([file.f_path],[#include <linux/fs.h>],
202 + [struct file],[struct path],[f_path])
204 CR_CHECK_KERNEL_CALL([path_lookup],[#include <linux/namei.h>])
205 CR_CHECK_KERNEL_CALL([kern_path],[#include <linux/namei.h>])
206 @@ -1029,6 +1034,9 @@
208 CR_CHECK_KERNEL_CALL([__putname],[#include <linux/fs.h>])
210 +CR_CHECK_KERNEL_CALL_NARGS([vfs_getattr],[#include <linux/fs.h>],
211 + [NULL,NULL],[NULL,NULL,NULL])
213 CR_CHECK_KERNEL_TYPE([struct delayed_work],[#include <linux/workqueue.h>])
215 # Order for "best" match
216 @@ -1071,6 +1079,11 @@
217 CR_BAD_KERNEL([unable to determine type of task.pids array])
220 +CR_FIND_KSYM([signal_wake_up],[CODE],
221 + [extern void signal_wake_up(struct task_struct *, int);])
222 +CR_FIND_KSYM([signal_wake_up_state],[CODE],
223 + [extern void signal_wake_up_state(struct task_struct *, int);])
225 # put_task_struct() requires one of these:
226 CR_FIND_KSYM([__put_task_struct],[CODE],[extern void __put_task_struct(struct task_struct *);])
227 CR_FIND_KSYM([__put_task_struct_cb],[CODE])
228 @@ -1096,8 +1109,22 @@
229 CR_CHECK_KERNEL_MEMBER([thread_info.sysenter_return],[#include <linux/thread_info.h>],
230 [struct thread_info],[void *],[sysenter_return])
231 if test $CR_KARCH = arm; then
232 + CR_CHECK_KERNEL_MEMBER([mm.context.sigpage],[#include <linux/sched.h>],
233 + [mm_context_t],[unsigned long],[sigpage])
234 CR_CHECK_KERNEL_MEMBER([thread_info.tp_value],[#include <linux/thread_info.h>],
235 [struct thread_info],[unsigned long],[tp_value])
236 + pushdef([cr_cvname],cr_cv_kconfig_HAVE_THREAD_INFO_TP_VALUE_ARRAY)[]dnl
237 + AC_CACHE_CHECK([kernel thread_info.tp_value as array],cr_cvname,[
238 + CR_TRY_KERNEL_COMPILE([
239 + #include <linux/thread_info.h>
241 + struct thread_info x;
242 + unsigned long i = x.tp_value[1];
243 + ],[cr_cvname=yes],[cr_cvname=no])
245 + CR_DEFINE(HAVE_THREAD_INFO_TP_VALUE_ARRAY,[test x$]cr_cvname[ = xyes],
246 + [Define to 1 if struct thread_info.tp_value has array member 'tp_value'])
247 + popdef([cr_cvname])[]dnl
248 CR_FIND_KSYM([__kuser_helper_start],[CODE],[extern int __kuser_helper_start(void);])
249 CR_FIND_KSYM([__kuser_cmpxchg],[CODE],[extern int __kuser_cmpxchg(void);])
251 @@ -1118,14 +1145,32 @@
252 if test -n "${HAVE_MAP_VSYSCALL}"; then
253 CR_FIND_KSYM([map_vsyscall],[CODE])
255 -if test $CR_KARCH = x86_64; then
258 CR_FIND_KSYM([syscall32_setup_pages],[CODE],
259 [extern int syscall32_setup_pages(void *, int);])
261 -if test $CR_KARCH = arm; then
262 + CR_FIND_KSYM([compat_arch_setup_additional_pages],[CODE],
263 + [extern int compat_arch_setup_additional_pages(void *, int);])
266 CR_FIND_KSYM([vectors_user_mapping],[CODE],
267 [extern int vectors_user_mapping(void);])
272 +pushdef([cr_cvname],cr_cv_kconfig_HAVE_VM_OPS_NAME)[]dnl
273 +AC_CACHE_CHECK([kernel for vm_operations_struct.name],cr_cvname,[
274 + CR_TRY_KERNEL_COMPILE([
275 + #include <linux/sched.h>
276 + #include <linux/mm.h>
278 + struct vm_operations_struct x;
279 + const char *(*name)(struct vm_area_struct *vma) = x.name;
280 + ],[cr_cvname=yes],[cr_cvname=no])
282 +popdef([cr_cvname])[]dnl
283 +CR_DEFINE(HAVE_VM_OPS_NAME,[test x$cr_cv_kconfig_HAVE_VM_OPS_NAME = xyes],
284 + [Define to 1 if struct vm_operations_struct has member 'name'])
286 CR_FIND_KSYM([arch_pick_mmap_layout],[CODE])
287 CR_FIND_KSYM([arch_get_unmaped_area],[CODE])
288 @@ -1134,11 +1179,16 @@
289 [struct mm_struct],[unsigned long],[mmap_base])
290 CR_CHECK_KERNEL_MEMBER([mm.cached_hole_size],[#include <linux/sched.h>],
291 [struct mm_struct],[unsigned long],[cached_hole_size])
292 +CR_CHECK_KERNEL_MEMBER([mm.free_area_cache],[#include <linux/sched.h>],
293 + [struct mm_struct],[unsigned long],[free_area_cache])
295 CR_FIND_KSYM([do_munmap],[CODE])
296 CR_CHECK_KERNEL_CALL([do_mmap],[#include <linux/mm.h>])
297 CR_CHECK_KERNEL_CALL([do_mmap_pgoff],[#include <linux/mm.h>])
298 -if test -n "${HAVE_DO_MMAP_PGOFF}"; then
300 +CR_CHECK_KERNEL_CALL_NARGS([do_mmap_pgoff],[#include <linux/mm.h>],
301 + [NULL,0,0,0,0,0],[NULL,0,0,0,0,0,NULL])
302 +if test -n "${HAVE_6_ARG_DO_MMAP_PGOFF}${HAVE_7_ARG_DO_MMAP_PGOFF}"; then
303 CR_FIND_KSYM([do_mmap_pgoff],[CODE])
304 elif test -n "${HAVE_DO_MMAP}"; then
305 CR_FIND_KSYM([do_mmap],[CODE])
306 @@ -1271,6 +1321,17 @@
307 CR_CHECK_KERNEL_MEMBER([pt_regs.gs],[#include <asm/ptrace.h>],[struct pt_regs],[int],[gs])
310 +if test $CR_KARCH = ppc -o $CR_KARCH = ppc64; then
311 + CR_CHECK_KERNEL_MEMBER([thread.fpr],[#include <linux/sched.h>],
312 + [struct thread_struct],[void*],[fpr])
313 + CR_CHECK_KERNEL_MEMBER([thread.vr],[#include <linux/sched.h>],
314 + [struct thread_struct],[void*],[vr])
315 + CR_CHECK_KERNEL_MEMBER([thread.fp_state],[#include <linux/sched.h>],
316 + [struct thread_struct],[struct thread_fp_state],[fp_state])
317 + CR_CHECK_KERNEL_MEMBER([thread.vr_state],[#include <linux/sched.h>],
318 + [struct thread_struct],[struct thread_vr_state],[vr_state])
321 CR_CHECK_KERNEL_MEMBER([inode sem],[
322 #include <linux/sched.h>
323 #include <linux/fs.h>
324 @@ -1287,9 +1348,13 @@
326 CR_CHECK_KERNEL_MEMBER([mm.dumpable],[#include <linux/sched.h>],
327 [struct mm_struct],[int],[dumpable])
328 -CR_FIND_KSYM([get_dumpable],[CODE],[extern int get_dumpable(struct mm_struct *mm);])
329 +CR_CHECK_KERNEL_CALL([get_dumpable],[#include <linux/sched.h>])
330 +if test -n "${HAVE_GET_DUMPABLE}"; then
331 + # Note: may be an inline in some kernels
332 + CR_FIND_KSYM([get_dumpable],[CODE],[extern int get_dumpable(struct mm_struct *mm);])
334 # Allow one or more match(es)
335 -if test -z "${HAVE_MM_DUMPABLE}${cr_addr}"; then
336 +if test -z "${HAVE_MM_DUMPABLE}${HAVE_GET_DUMPABLE}"; then
337 CR_BAD_KERNEL([unable to determine how to identify non-dumpable tasks])
340 @@ -1308,6 +1373,8 @@
341 CR_CHECK_KERNEL_CALL_NARGS([dentry_open],[#include <linux/fs.h>],
342 [NULL,0,NULL],[NULL,NULL,0,NULL])
344 +CR_CHECK_KERNEL_CALL([uid_eq],[#include <linux/sched.h>])
345 +CR_CHECK_KERNEL_CALL([from_kuid],[#include <linux/sched.h>])
347 CR_CHECK_KERNEL_MEMBER([task.group_info],[#include <linux/sched.h>],
348 [struct task_struct],[struct group_info *],[group_info])
349 @@ -1368,6 +1435,10 @@
350 #include <linux/slab.h>
351 #include <linux/pid_namespace.h>
352 ], [struct pid_namespace],[void *],[pid_cachep])
353 + CR_CHECK_KERNEL_MEMBER([pid_namespace.nr_hashed],[
354 + #include <linux/slab.h>
355 + #include <linux/pid_namespace.h>
356 + ], [struct pid_namespace],[unsigned int],[nr_hashed])
357 CR_FIND_KSYM([pid_cachep],[DATA],[
358 #if HAVE_KMEM_CACHE_T
359 extern kmem_cache_t *pid_cachep;
360 @@ -1398,16 +1469,18 @@
361 #include <linux/pid.h>],
362 [extern void attach_pid(struct task_struct *task, enum pid_type type, struct pid *pid);])
364 -# Require exactly one match
365 -if test "${HAVE_2_6_0_ATTACH_PID}${HAVE_2_6_22_ATTACH_PID}${HAVE_2_6_26_ATTACH_PID}" != "1"; then
366 - CR_BAD_KERNEL([unable to determine how to call attach_pid()])
369 CR_CHECK_KERNEL_CALL([change_pid],[
370 #include <linux/sched.h>
371 #include <linux/pid.h>])
374 +# Require change_pid or exactly one match to attach_pid family
375 +if test -z "${HAVE_CHANGE_PID}"; then
376 + if test "${HAVE_2_6_0_ATTACH_PID}${HAVE_2_6_22_ATTACH_PID}${HAVE_2_6_26_ATTACH_PID}" != "1"; then
377 + CR_BAD_KERNEL([unable to determine how to call attach_pid()])
381 CR_CHECK_KERNEL_TYPE([struct pidmap],[
382 #if HAVE_LINUX_PSPACE_H
383 #include <linux/pspace.h>
384 @@ -1493,7 +1566,7 @@
385 ],[struct pipe_inode_info],[char*],[base])
387 CR_CHECK_KERNEL_MEMBER([pipe_inode_info.buffers],[
388 - #include <linux/wait.h>
389 + #include <linux/sched.h>
390 #include <linux/pipe_fs_i.h>
391 ],[struct pipe_inode_info],[unsigned int],[buffers])
393 @@ -1516,9 +1589,10 @@
394 struct pipe_buf_operations p;
395 (void)p.unmap(NULL,NULL,NULL);
397 + CR_CHECK_KERNEL_CALL([copy_page_to_iter],[#include <linux/uio.h>])
399 # Require exactly one match
400 -if test "${HAVE_PIPE_INODE_INFO_BASE}${HAVE_PIPE_BUF_OPERATIONS_PIN}${HAVE_2_ARG_PIPE_OPS_UNMAP}${HAVE_3_ARG_PIPE_OPS_UNMAP}" != "1"; then
401 +if test "${HAVE_PIPE_INODE_INFO_BASE}${HAVE_PIPE_BUF_OPERATIONS_PIN}${HAVE_2_ARG_PIPE_OPS_UNMAP}${HAVE_3_ARG_PIPE_OPS_UNMAP}${HAVE_COPY_PAGE_TO_ITER}" != "1"; then
402 CR_BAD_KERNEL([unrecognized pipe buf operations])
404 CR_FIND_KSYM([anon_pipe_buf_ops],[DATA],
405 @@ -1607,6 +1681,9 @@
408 CR_CHECK_KERNEL_SYMBOL([proc_root],[#include <linux/proc_fs.h>])
409 +CR_CHECK_KERNEL_CALL([proc_mkdir],[#include <linux/proc_fs.h>])
410 +CR_CHECK_KERNEL_CALL([proc_create],[#include <linux/proc_fs.h>])
411 +CR_CHECK_KERNEL_CALL([proc_remove],[#include <linux/proc_fs.h>])
413 # check kmalloc max size
415 @@ -1699,6 +1776,7 @@
417 CR_FIND_KSYM([set_fs_pwd],[CODE])
419 +CR_FIND_KSYM([set_mm_exe_file],[CODE])
420 CR_FIND_KSYM([sys_mremap],[CODE],
421 [extern asmlinkage unsigned long sys_mremap(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr);])
422 CR_FIND_KSYM([do_sigaction],[CODE])
423 @@ -1736,7 +1814,10 @@
425 CR_FIND_KSYM([expand_files],[CODE],
426 [extern int expand_files(struct files_struct *, int);])
427 +CR_FIND_KSYM([expand_fdtable],[CODE],
428 + [extern int expand_fdtable(struct files_struct *, int);])
429 CR_FIND_KSYM([__flush_icache_range],[CODE])
430 +CR_FIND_KSYM([flush_icache_range],[CODE])
432 CR_FIND_KSYM([sys_fchmod],[CODE],
433 [extern asmlinkage long sys_fchmod(int fd, mode_t mode);])
434 diff -Nur blcr-0.8.5/cr_module/cr_chkpt_req.c blcr-0.8.6_b4/cr_module/cr_chkpt_req.c
435 --- blcr-0.8.5/cr_module/cr_chkpt_req.c 2012-12-18 19:32:05.000000000 +0100
436 +++ blcr-0.8.6_b4/cr_module/cr_chkpt_req.c 2014-09-19 01:46:06.000000000 +0200
438 * along with this program; if not, write to the Free Software
439 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
441 - * $Id: cr_chkpt_req.c,v 1.264.6.5 2012/12/18 18:32:05 phargrov Exp $
442 + * $Id: cr_chkpt_req.c,v 1.264.6.6 2014/09/18 23:46:06 phargrov Exp $
445 #include "cr_module.h"
447 // cr_is_dumpable(task)
449 #define __cr_mm_get_dumpable(mm) ((mm)->dumpable)
450 -#elif defined(CR_KCODE_get_dumpable)
451 +#elif HAVE_GET_DUMPABLE
452 #define __cr_mm_get_dumpable(mm) get_dumpable(mm)
457 tcred = cr_task_cred(task);
458 if ((!cr_is_dumpable(task) ||
459 - ((cred->euid != tcred->suid) && (cred->euid != tcred->uid) &&
460 - (cred->uid != tcred->suid) && (cred->uid != tcred->uid)))
461 + (cr_uid_ne(cred->euid, tcred->suid) && cr_uid_ne(cred->euid, tcred->uid) &&
462 + cr_uid_ne(cred->uid, tcred->suid) && cr_uid_ne(cred->uid, tcred->uid)))
463 && !cr_capable(CAP_KILL)) {
466 diff -Nur blcr-0.8.5/cr_module/cr_creds.c blcr-0.8.6_b4/cr_module/cr_creds.c
467 --- blcr-0.8.5/cr_module/cr_creds.c 2009-02-07 03:42:54.000000000 +0100
468 +++ blcr-0.8.6_b4/cr_module/cr_creds.c 2014-09-19 11:13:53.000000000 +0200
470 * along with this program; if not, write to the Free Software
471 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
473 - * $Id: cr_creds.c,v 1.384.8.2 2009/02/07 02:42:54 phargrov Exp $
474 + * $Id: cr_creds.c,v 1.384.8.4 2014/09/19 09:13:53 phargrov Exp $
477 #include "cr_module.h"
479 int gid_ok = 0; /* Assume no match for this gid */
481 #if defined(CR_KCODE_groups_search)
482 - gid_ok = groups_search((struct group_info *)gi, g); // search is const, but not declared as such
483 + // NOTE: groups_search is const, but not always declared as such
484 + gid_ok = groups_search((struct group_info *)gi, cr_make_kgid(g));
485 #elif defined(CR_KCODE_supplemental_group_member)
486 gid_ok = supplemental_group_member(g);
490 * Set the dumpable flag for the process, taken from 2.6.22 fs/exec.c
492 - if (my_cred->euid == my_cred->uid && my_cred->egid == my_cred->gid) {
493 + if (cr_uid_eq(my_cred->euid, my_cred->uid) && cr_gid_eq(my_cred->egid, my_cred->gid)) {
494 cr_set_dumpable(current->mm, 1);
496 cr_set_dumpable(current->mm, cr_suid_dumpable);
497 @@ -214,12 +215,12 @@
498 cr_cred_t my_cred = cr_current_cred();
501 - cf_creds.uid = my_cred->uid;
502 - cf_creds.euid = my_cred->euid;
503 - cf_creds.suid = my_cred->suid;
504 - cf_creds.gid = my_cred->gid;
505 - cf_creds.egid = my_cred->egid;
506 - cf_creds.sgid = my_cred->sgid;
507 + cf_creds.uid = cr_from_kuid(my_cred->uid);
508 + cf_creds.euid = cr_from_kuid(my_cred->euid);
509 + cf_creds.suid = cr_from_kuid(my_cred->suid);
510 + cf_creds.gid = cr_from_kgid(my_cred->gid);
511 + cf_creds.egid = cr_from_kgid(my_cred->egid);
512 + cf_creds.sgid = cr_from_kgid(my_cred->sgid);
514 /* save the number of groups, so we know how many to read later */
515 gi = cr_current_groups();
519 for (i=0; i<cf_creds.ngroups; ++i) {
520 - groups[i] = CR_GROUP_AT(gi, i);
521 + groups[i] = cr_from_kgid(CR_GROUP_AT(gi, i));
524 result = cr_kwrite(eb, proc_req->file, groups, sizeof_groups);
525 diff -Nur blcr-0.8.5/cr_module/cr_dump_self.c blcr-0.8.6_b4/cr_module/cr_dump_self.c
526 --- blcr-0.8.5/cr_module/cr_dump_self.c 2012-12-19 06:21:28.000000000 +0100
527 +++ blcr-0.8.6_b4/cr_module/cr_dump_self.c 2014-09-19 01:46:06.000000000 +0200
529 * along with this program; if not, write to the Free Software
530 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
532 - * $Id: cr_dump_self.c,v 1.228.8.7 2012/12/19 05:21:28 phargrov Exp $
533 + * $Id: cr_dump_self.c,v 1.228.8.8 2014/09/18 23:46:06 phargrov Exp $
536 #include "cr_module.h"
541 - read_lock(&tasklist_lock);
542 read_lock(&req->lock);
543 + read_lock(&tasklist_lock);
544 /* loop over each task, and copy important fields into the linkage */
546 list_for_each_entry(cr_task, &proc_req->tasks, proc_req_list) {
551 - read_unlock(&req->lock);
552 read_unlock(&tasklist_lock);
553 + read_unlock(&req->lock);
555 /* This will catch the goto, and a possible race condition */
556 if (task_num != task_count) {
557 diff -Nur blcr-0.8.5/cr_module/cr_io.c blcr-0.8.6_b4/cr_module/cr_io.c
558 --- blcr-0.8.5/cr_module/cr_io.c 2013-01-04 05:21:24.000000000 +0100
559 +++ blcr-0.8.6_b4/cr_module/cr_io.c 2014-09-19 01:46:06.000000000 +0200
561 * along with this program; if not, write to the Free Software
562 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
564 - * $Id: cr_io.c,v 1.77.4.6 2013/01/04 04:21:24 phargrov Exp $
565 + * $Id: cr_io.c,v 1.77.4.7 2014/09/18 23:46:06 phargrov Exp $
569 @@ -1308,7 +1308,7 @@
570 /* Attrs up-to-date, so nothing to do */
573 - retval = vfs_getattr(filp->f_vfsmnt, dentry, &stat);
574 + retval = cr_vfs_getattr(filp, &stat);
575 if (map && !retval) {
576 cr_insert_object(map, map_key, (void *)1UL, GFP_KERNEL);
578 diff -Nur blcr-0.8.5/cr_module/cr_kcompat.h blcr-0.8.6_b4/cr_module/cr_kcompat.h
579 --- blcr-0.8.5/cr_module/cr_kcompat.h 2013-01-04 05:21:24.000000000 +0100
580 +++ blcr-0.8.6_b4/cr_module/cr_kcompat.h 2014-09-19 11:13:53.000000000 +0200
582 * along with this program; if not, write to the Free Software
583 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
585 - * $Id: cr_kcompat.h,v 1.247.8.8 2013/01/04 04:21:24 phargrov Exp $
586 + * $Id: cr_kcompat.h,v 1.247.8.10 2014/09/19 09:13:53 phargrov Exp $
588 * This file tries to hide as much as practical the differences among Linux
589 * kernel versions. Preferably this is done by back-porting new features, but
591 #define CR_MAX_FDS(_fdt) ((_fdt)->max_fds)
594 +#if !defined(CR_KCODE_expand_files) && defined(CR_KCODE_expand_fdtable)
595 + static __inline__ int expand_files(struct files_struct *files, int nr) {
596 + return (nr < CR_MAX_FDS(cr_fdtable(files))) ? 0 : expand_fdtable(files, nr);
600 #ifndef thread_group_leader
601 #define thread_group_leader(p) ((p)->pid == (p)->tgid)
607 -#if HAVE_DO_MMAP_PGOFF
608 +#if HAVE_6_ARG_DO_MMAP_PGOFF
609 #define cr_mmap_pgoff do_mmap_pgoff
610 +#elif HAVE_7_ARG_DO_MMAP_PGOFF
611 + static __inline__ unsigned long
612 + cr_mmap_pgoff(struct file *filp, unsigned long addr,
613 + unsigned long len, unsigned long prot,
614 + unsigned long flags, unsigned long pgoff) {
615 + unsigned long populate;
616 + return do_mmap_pgoff(filp, addr, len, prot, flags, pgoff, &populate);
619 #define cr_mmap_pgoff(_filp, _start, _len, _prot, _flags, _pgoff) \
620 do_mmap(_filp, _start, _len, _prot, _flags, ((_pgoff) << PAGE_SHIFT))
626 - #define cr_proc_root (&proc_root)
628 - #define cr_proc_root NULL
631 #if HAVE_SET_DUMPABLE
632 #define cr_set_dumpable(_mm,_val) set_dumpable((_mm),(_val))
633 #elif HAVE_MM_DUMPABLE
635 #define cr_suid_dumpable 0
638 +#if HAVE_2_ARG_VFS_GETATTR
639 + static __inline__ int cr_vfs_getattr(struct file *filp, struct kstat *stat) {
640 + return vfs_getattr(&filp->f_path, stat);
642 +#elif HAVE_3_ARG_VFS_GETATTR
643 + static __inline__ int cr_vfs_getattr(struct file *filp, struct kstat *stat) {
644 + return vfs_getattr(filp->f_vfsmnt, filp->f_dentry, stat);
650 // wait_event_timeout() first appears in 2.6.9
651 // This is reproduced from linux-2.6.9/include/linux/wait.h
652 #ifndef wait_event_timeout
654 #define cr_task_cred(_t) (_t)
658 + #define cr_uid_eq(_left, _right) (uid_eq(_left, _right))
659 + #define cr_uid_ne(_left, _right) (!uid_eq(_left, _right))
660 + #define cr_gid_eq(_left, _right) (gid_eq(_left, _right))
661 + #define cr_gid_ne(_left, _right) (!gid_eq(_left, _right))
663 + #define cr_uid_eq(_left, _right) ((_left) == (_right))
664 + #define cr_uid_ne(_left, _right) ((_left) != (_right))
665 + #define cr_gid_eq(_left, _right) ((_left) == (_right))
666 + #define cr_gid_ne(_left, _right) ((_left) != (_right))
670 + #define cr_from_kuid(_id) from_kuid(&init_user_ns, (_id))
671 + #define cr_make_kuid(_id) make_kuid(&init_user_ns, (_id))
672 + #define cr_from_kgid(_id) from_kgid(&init_user_ns, (_id))
673 + #define cr_make_kgid(_id) make_kgid(&init_user_ns, (_id))
675 + #define cr_from_kuid(_id) (_id)
676 + #define cr_make_kuid(_id) (_id)
677 + #define cr_from_kgid(_id) (_id)
678 + #define cr_make_kgid(_id) (_id)
681 #if defined(CR_KCODE_put_fs_struct)
682 static __inline__ void cr_free_fs_struct(struct fs_struct *fs) {
683 CRI_ASSERT(atomic_read(&fs->count) == 1);
684 diff -Nur blcr-0.8.5/cr_module/cr_pipes.c blcr-0.8.6_b4/cr_module/cr_pipes.c
685 --- blcr-0.8.5/cr_module/cr_pipes.c 2013-01-04 05:21:24.000000000 +0100
686 +++ blcr-0.8.6_b4/cr_module/cr_pipes.c 2014-09-30 04:32:47.000000000 +0200
688 * along with this program; if not, write to the Free Software
689 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
691 - * $Id: cr_pipes.c,v 1.225.8.9 2013/01/04 04:21:24 phargrov Exp $
692 + * $Id: cr_pipes.c,v 1.225.8.11 2014/09/30 02:32:47 phargrov Exp $
695 #include "cr_module.h"
699 cr_errbuf_t *eb = req->errbuf;
700 +#if HAVE_FILE_F_PATH
701 + struct dentry *dentry = first_filp->f_path.dentry;
702 + struct vfsmount *mnt = first_filp->f_path.mnt;
704 struct dentry *dentry = first_filp->f_dentry;
705 struct vfsmount *mnt = first_filp->f_vfsmnt;
707 struct dentry *new_dentry = NULL;
708 int retval = -EINVAL;
714 - { struct pipe_inode_info *pipe = p_inode->i_pipe;
720 curbuf = pipe->curbuf;
721 for (i = 0; i < pipe->nrbufs; ++i) {
722 struct pipe_buffer *pbuf = pipe->bufs + curbuf;
723 - const struct pipe_buf_operations *ops = pbuf->ops;
725 #if HAVE_PIPE_BUF_OPERATIONS_PIN
726 + const struct pipe_buf_operations *ops = pbuf->ops;
727 int error = ops->pin(pipe, pbuf);
730 @@ -814,13 +819,19 @@
731 memcpy(p, addr + pbuf->offset, pbuf->len);
732 ops->unmap(pipe, pbuf, addr);
733 #elif HAVE_2_ARG_PIPE_OPS_UNMAP
734 + const struct pipe_buf_operations *ops = pbuf->ops;
735 addr = ops->map(filp, pipe, pbuf);
736 memcpy(p, addr + pbuf->offset, pbuf->len);
737 ops->unmap(pipe, pbuf);
738 #elif HAVE_3_ARG_PIPE_OPS_UNMAP
739 + const struct pipe_buf_operations *ops = pbuf->ops;
740 addr = ops->map(pipe, pbuf, 0);
741 memcpy(p, addr + pbuf->offset, pbuf->len);
742 ops->unmap(pipe, pbuf, addr);
743 +#elif HAVE_COPY_PAGE_TO_ITER
744 + addr = kmap(pbuf->page);
745 + memcpy(p, addr + pbuf->offset, pbuf->len);
746 + kunmap(pbuf->page);
748 #error "Unknown pipe buf operations"
750 diff -Nur blcr-0.8.5/cr_module/cr_proc.c blcr-0.8.6_b4/cr_module/cr_proc.c
751 --- blcr-0.8.5/cr_module/cr_proc.c 2008-06-19 09:47:57.000000000 +0200
752 +++ blcr-0.8.6_b4/cr_module/cr_proc.c 2014-09-19 01:46:07.000000000 +0200
754 * along with this program; if not, write to the Free Software
755 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
757 - * $Id: cr_proc.c,v 1.19 2008/06/19 07:47:57 phargrov Exp $
758 + * $Id: cr_proc.c,v 1.19.12.1 2014/09/18 23:46:07 phargrov Exp $
761 #include "cr_module.h"
763 #include <linux/init.h>
767 + #define cr_proc_root (&proc_root)
769 + #define cr_proc_root NULL
773 * Our proc_fs entries
777 CR_KTRACE_FUNC_ENTRY();
780 + proc_checkpoint = proc_mkdir("checkpoint", cr_proc_root);
782 proc_checkpoint = create_proc_entry("checkpoint", S_IFDIR, cr_proc_root);
784 if (proc_checkpoint == NULL) {
785 CR_ERR("proc_create_entry(/proc/checkpoint/) failed");
789 +#if HAVE_PROC_CREATE
790 + proc_ctrl = proc_create("ctrl", S_IFREG | S_IRUGO | S_IWUGO,
791 + proc_checkpoint, &cr_ctrl_fops);
793 proc_ctrl = create_proc_entry("ctrl", S_IFREG | S_IRUGO | S_IWUGO,
796 + proc_ctrl->proc_fops = &cr_ctrl_fops;
799 if (proc_ctrl == NULL) {
800 CR_ERR("proc_create_entry(/proc/checkpoint/ctrl) failed");
804 - proc_ctrl->proc_fops = &cr_ctrl_fops;
811 CR_KTRACE_FUNC_ENTRY();
813 +#if HAVE_PROC_REMOVE
814 + proc_remove(proc_ctrl);
815 + proc_remove(proc_checkpoint);
817 remove_proc_entry("ctrl", proc_checkpoint);
818 remove_proc_entry("checkpoint", cr_proc_root);
821 diff -Nur blcr-0.8.5/cr_module/cr_rstrt_req.c blcr-0.8.6_b4/cr_module/cr_rstrt_req.c
822 --- blcr-0.8.5/cr_module/cr_rstrt_req.c 2012-12-25 04:27:28.000000000 +0100
823 +++ blcr-0.8.6_b4/cr_module/cr_rstrt_req.c 2014-09-30 04:32:47.000000000 +0200
825 * along with this program; if not, write to the Free Software
826 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
828 - * $Id: cr_rstrt_req.c,v 1.393.4.16 2012/12/25 03:27:28 phargrov Exp $
829 + * $Id: cr_rstrt_req.c,v 1.393.4.18 2014/09/30 02:32:47 phargrov Exp $
832 #include "cr_module.h"
835 /* Code based heavily on kernel/pid.c */
836 #include <linux/threads.h>
837 +#ifndef BITS_PER_PAGE
838 #define BITS_PER_PAGE (8*PAGE_SIZE)
840 +#ifndef BITS_PER_PAGE_MASK
841 #define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1)
843 #if defined(CR_KDATA_pidmap_array)
844 #define cr_pidmap(nr) &(pidmap_array[(nr) / BITS_PER_PAGE])
845 #define cr_pidmap_alloc() ((void *)get_zeroed_page(GFP_KERNEL))
847 spin_lock_irq(&pidmap_lock);
848 upid = &pid->numbers[0];
849 hlist_add_head_rcu(&upid->pid_chain, &pid_hash[pid_hashfn(upid->nr, upid->ns)]);
850 +#if HAVE_PID_NAMESPACE_NR_HASHED
851 + upid->ns->nr_hashed++;
853 spin_unlock_irq(&pidmap_lock);
856 @@ -2341,7 +2348,6 @@
859 cr_rstrt_proc_req_t *proc_req;
861 cr_task_t *cr_task = NULL;
864 @@ -2368,7 +2374,6 @@
869 cr_task = lookup_task(req);
870 if (IS_ERR(cr_task)) {
871 retval = PTR_ERR(cr_task);
872 diff -Nur blcr-0.8.5/cr_module/cr_trigger.c blcr-0.8.6_b4/cr_module/cr_trigger.c
873 --- blcr-0.8.5/cr_module/cr_trigger.c 2008-12-06 00:15:19.000000000 +0100
874 +++ blcr-0.8.6_b4/cr_module/cr_trigger.c 2013-03-26 20:03:14.000000000 +0100
876 * along with this program; if not, write to the Free Software
877 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
879 - * $Id: cr_trigger.c,v 1.39 2008/12/05 23:15:19 phargrov Exp $
880 + * $Id: cr_trigger.c,v 1.39.6.1 2013/03/26 19:03:14 phargrov Exp $
883 #include "cr_module.h"
885 /* Save the "stoppedness" of the task for later restore */
886 cr_task->stopped = (task->state == TASK_STOPPED);
887 if (!retval && (cr_task->stopped)) {
888 - wake_up_process(task);
889 + signal_wake_up(task,1);
891 cr_task->self_exec_id = task->self_exec_id;
893 diff -Nur blcr-0.8.5/doc/html/BLCR_Admin_Guide.html blcr-0.8.6_b4/doc/html/BLCR_Admin_Guide.html
894 --- blcr-0.8.5/doc/html/BLCR_Admin_Guide.html 2013-01-29 23:32:43.000000000 +0100
895 +++ blcr-0.8.6_b4/doc/html/BLCR_Admin_Guide.html 2014-10-21 00:29:39.000000000 +0200
897 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
900 - <title>BLCR Admin Guide - version 0.8.5</title>
901 + <title>BLCR Admin Guide - version 0.8.6_b4</title>
902 <meta http-equiv="Content-Type"
903 content="text/html; charset=ISO-8859-1">
906 <li>Many "vanilla" Linux 2.6.x and 3.x.y kernels (from <a
907 href="http://www.kernel.org/">kernel.org</a>) have also been tested
908 with many glibc versions (2.2 and up).<br>
909 -We believe vanilla versions 2.6.0 through 3.7.1 all work.
910 +We believe vanilla versions 2.6.0 through 3.16.2 all work.
911 <li>BLCR uses a set of autoconf-based feature tests to probe the
912 kernels it builds against. It is thus likely that a custom kernel based
913 on one of the above kernel sources will work with BLCR, provided that
914 @@ -442,11 +442,11 @@
915 RPMs in the last few lines of output from <tt>rpmbuild</tt> -
918 - Wrote: /usr/src/redhat/RPMS/i686/blcr-0.8.5-1.i686.rpm
919 - Wrote: /usr/src/redhat/RPMS/i686/blcr-libs-0.8.5-1.i686.rpm
920 - Wrote: /usr/src/redhat/RPMS/i686/blcr-devel-0.8.5-1.i686.rpm
921 - Wrote: /usr/src/redhat/RPMS/i686/blcr-modules_2.6.12_1.234-0.8.5-1.i686.rpm
922 - Wrote: /usr/src/redhat/RPMS/i686/blcr-testsuite-0.8.5-1.i686.rpm
923 + Wrote: /usr/src/redhat/RPMS/i686/blcr-0.8.6_b4-1.i686.rpm
924 + Wrote: /usr/src/redhat/RPMS/i686/blcr-libs-0.8.6_b4-1.i686.rpm
925 + Wrote: /usr/src/redhat/RPMS/i686/blcr-devel-0.8.6_b4-1.i686.rpm
926 + Wrote: /usr/src/redhat/RPMS/i686/blcr-modules_2.6.12_1.234-0.8.6_b4-1.i686.rpm
927 + Wrote: /usr/src/redhat/RPMS/i686/blcr-testsuite-0.8.6_b4-1.i686.rpm
929 You should note that the kernel version <tt>2.6.12-1.234</tt> has
931 diff -Nur blcr-0.8.5/doc/html/BLCR_Users_Guide.html blcr-0.8.6_b4/doc/html/BLCR_Users_Guide.html
932 --- blcr-0.8.5/doc/html/BLCR_Users_Guide.html 2013-01-29 23:32:43.000000000 +0100
933 +++ blcr-0.8.6_b4/doc/html/BLCR_Users_Guide.html 2014-10-21 00:29:39.000000000 +0200
935 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
938 - <title>Berkeley Lab Checkpoint/Restart User's Guide - version 0.8.5</title>
939 + <title>Berkeley Lab Checkpoint/Restart User's Guide - version 0.8.6_b4</title>
940 <meta http-equiv="Content-Type"
941 content="text/html; charset=ISO-8859-1">
943 diff -Nur blcr-0.8.5/doc/html/FAQ.html blcr-0.8.6_b4/doc/html/FAQ.html
944 --- blcr-0.8.5/doc/html/FAQ.html 2013-01-29 23:32:43.000000000 +0100
945 +++ blcr-0.8.6_b4/doc/html/FAQ.html 2014-10-21 00:29:39.000000000 +0200
947 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
950 - <title>BLCR Frequently Asked Questions (for version 0.8.5)</title>
951 + <title>BLCR Frequently Asked Questions (for version 0.8.6_b4)</title>
952 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
954 <body bgcolor="#ffffff">
956 -<h1>BLCR Frequently Asked Questions (for version 0.8.5)</h1>
957 +<h1>BLCR Frequently Asked Questions (for version 0.8.6_b4)</h1>
960 <h3>General Questions</h3>
963 BLCR runs on x86 and x86_64 (Opteron/EM64T) systems running Linux 2.6.x
965 - With the 0.8.5 release, we believe the following to work:
966 + With the 0.8.6_b4 release, we believe the following to work:
968 - <li>2.6.0 through 3.7.1 on x86 and x86_64.
969 + <li>2.6.0 through 3.17.x on x86 and x86_64.
971 <p>BLCR 0.7.0 added experimental support for PPC (32-bit), and 0.6.0 added experimental
972 support for PPC64 and ARM. These three architectures have been tested as follows:
973 diff -Nur blcr-0.8.5/etc/blcr.rc blcr-0.8.6_b4/etc/blcr.rc
974 --- blcr-0.8.5/etc/blcr.rc 2013-01-15 04:50:01.000000000 +0100
975 +++ blcr-0.8.6_b4/etc/blcr.rc 2013-07-24 23:13:22.000000000 +0200
977 # chkconfig: 345 90 01
978 # description: Load and unload BLCR kernel modules
980 -# $Id: blcr.rc,v 1.17.14.1 2013/01/15 03:50:01 phargrov Exp $
981 +# $Id: blcr.rc,v 1.17.14.2 2013/07/24 21:13:22 phargrov Exp $
987 +# Default-Start: 2 3 4 5
988 +# Default-Stop: 0 1 6
989 +# Short-Description: Load BLCR kernel modules
990 +# Description: This file loads the kernel modules required for
991 +# Berkeley Lab Checkpoint/Restart (BCLR).
992 +# Visit http://ftg.lbl.gov/checkpoint for information.
995 # The only likely configuration is these three variables:
996 PATH=/bin:/sbin:/usr/bin:/usr/sbin
999 # Try modprobe by default, but fallback on insmod+fullpath
1001 - modprobe $1 || (do_checkmod $1 || insmod ${module_dir}/${1}.ko)
1002 + (modprobe $1 >/dev/null 2>&1) || (do_checkmod $1 || insmod ${module_dir}/${1}.ko)
1005 # Try modprobe -r by default, but fallback on rmmod
1007 - modprobe -r $1 || (do_checkmod $1 && rmmod $1)
1008 + (modprobe -r $1 >/dev/null 2>&1) || (do_checkmod $1 && rmmod $1)
1012 diff -Nur blcr-0.8.5/include/blcr_imports.h.in blcr-0.8.6_b4/include/blcr_imports.h.in
1013 --- blcr-0.8.5/include/blcr_imports.h.in 2010-08-12 23:58:34.000000000 +0200
1014 +++ blcr-0.8.6_b4/include/blcr_imports.h.in 2013-07-24 22:12:33.000000000 +0200
1016 * along with this program; if not, write to the Free Software
1017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1019 - * $Id: blcr_imports.h.in,v 1.14.14.2 2010/08/12 21:58:34 phargrov Exp $
1020 + * $Id: blcr_imports.h.in,v 1.14.14.3 2013/07/24 20:12:33 phargrov Exp $
1022 * This file provides otherwise missing declarations for functions
1023 * and data which BLCR imports via the blcr_imports kernel module.
1025 #include <linux/dcache.h>
1026 #include <linux/namei.h>
1027 #include <linux/fs_struct.h>
1028 +#include <linux/proc_fs.h>
1029 #if HAVE_LINUX_SYSCALLS_H
1030 #include <linux/syscalls.h>
1032 diff -Nur blcr-0.8.5/libcr/cr_core.c blcr-0.8.6_b4/libcr/cr_core.c
1033 --- blcr-0.8.5/libcr/cr_core.c 2009-02-18 02:23:15.000000000 +0100
1034 +++ blcr-0.8.6_b4/libcr/cr_core.c 2014-09-19 01:46:08.000000000 +0200
1036 * License along with this library; if not, write to the Free Software
1037 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1039 - * $Id: cr_core.c,v 1.206.6.2 2009/02/18 01:23:15 phargrov Exp $
1040 + * $Id: cr_core.c,v 1.206.6.3 2014/09/18 23:46:08 phargrov Exp $
1043 #include <sys/ioctl.h>
1044 @@ -407,10 +407,9 @@
1046 int pid = (int)getpid();
1049 info->run.index = info->cr_cb_count;
1050 LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] START", pid);
1051 - rc = cr_checkpoint(0);
1052 + (void) cr_checkpoint(0);
1053 LIBCR_TRACE(LIBCR_TRACE_INFO, "[%d] DONE", pid);
1054 } else if (!info->is_thread) {
1055 CRI_ABORT("STATE ERROR. Probably an excess call to cr_leave_cs().");
1056 diff -Nur blcr-0.8.5/libcr/cr_request.c blcr-0.8.6_b4/libcr/cr_request.c
1057 --- blcr-0.8.5/libcr/cr_request.c 2009-02-14 03:55:38.000000000 +0100
1058 +++ blcr-0.8.6_b4/libcr/cr_request.c 2014-09-19 01:46:08.000000000 +0200
1060 * License along with this library; if not, write to the Free Software
1061 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1063 - * $Id: cr_request.c,v 1.222.4.1 2009/02/14 02:55:38 phargrov Exp $
1064 + * $Id: cr_request.c,v 1.222.4.2 2014/09/18 23:46:08 phargrov Exp $
1066 * Code for clients to request checkpoints and restarts, poll and forward them.
1068 @@ -132,10 +132,9 @@
1069 static int cri_rstrt_hndl_child_inner(void *arg) {
1070 int token = (uintptr_t)arg;
1074 /* Now overlay ourselves with the new image */
1075 - err = __cri_syscall_token(token, CR_OP_RSTRT_CHILD, CRI_SYSCALL_NOARG, &local_errno);
1076 + (void) __cri_syscall_token(token, CR_OP_RSTRT_CHILD, CRI_SYSCALL_NOARG, &local_errno);
1078 /* Not reached unless we've encountered a fatal error.
1079 * ********** Things are hairy here **********
1080 diff -Nur blcr-0.8.5/libcr/Makefile.am blcr-0.8.6_b4/libcr/Makefile.am
1081 --- blcr-0.8.5/libcr/Makefile.am 2013-01-04 05:26:33.000000000 +0100
1082 +++ blcr-0.8.6_b4/libcr/Makefile.am 2014-10-07 01:12:45.000000000 +0200
1084 -e ' [TD] \.?_fini' \
1085 -e ' D __data_start' \
1087 - -e ' B __bss_start' \
1089 + -e ' B _{1,2}bss_start_{0,2}' \
1090 + -e ' B _{1,2}bss_end_{0,2}' \
1091 + -e ' B _{1,2}end_{0,2}' \
1092 -e ' T _(save|rest)[gf]pr_[123][0-9](_x)?'); \
1094 echo "ERROR: libcr_run.so leaks symbol(s), above."; \
1095 diff -Nur blcr-0.8.5/libcr/Makefile.in blcr-0.8.6_b4/libcr/Makefile.in
1096 --- blcr-0.8.5/libcr/Makefile.in 2013-01-30 01:57:44.000000000 +0100
1097 +++ blcr-0.8.6_b4/libcr/Makefile.in 2014-10-21 02:15:26.000000000 +0200
1099 @CR_ENABLE_SHARED_TRUE@ -e ' [TD] \.?_fini' \
1100 @CR_ENABLE_SHARED_TRUE@ -e ' D __data_start' \
1101 @CR_ENABLE_SHARED_TRUE@ -e ' D _edata' \
1102 -@CR_ENABLE_SHARED_TRUE@ -e ' B __bss_start' \
1103 -@CR_ENABLE_SHARED_TRUE@ -e ' B _end' \
1104 +@CR_ENABLE_SHARED_TRUE@ -e ' B _{1,2}bss_start_{0,2}' \
1105 +@CR_ENABLE_SHARED_TRUE@ -e ' B _{1,2}bss_end_{0,2}' \
1106 +@CR_ENABLE_SHARED_TRUE@ -e ' B _{1,2}end_{0,2}' \
1107 @CR_ENABLE_SHARED_TRUE@ -e ' T _(save|rest)[gf]pr_[123][0-9](_x)?'); \
1108 @CR_ENABLE_SHARED_TRUE@ then \
1109 @CR_ENABLE_SHARED_TRUE@ echo "ERROR: libcr_run.so leaks symbol(s), above."; \
1110 diff -Nur blcr-0.8.5/LICENSE.txt blcr-0.8.6_b4/LICENSE.txt
1111 --- blcr-0.8.5/LICENSE.txt 2012-12-20 00:43:08.000000000 +0100
1112 +++ blcr-0.8.6_b4/LICENSE.txt 2014-09-19 02:03:15.000000000 +0200
1114 Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c)
1115 -2012, The Regents of the University of California, through Lawrence
1116 +2014, The Regents of the University of California, through Lawrence
1117 Berkeley National Laboratory (subject to receipt of any required
1118 approvals from the U.S. Dept. of Energy). All rights reserved.
1120 diff -Nur blcr-0.8.5/Makefile.in blcr-0.8.6_b4/Makefile.in
1121 --- blcr-0.8.5/Makefile.in 2013-01-30 01:57:45.000000000 +0100
1122 +++ blcr-0.8.6_b4/Makefile.in 2014-10-21 02:15:27.000000000 +0200
1125 unzip $(distdir).zip ;;\
1127 - chmod -R a-w $(distdir); chmod a+w $(distdir)
1128 + chmod -R a-w $(distdir); chmod u+w $(distdir)
1129 mkdir $(distdir)/_build
1130 mkdir $(distdir)/_inst
1131 chmod a-w $(distdir)
1132 diff -Nur blcr-0.8.5/NEWS blcr-0.8.6_b4/NEWS
1133 --- blcr-0.8.5/NEWS 2013-01-30 01:57:30.000000000 +0100
1134 +++ blcr-0.8.6_b4/NEWS 2014-10-21 00:29:37.000000000 +0200
1136 This file lists the significant user-visible changes between releases
1137 of BLCR, including main features and bug fixes.
1142 +Bug fix and expanded-support release.
1143 + - Relative to the previous Beta:
1144 + + Can now parse Debian Jessie kernel naming (3.x-y vs 3.x.y).
1145 + Hopefully for real this time!
1146 + + Correct operation confirmed with 3.17.x kernels
1147 + - Testing is now "sufficient" for release.
1152 +Bug fix and expanded-support release.
1153 + - Relative to the previous Beta:
1154 + + Fix compilation problems with recent ARM kernels
1155 + + A couple minor bug fixes
1156 + + Can now parse Debian Jessie kernel naming (3.x-y vs 3.x.y).
1157 + + autogen.sh now supports recent automake versions
1158 + - Testing on x86, x86-64, ppc and ppc64 now "sufficient" for release.
1163 +Bug fix and expanded-support release.
1164 + - Relative to the previous Beta:
1165 + + Fix compilation problems with recent PPC/PPC64 kernels
1166 + - Testing on CPUs other than x86-64 remains "thin".
1167 + - The issue with Debian Jessie kernel naming remains UNresolved.
1172 +Bug fix and expanded-support release.
1173 + - This release adds support for "vanilla" Linux kernels up to 3.16,
1174 + and has been tested with x86-64 3.x kernels from several popular
1176 + - Testing on other CPUs will precede release of the final 0.8.6.
1177 + - This release fixes the following user-visible bugs and "issues"
1178 + + Fix bug 3142 - stopped.st timeout on many recent kernels
1179 + The problem would manifest as a failure of the stopped.st test
1180 + in "make check" on kernels containing the fix for CVE-2013-0871.
1181 + + Fix bug 2620 - /proc/PID/exe not restored on restart
1182 + The fix has been known since Dec 2009, but had unintentionally
1183 + never been applied to the 0.8.x release branch.
1184 + + Fix support that was broken by recent "RHEL6" kernels (such as
1185 + 2.6.32-431.23.3.el6.x86_64).
1186 + + Fix possible deadlock in pid-restore code
1187 + - This release is known NOT to work with Debian Jessie kernels due
1188 + to their kernel naming scheme (3.x-y) which BLCR's configure logic
1189 + does not recognize. This should be fixed in the final 0.8.6.
1194 diff -Nur blcr-0.8.5/rpm/specfile.in blcr-0.8.6_b4/rpm/specfile.in
1195 --- blcr-0.8.5/rpm/specfile.in 2012-12-21 21:32:42.000000000 +0100
1196 +++ blcr-0.8.6_b4/rpm/specfile.in 2013-07-24 23:21:13.000000000 +0200
1197 @@ -179,13 +179,21 @@
1201 + if [ -x /usr/lib/lsb/install_initd ]; then
1202 + /usr/lib/lsb/install_initd /etc/init.d/blcr
1204 /sbin/chkconfig --add blcr
1211 + if [ -x /usr/lib/lsb/remove_initd ]; then
1212 + /usr/lib/lsb/remove_initd /etc/init.d/blcr
1214 /sbin/chkconfig --del blcr
1219 diff -Nur blcr-0.8.5/tests/crut_wrapper.c blcr-0.8.6_b4/tests/crut_wrapper.c
1220 --- blcr-0.8.5/tests/crut_wrapper.c 2009-03-12 21:07:38.000000000 +0100
1221 +++ blcr-0.8.6_b4/tests/crut_wrapper.c 2014-10-07 01:12:46.000000000 +0200
1223 * along with this program; if not, write to the Free Software
1224 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1226 - * $Id: crut_wrapper.c,v 1.16.4.1 2009/03/12 20:07:38 phargrov Exp $
1227 + * $Id: crut_wrapper.c,v 1.16.4.2 2014/10/06 23:12:46 phargrov Exp $
1229 * Runs a crut-style test.
1232 rc = waitpid(pid, &status, 0);
1233 timeout = 1 + alarm(0);
1234 if ((rc < 0) && expired) goto timeout;
1235 - } while ((rc < 0) && (errno = EINTR));
1236 + } while ((rc < 0) && (errno == EINTR));
1238 while (!kill(-pid, 0)) {
1239 if (! --timeout) goto timeout;
1243 rc = waitpid(pid, &status, 0);
1244 - } while ((rc < 0) && (errno = EINTR));
1245 + } while ((rc < 0) && (errno == EINTR));
1247 die("waitpid(restart_cmd) failed: %s", cr_strerror(errno));
1248 } else if (status) {
1249 diff -Nur blcr-0.8.5/tests/dlopen_aux.c blcr-0.8.6_b4/tests/dlopen_aux.c
1250 --- blcr-0.8.5/tests/dlopen_aux.c 2008-05-20 02:44:57.000000000 +0200
1251 +++ blcr-0.8.6_b4/tests/dlopen_aux.c 2013-03-26 02:11:57.000000000 +0100
1254 + * Berkeley Lab Checkpoint/Restart (BLCR) for Linux is Copyright (c)
1255 + * 2009, The Regents of the University of California, through Lawrence
1256 + * Berkeley National Laboratory (subject to receipt of any required
1257 + * approvals from the U.S. Dept. of Energy). All rights reserved.
1259 + * Portions may be copyrighted by others, as may be noted in specific
1260 + * copyright notices within specific files.
1262 + * This program is free software; you can redistribute it and/or modify
1263 + * it under the terms of the GNU General Public License as published by
1264 + * the Free Software Foundation; either version 2 of the License, or
1265 + * (at your option) any later version.
1267 + * This program is distributed in the hope that it will be useful,
1268 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1269 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1270 + * GNU General Public License for more details.
1272 + * You should have received a copy of the GNU General Public License
1273 + * along with this program; if not, write to the Free Software
1274 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1276 + * $Id: dlopen_aux.c,v 1.1.30.1 2013/03/26 01:11:57 phargrov Exp $
1279 #define _GNU_SOURCE 1 // For RTLD_DEFAULT
1287 + #define _STRINGIFY_HELPER(x) #x
1288 + #define _STRINGIFY(x) _STRINGIFY_HELPER(x)
1293 + char filename[] = "libcr.so." _STRINGIFY(LIBCR_MAJOR);
1294 cr_client_id_t (*my_cr_init)(void);
1295 void *self_handle = dlopen(NULL, RTLD_LAZY);
1301 - libcr_handle = dlopen("libcr.so", RTLD_NOW);
1302 + libcr_handle = dlopen(filename, RTLD_NOW);
1303 if (libcr_handle == NULL) {
1304 - fprintf(stderr, "dlopen(libcr.so) failed unexpectedly. Bad LD_LIBRARY_PATH?\n");
1305 + fprintf(stderr, "dlopen(%s) failed unexpectedly. Bad LD_LIBRARY_PATH?\n", filename);
1309 diff -Nur blcr-0.8.5/tests/emacslisp_test.sh blcr-0.8.6_b4/tests/emacslisp_test.sh
1310 --- blcr-0.8.5/tests/emacslisp_test.sh 2008-04-27 23:26:39.000000000 +0200
1311 +++ blcr-0.8.6_b4/tests/emacslisp_test.sh 2014-09-19 01:46:09.000000000 +0200
1313 \rm -f Context[123] .Context[123].tmp 2>/dev/null
1314 exec 2>/dev/null # To drop job control messages
1315 echo '#ST_ALARM:120'
1316 -$cr_run emacs -nw -q -batch \
1317 +$cr_run_lb emacs -nw -q -batch \
1318 -eval '(defun greet (n)
1319 (princ (format "%d Hello\n" n))
1323 $cr_restart Context2 2>&1 &
1325 -echo "# Restart interpreter" # Note entire emacs output still might be bufferd
1326 +echo "# Restart interpreter"
1328 $cr_restart Context3 2>&1
1329 \rm -f Context[123] .Context[123].tmp 2>/dev/null
1330 diff -Nur blcr-0.8.5/tests/Makefile.am blcr-0.8.6_b4/tests/Makefile.am
1331 --- blcr-0.8.5/tests/Makefile.am 2011-08-03 21:24:29.000000000 +0200
1332 +++ blcr-0.8.6_b4/tests/Makefile.am 2014-09-19 01:46:09.000000000 +0200
1334 +# Uncomment the following if your automake defaults to parallel tests.
1335 +# You'll know becuase your build will fail with output like:
1336 +# Makefile:1923: *** unterminated variable reference. Stop.
1337 +#AUTOMAKE_OPTIONS = serial-tests
1339 # Special target (run before tests) ensures the kernel modules are loaded
1341 @(/sbin/lsmod | grep '^blcr ' > /dev/null 2>&1) || \
1342 diff -Nur blcr-0.8.5/tests/RUN_ME.in blcr-0.8.6_b4/tests/RUN_ME.in
1343 --- blcr-0.8.5/tests/RUN_ME.in 2011-08-03 21:24:29.000000000 +0200
1344 +++ blcr-0.8.6_b4/tests/RUN_ME.in 2013-03-25 21:13:25.000000000 +0100
1346 echo '#### BLCR modules are not loaded. Cannot run the tests! ####'
1347 echo '#### You must insmod/modprobe the following modules as ####'
1348 echo '#### root (in order) before you can run the test suite. ####'
1349 - echo '#### blcr_imports blcr_vmadump blcr ####'
1350 + echo '#### blcr_imports blcr ####'
1351 echo '#############################################################'
1354 diff -Nur blcr-0.8.5/tests/shellinit.in blcr-0.8.6_b4/tests/shellinit.in
1355 --- blcr-0.8.5/tests/shellinit.in 2008-05-23 03:30:56.000000000 +0200
1356 +++ blcr-0.8.6_b4/tests/shellinit.in 2014-09-19 01:46:10.000000000 +0200
1358 @CR_ENABLE_SHARED_TRUE@cr_run=${cr_run:-${cr_bindir}/cr_run}
1359 @CR_ENABLE_SHARED_FALSE@cr_run=env
1361 +# cr_run which additionally attempts to force line buffered stdout.
1362 +# This is needed for some SEQ tests.
1363 +cr_run_lb="$cr_run"
1364 +if (stdbuf -oL true >/dev/null 2>&1); then cr_run_lb="$cr_run stdbuf -oL"; fi
1366 cr_checkpoint=${cr_checkpoint:-${cr_bindir}/cr_checkpoint}
1367 export cr_checkpoint
1368 diff -Nur blcr-0.8.5/vmadump4/vmadump_arm.c blcr-0.8.6_b4/vmadump4/vmadump_arm.c
1369 --- blcr-0.8.5/vmadump4/vmadump_arm.c 2012-12-22 20:14:36.000000000 +0100
1370 +++ blcr-0.8.6_b4/vmadump4/vmadump_arm.c 2014-10-07 01:12:47.000000000 +0200
1372 * along with this program; if not, write to the Free Software
1373 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1375 - * $Id: vmadump_arm.c,v 1.8.16.5 2012/12/22 19:14:36 phargrov Exp $
1376 + * $Id: vmadump_arm.c,v 1.8.16.6 2014/10/06 23:12:47 phargrov Exp $
1378 * Experimental ARM support contributed by Anton V. Uzunov
1379 * <anton.uzunov@dsto.defence.gov.au> of the Australian Government
1382 #if HAVE_THREAD_INFO_TP_VALUE
1383 // Store thread-specific pointer
1384 + #if HAVE_THREAD_INFO_TP_VALUE_ARRAY
1385 + thread->tp_value[1] = get_tpuser();
1387 r = write_kern(ctx, file, &thread->tp_value,
1388 sizeof(thread->tp_value));
1389 if (r != sizeof(thread->tp_value)) goto err;
1391 - VMAD_DEBUG( "vmadump: thread->tp_value == %ld",
1392 - thread->tp_value );
1396 @@ -145,13 +146,20 @@
1397 r = read_kern(ctx, file, &thread->tp_value,
1398 sizeof(thread->tp_value));
1399 if (r != sizeof(thread->tp_value)) goto bad_read;
1400 - VMAD_DEBUG( "vmadump: thread->tp_value == %ld",
1401 - thread->tp_value );
1402 - #if defined(has_tls_reg)
1403 + #if defined(has_tls_reg) && HAVE_THREAD_INFO_TP_VALUE_ARRAY
1404 /* Since 2.6.36 tls_emu and had_tls_reg are macros w/ value 0 or 1 */
1407 } else if (has_tls_reg) {
1408 + asm ("mcr p15, 0, %0, c13, c0, 3" : : "r" (thread->tp_value[0]) );
1409 + asm ("mcr p15, 0, %0, c13, c0, 2" : : "r" (thread->tp_value[1]) );
1410 + } else { // Note: must be (much) later than 2.6.12
1411 + *((unsigned int *)0xffff0ff0) = (thread->tp_value[0]);
1413 + #elif defined(has_tls_reg)
1416 + } else if (has_tls_reg) {
1417 asm ("mcr p15, 0, %0, c13, c0, 3" : : "r" (thread->tp_value) );
1418 } else { // Note: must be (much) later than 2.6.12
1419 *((unsigned int *)0xffff0ff0) = (thread->tp_value);
1420 @@ -178,9 +186,20 @@
1422 #if defined(ARCH_HAS_SETUP_ADDITIONAL_PAGES)
1424 +#ifndef CONFIG_VECTORS_BASE
1425 + #define CONFIG_VECTORS_BASE 0xffff0000
1428 +#if HAVE_MM_CONTEXT_SIGPAGE
1429 + #define VMAD_SIGPAGE(_task) ((_task)->mm->context.sigpage)
1431 + #define VMAD_SIGPAGE(_task) 0
1434 int vmad_is_arch_map(const struct vm_area_struct *map)
1436 - return (map->vm_start == 0xffff0000);
1437 + return (map->vm_start == CONFIG_VECTORS_BASE) ||
1438 + (map->vm_start == VMAD_SIGPAGE(current));
1440 EXPORT_SYMBOL_GPL(vmad_is_arch_map);
1443 head.end = map->vm_end;
1444 head.flags = map->vm_flags;
1445 head.namelen = VMAD_NAMELEN_ARCH;
1447 + head.pgoff = VMAD_SIGPAGE(current);
1449 up_read(¤t->mm->mmap_sem);
1450 r = write_kern(ctx, file, &head, sizeof(head));
1451 @@ -217,11 +236,9 @@
1453 /* First check if the mapping is still/already in place */
1454 down_read(¤t->mm->mmap_sem);
1455 - map = find_vma(current->mm, 0xffff0000);
1456 + map = find_vma(current->mm, CONFIG_VECTORS_BASE);
1457 up_read(¤t->mm->mmap_sem);
1458 if (map != NULL) goto out;
1460 - /* NOT REACHED - since in practice we'll never remove the mapping. */
1462 #if HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES
1463 r = arch_setup_additional_pages(NULL, 0);
1464 @@ -235,6 +252,18 @@
1468 + #if HAVE_MM_CONTEXT_SIGPAGE
1469 + // TODO: Can we fixup the boot-time randomization in [sigpage]?
1470 + if (head->pgoff && VMAD_SIGPAGE(current) != head->pgoff) {
1471 + r = vmad_remap(ctx, VMAD_SIGPAGE(current), head->pgoff, PAGE_SIZE);
1473 + CR_ERR_CTX(ctx, "sigpage remap failed %d", (int)r);
1476 + VMAD_SIGPAGE(current) = head->pgoff;
1483 diff -Nur blcr-0.8.5/vmadump4/vmadump_common.c blcr-0.8.6_b4/vmadump4/vmadump_common.c
1484 --- blcr-0.8.5/vmadump4/vmadump_common.c 2013-01-29 21:17:11.000000000 +0100
1485 +++ blcr-0.8.6_b4/vmadump4/vmadump_common.c 2014-09-19 01:46:11.000000000 +0200
1487 * along with this program; if not, write to the Free Software
1488 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1490 - * $Id: vmadump_common.c,v 1.86.4.14 2013/01/29 20:17:11 phargrov Exp $
1491 + * $Id: vmadump_common.c,v 1.86.4.17 2014/09/18 23:46:11 phargrov Exp $
1493 * THIS VERSION MODIFIED FOR BLCR <http://ftg.lbl.gov/checkpoint>
1494 *-----------------------------------------------------------------------*/
1495 @@ -565,10 +565,12 @@
1496 !filp->f_mapping->a_ops->direct_IO)
1498 #elif HAVE_INODE_I_MAPPING
1500 struct inode *inode = filp->f_dentry->d_inode;
1501 if (!inode->i_mapping || !inode->i_mapping->a_ops ||
1502 !inode->i_mapping->a_ops->direct_IO)
1512 + unsigned long start, end, pgoff;
1514 if (head->flags & VM_MAYSHARE) {
1515 if (head->flags & VM_MAYWRITE) {
1516 @@ -746,16 +749,27 @@
1517 return PTR_ERR(file);
1520 + start = head->start;
1522 + pgoff = head->pgoff;
1524 down_write(¤t->mm->mmap_sem);
1525 - mapaddr = cr_mmap_pgoff(file, head->start, head->end - head->start,
1526 - prot, flags, head->pgoff);
1527 + if (start & VMAD_VM_EXECUTABLE) {
1528 + start ^= VMAD_VM_EXECUTABLE;
1529 +#if defined(CR_KCODE_set_mm_exe_file)
1530 + if (!current->mm->exe_file)
1531 + set_mm_exe_file(current->mm, file);
1534 + mapaddr = cr_mmap_pgoff(file, start, end - start,
1535 + prot, flags, pgoff);
1536 up_write(¤t->mm->mmap_sem);
1538 - if (mapaddr != head->start)
1539 + if (mapaddr != start)
1540 CR_ERR_CTX(ctx, "mmap(<file>, %p, %p, ...) failed: %p",
1541 - (void *) head->start, (void *) (head->end-head->start),
1542 + (void *) start, (void *) (end-start),
1544 - return (mapaddr == head->start) ? 0 : mapaddr;
1545 + return (mapaddr == start) ? 0 : mapaddr;
1548 /* Reads in the header giving the the number of bytes of "fill" to
1551 unsigned long mmap_prot, mmap_flags, addr;
1553 + const unsigned long start = head->start & ~VMAD_VM_EXECUTABLE;
1554 + const unsigned long len = head->end - start;
1556 if (head->namelen == VMAD_NAMELEN_ARCH) {
1557 #if VMAD_HAVE_ARCH_MAPS
1558 return vmad_load_arch_map(ctx, file, head);
1559 @@ -941,13 +958,13 @@
1561 /* Load the data from the dump file */
1562 down_write(¤t->mm->mmap_sem);
1563 - addr = cr_mmap_pgoff(0, head->start, head->end - head->start,
1564 + addr = cr_mmap_pgoff(0, start, len,
1565 mmap_prot|PROT_WRITE, mmap_flags, 0);
1566 up_write(¤t->mm->mmap_sem);
1567 - if (addr != head->start) {
1568 + if (addr != start) {
1569 CR_ERR_CTX(ctx, "mmap(0, %08lx, %08lx, ...) = 0x%08lx (failed)",
1570 - head->start, head->end - head->start, addr);
1571 - if ((addr != head->start) && IS_ERR((void *) addr)) {
1572 + start, len, addr);
1573 + if ((addr != start) && IS_ERR((void *) addr)) {
1574 r = PTR_ERR((void *) addr);
1578 r = vmadump_load_page_list(ctx, file, (mmap_prot & PROT_EXEC));
1581 - if (sys_mprotect(head->start,head->end - head->start, mmap_prot))
1582 + if (sys_mprotect(start, len, mmap_prot))
1583 CR_ERR_CTX(ctx, "thaw: mprotect failed. (ignoring)");
1586 @@ -1304,16 +1321,25 @@
1587 #if defined(CR_KCODE_arch_pick_mmap_layout)
1588 arch_pick_mmap_layout(mm);
1590 -#if HAVE_MM_MMAP_BASE
1592 /* want to restore these even if arch_pick_mmap_layout() set them */
1593 +#if HAVE_MM_MMAP_BASE
1594 mm->mmap_base = mmap_base;
1596 +#if HAVE_MM_FREE_AREA_CACHE
1597 +# if HAVE_MM_MMAP_BASE
1598 mm->free_area_cache = mmap_base;
1601 mm->free_area_cache = TASK_UNMAPPED_BASE;
1604 #if HAVE_MM_CACHED_HOLE_SIZE
1605 mm->cached_hole_size = ~0UL;
1608 +#if defined(CR_KCODE_set_mm_exe_file)
1609 + set_mm_exe_file(current->mm, NULL);
1611 up_write(¤t->mm->mmap_sem);
1613 /* Load new map data */
1614 @@ -1805,6 +1831,7 @@
1615 /* Region is an executable */
1616 if (flags & VMAD_DUMP_EXEC)
1618 + head.start |= VMAD_VM_EXECUTABLE;
1619 } else if (is_library(filename)) {
1620 /* Region is a library */
1621 if (flags & VMAD_DUMP_LIBS)
1622 diff -Nur blcr-0.8.5/vmadump4/vmadump.h blcr-0.8.6_b4/vmadump4/vmadump.h
1623 --- blcr-0.8.5/vmadump4/vmadump.h 2012-12-18 19:32:09.000000000 +0100
1624 +++ blcr-0.8.6_b4/vmadump4/vmadump.h 2013-07-24 22:12:34.000000000 +0200
1626 * along with this program; if not, write to the Free Software
1627 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1629 - * $Id: vmadump.h,v 1.47.4.2 2012/12/18 18:32:09 phargrov Exp $
1630 + * $Id: vmadump.h,v 1.47.4.3 2013/07/24 20:12:34 phargrov Exp $
1632 * THIS VERSION MODIFIED FOR BLCR <http://ftg.lbl.gov/checkpoint>
1633 *-----------------------------------------------------------------------*/
1635 unsigned long pgoff; /* file offset for mmap, in page units */
1638 +/* Flag(s) ORed into start field of struct vmadump_vma_header: */
1639 +#define VMAD_VM_EXECUTABLE 1UL
1641 struct vmadump_page_header {
1642 unsigned long start; /* ~0 = end of list */
1643 unsigned int num_pages;
1644 diff -Nur blcr-0.8.5/vmadump4/vmadump_i386.c blcr-0.8.6_b4/vmadump4/vmadump_i386.c
1645 --- blcr-0.8.5/vmadump4/vmadump_i386.c 2012-12-22 08:42:52.000000000 +0100
1646 +++ blcr-0.8.6_b4/vmadump4/vmadump_i386.c 2014-09-19 01:46:11.000000000 +0200
1648 * along with this program; if not, write to the Free Software
1649 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1651 - * $Id: vmadump_i386.c,v 1.38.8.4 2012/12/22 07:42:52 phargrov Exp $
1652 + * $Id: vmadump_i386.c,v 1.38.8.5 2014/09/18 23:46:11 phargrov Exp $
1654 * THIS VERSION MODIFIED FOR BLCR <http://ftg.lbl.gov/checkpoint>
1655 *-----------------------------------------------------------------------*/
1658 int vmad_is_arch_map(const struct vm_area_struct *map)
1660 + if (vmad_is_vvar_map((struct vm_area_struct *)map)) return 1;
1661 return (map->vm_start == (unsigned long)vmad_vdso_base);
1663 EXPORT_SYMBOL_GPL(vmad_is_arch_map);
1668 + if (vmad_is_vvar_map(map)) return 0;
1670 if (vmad_is_arch_map(map)) {
1671 /* Just write out a section header */
1672 struct vmadump_vma_header head;
1673 @@ -373,6 +376,15 @@
1674 * Since no failure was indicatated we just fill it in below.
1676 } else if (vmad_vdso_base != (void *)head->start) {
1677 + #if HAVE_VM_OPS_NAME
1678 + /* Relocate vvar map if present immediately above or below vdso */
1679 + r = vmad_reloc_vvar(ctx, (unsigned long)vmad_vdso_base, head);
1681 + CR_ERR_CTX(ctx, "vvar remap failed %d", (int)r);
1686 r = vmad_remap(ctx, (unsigned long)vmad_vdso_base, head->start, head->end - head->start);
1688 CR_ERR_CTX(ctx, "vdso remap failed %d", (int)r);
1689 diff -Nur blcr-0.8.5/vmadump4/vmadump_ppc64.c blcr-0.8.6_b4/vmadump4/vmadump_ppc64.c
1690 --- blcr-0.8.5/vmadump4/vmadump_ppc64.c 2012-12-22 08:42:52.000000000 +0100
1691 +++ blcr-0.8.6_b4/vmadump4/vmadump_ppc64.c 2014-09-30 04:32:49.000000000 +0200
1693 * along with this program; if not, write to the Free Software
1694 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1696 - * $Id: vmadump_ppc64.c,v 1.9.14.4 2012/12/22 07:42:52 phargrov Exp $
1697 + * $Id: vmadump_ppc64.c,v 1.9.14.5 2014/09/30 02:32:49 phargrov Exp $
1699 * THIS VERSION MODIFIED FOR BLCR <http://ftg.lbl.gov/checkpoint>
1700 *-----------------------------------------------------------------------*/
1702 # include <asm/switch_to.h>
1705 +#if HAVE_THREAD_FP_STATE
1706 + #define thread_fp_save_area(_thread) \
1707 + ((_thread).fp_save_area ? (_thread).fp_save_area : &(_thread).fp_state)
1709 +#if HAVE_THREAD_VR_STATE
1710 + #define thread_vr_save_area(_thread) \
1711 + ((_thread).vr_save_area ? (_thread).vr_save_area : &(_thread).vr_state)
1714 long vmadump_store_cpu(cr_chkpt_proc_req_t *ctx, struct file *file,
1715 struct pt_regs *regs) {
1718 /* Floating point regs */
1719 if (regs->msr & MSR_FP)
1720 giveup_fpu(current);
1721 +#if HAVE_THREAD_FPR
1722 r = write_kern(ctx, file, ¤t->thread.fpr,
1723 sizeof(current->thread.fpr));
1724 if (r != sizeof(current->thread.fpr)) goto err;
1726 sizeof(current->thread.fpscr));
1727 if (r != sizeof(current->thread.fpscr)) goto err;
1729 +#elif HAVE_THREAD_FP_STATE
1730 + r = write_kern(ctx, file, thread_fp_save_area(current->thread),
1731 + sizeof(current->thread.fp_state));
1732 + if (r != sizeof(current->thread.fp_state)) goto err;
1735 + #error Unknown PPC floating point state
1738 #if HAVE_THREAD_VDSO_BASE
1739 /* unconditionally store the base of the VDSO library */
1741 /* XXX I really need to find out if this is right */
1742 if (regs->msr & MSR_VEC)
1743 giveup_altivec(current);
1744 + #if HAVE_THREAD_VR
1745 r = write_kern(ctx, file, ¤t->thread.vr,
1746 sizeof(current->thread.vr));
1747 if (r != sizeof(current->thread.vr)) goto err;
1749 sizeof(current->thread.vscr));
1750 if (r != sizeof(current->thread.vscr)) goto err;
1752 + #elif HAVE_THREAD_VR_STATE
1753 + r = write_kern(ctx, file, thread_vr_save_area(current->thread),
1754 + sizeof(current->thread.vr_state));
1755 + if (r != sizeof(current->thread.vr_state)) goto err;
1758 + #error Unknown PPC vector register state
1763 + /* TODO: VSX state */
1767 + /* TODO: SPE state */
1774 memcpy(regs, ®tmp, sizeof(regtmp));
1776 /* Floating point regs */
1777 +#if HAVE_THREAD_FPR
1778 r = read_kern(ctx, file, ¤t->thread.fpr,
1779 sizeof(current->thread.fpr));
1780 if (r != sizeof(current->thread.fpr)) goto bad_read;
1781 @@ -112,6 +149,11 @@
1782 r = read_kern(ctx, file, ¤t->thread.fpscr,
1783 sizeof(current->thread.fpscr));
1784 if (r != sizeof(current->thread.fpscr)) goto bad_read;
1785 +#elif HAVE_THREAD_FP_STATE
1786 + r = read_kern(ctx, file, thread_fp_save_area(current->thread),
1787 + sizeof(current->thread.fp_state));
1788 + if (r != sizeof(current->thread.fp_state)) goto bad_read;
1791 #if HAVE_THREAD_VDSO_BASE
1792 /* unconditonally restore this */
1795 #ifdef CONFIG_ALTIVEC
1796 /* Restore Altivec */
1797 + #if HAVE_THREAD_VR
1798 r = read_kern(ctx, file, ¤t->thread.vr,
1799 sizeof(current->thread.vr));
1800 if (r != sizeof(current->thread.vr)) goto bad_read;
1801 @@ -129,6 +172,19 @@
1802 r = read_kern(ctx, file, ¤t->thread.vscr,
1803 sizeof(current->thread.vscr));
1804 if (r != sizeof(current->thread.vscr)) goto bad_read;
1805 + #elif HAVE_THREAD_VR_STATE
1806 + r = read_kern(ctx, file, thread_vr_save_area(current->thread),
1807 + sizeof(current->thread.vr_state));
1808 + if (r != sizeof(current->thread.vr_state)) goto bad_read;
1813 + /* TODO: VSX state */
1817 + /* TODO: SPE state */
1820 current->thread.regs = regs;
1821 diff -Nur blcr-0.8.5/vmadump4/vmadump_ppc.c blcr-0.8.6_b4/vmadump4/vmadump_ppc.c
1822 --- blcr-0.8.5/vmadump4/vmadump_ppc.c 2012-12-22 08:42:52.000000000 +0100
1823 +++ blcr-0.8.6_b4/vmadump4/vmadump_ppc.c 2014-09-30 04:32:49.000000000 +0200
1825 * along with this program; if not, write to the Free Software
1826 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1828 - * $Id: vmadump_ppc.c,v 1.10.14.4 2012/12/22 07:42:52 phargrov Exp $
1829 + * $Id: vmadump_ppc.c,v 1.10.14.5 2014/09/30 02:32:49 phargrov Exp $
1831 * THIS VERSION MODIFIED FOR BLCR <http://ftg.lbl.gov/checkpoint>
1832 *-----------------------------------------------------------------------*/
1834 # include <asm/switch_to.h>
1837 +#if HAVE_THREAD_FP_STATE
1838 + #define thread_fp_save_area(_thread) \
1839 + ((_thread).fp_save_area ? (_thread).fp_save_area : &(_thread).fp_state)
1841 +#if HAVE_THREAD_VR_STATE
1842 + #define thread_vr_save_area(_thread) \
1843 + ((_thread).vr_save_area ? (_thread).vr_save_area : &(_thread).vr_state)
1846 long vmadump_store_cpu(cr_chkpt_proc_req_t *ctx, struct file *file,
1847 struct pt_regs *regs) {
1850 /* Floating point regs */
1851 if (regs->msr & MSR_FP)
1852 giveup_fpu(current);
1853 +#if HAVE_THREAD_FPR
1854 r = write_kern(ctx, file, ¤t->thread.fpr,
1855 sizeof(current->thread.fpr));
1856 if (r != sizeof(current->thread.fpr)) goto err;
1858 sizeof(current->thread.fpscr));
1859 if (r != sizeof(current->thread.fpscr)) goto err;
1861 +#elif HAVE_THREAD_FP_STATE
1862 + r = write_kern(ctx, file, thread_fp_save_area(current->thread),
1863 + sizeof(current->thread.fp_state));
1864 + if (r != sizeof(current->thread.fp_state)) goto err;
1867 + #error Unknown PPC floating point state
1870 #if HAVE_THREAD_VDSO_BASE
1871 /* unconditionally store the base of the VDSO library */
1873 /* XXX I really need to find out if this is right */
1874 if (regs->msr & MSR_VEC)
1875 giveup_altivec(current);
1876 + #if HAVE_THREAD_VR
1877 r = write_kern(ctx, file, ¤t->thread.vr,
1878 sizeof(current->thread.vr));
1879 if (r != sizeof(current->thread.vr)) goto err;
1881 sizeof(current->thread.vscr));
1882 if (r != sizeof(current->thread.vscr)) goto err;
1884 + #elif HAVE_THREAD_VR_STATE
1885 + r = write_kern(ctx, file, thread_vr_save_area(current->thread),
1886 + sizeof(current->thread.vr_state));
1887 + if (r != sizeof(current->thread.vr_state)) goto err;
1890 + #error Unknown PPC vector register state
1895 + /* TODO: VSX state */
1899 + /* TODO: SPE state */
1906 memcpy(regs, ®tmp, sizeof(regtmp));
1908 /* Floating point regs */
1909 +#if HAVE_THREAD_FPR
1910 r = read_kern(ctx, file, ¤t->thread.fpr,
1911 sizeof(current->thread.fpr));
1912 if (r != sizeof(current->thread.fpr)) goto bad_read;
1913 @@ -105,6 +142,11 @@
1914 r = read_kern(ctx, file, ¤t->thread.fpscr,
1915 sizeof(current->thread.fpscr));
1916 if (r != sizeof(current->thread.fpscr)) goto bad_read;
1917 +#elif HAVE_THREAD_FP_STATE
1918 + r = read_kern(ctx, file, thread_fp_save_area(current->thread),
1919 + sizeof(current->thread.fp_state));
1920 + if (r != sizeof(current->thread.fp_state)) goto bad_read;
1923 #if HAVE_THREAD_VDSO_BASE
1924 /* unconditonally restore this */
1927 #ifdef CONFIG_ALTIVEC
1928 /* Restore Altivec */
1929 + #if HAVE_THREAD_VR
1930 r = read_kern(ctx, file, ¤t->thread.vr,
1931 sizeof(current->thread.vr));
1932 if (r != sizeof(current->thread.vr)) goto bad_read;
1933 @@ -122,6 +165,19 @@
1934 r = read_kern(ctx, file, ¤t->thread.vscr,
1935 sizeof(current->thread.vscr));
1936 if (r != sizeof(current->thread.vscr)) goto bad_read;
1937 + #elif HAVE_THREAD_VR_STATE
1938 + r = read_kern(ctx, file, thread_vr_save_area(current->thread),
1939 + sizeof(current->thread.vr_state));
1940 + if (r != sizeof(current->thread.vr_state)) goto bad_read;
1945 + /* TODO: VSX state */
1949 + /* TODO: SPE state */
1952 current->thread.regs = regs;
1953 diff -Nur blcr-0.8.5/vmadump4/vmadump_x86_64.c blcr-0.8.6_b4/vmadump4/vmadump_x86_64.c
1954 --- blcr-0.8.5/vmadump4/vmadump_x86_64.c 2013-01-08 08:23:50.000000000 +0100
1955 +++ blcr-0.8.6_b4/vmadump4/vmadump_x86_64.c 2014-09-19 01:46:11.000000000 +0200
1957 * along with this program; if not, write to the Free Software
1958 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1960 - * $Id: vmadump_x86_64.c,v 1.50.8.8 2013/01/08 07:23:50 phargrov Exp $
1961 + * $Id: vmadump_x86_64.c,v 1.50.8.9 2014/09/18 23:46:11 phargrov Exp $
1963 * THIS VERSION MODIFIED FOR BLCR <http://ftg.lbl.gov/checkpoint>
1964 *-----------------------------------------------------------------------*/
1967 unsigned long vdso_base = (unsigned long) vmad_vdso_base;
1969 + if (vmad_is_vvar_map((struct vm_area_struct *)map)) return 1;
1971 #if HAVE_MM_CONTEXT_VDSO && defined(VSYSCALL32_BASE)
1972 /* Some RHEL5 kernels use fix the VSYSCALL32_BASE for 32-bit tasks and
1973 * current->mm->context.vdso for 64-bit tasks. Since we need to
1978 + if (vmad_is_vvar_map(map)) return 0;
1980 if (vmad_is_arch_map(map)) {
1981 /* Just write out a section header */
1982 struct vmadump_vma_header head;
1983 @@ -409,6 +413,10 @@
1984 if (test_thread_flag(TIF_IA32)) {
1985 r = syscall32_setup_pages(NULL, 0);
1987 + #elif defined(CR_KCODE_compat_arch_setup_additional_pages)
1988 + if (test_thread_flag(TIF_IA32)) {
1989 + r = compat_arch_setup_additional_pages(NULL, 0);
1993 #if HAVE_2_ARG_ARCH_SETUP_ADDITIONAL_PAGES
1994 @@ -441,6 +449,15 @@
1997 } else if (vmad_vdso_base != (void *)head->start) {
1998 + #if HAVE_VM_OPS_NAME
1999 + /* Relocate vvar map if present immediately above or below vdso */
2000 + r = vmad_reloc_vvar(ctx, (unsigned long)vmad_vdso_base, head);
2002 + CR_ERR_CTX(ctx, "vvar remap failed %d", (int)r);
2007 r = vmad_remap(ctx, (unsigned long)vmad_vdso_base, head->start, head->end - head->start);
2009 CR_ERR_CTX(ctx, "vdso remap failed %d", (int)r);
2010 diff -Nur blcr-0.8.5/vmadump4/vmadump_x86.h blcr-0.8.6_b4/vmadump4/vmadump_x86.h
2011 --- blcr-0.8.5/vmadump4/vmadump_x86.h 2012-12-18 19:32:09.000000000 +0100
2012 +++ blcr-0.8.6_b4/vmadump4/vmadump_x86.h 2014-09-19 01:46:11.000000000 +0200
2014 * along with this program; if not, write to the Free Software
2015 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2017 - * $Id: vmadump_x86.h,v 1.9.8.3 2012/12/18 18:32:09 phargrov Exp $
2018 + * $Id: vmadump_x86.h,v 1.9.8.4 2014/09/18 23:46:11 phargrov Exp $
2020 * THIS FILE ADDED FOR BLCR <http://ftg.lbl.gov/checkpoint>
2021 *-----------------------------------------------------------------------*/
2022 @@ -287,4 +287,40 @@
2027 +#if VMAD_HAVE_ARCH_MAPS
2028 + #if HAVE_VM_OPS_NAME
2029 + #define vmad_is_vvar_map(map) \
2030 + ((map)->vm_ops && (map)->vm_ops->name && !strcmp("[vvar]", (map)->vm_ops->name(map)))
2032 + /* Relocate vvar map if present immediately above or below vdso */
2033 + static long vmad_reloc_vvar(cr_rstrt_proc_req_t *ctx,
2034 + unsigned long vdso_start,
2035 + struct vmadump_vma_header *vdso_head)
2038 + unsigned long vvar_start = 0;
2039 + unsigned long vdso_end = vdso_start + (vdso_head->end - vdso_head->start);
2040 + struct vm_area_struct *map;
2042 + if ((NULL != (map = find_vma(current->mm, vdso_end))) &&
2043 + (map->vm_start == vdso_end)) {
2044 + vvar_start = vdso_head->end;
2046 + if ((NULL != (map = find_vma(current->mm, vdso_start - PAGE_SIZE))) &&
2047 + (map->vm_end == vdso_start)) {
2048 + vvar_start = vdso_head->start - (map->vm_end - map->vm_start);
2051 + if (vvar_start && vmad_is_vvar_map(map)) {
2052 + r = vmad_remap(ctx, map->vm_start, vvar_start, map->vm_end - map->vm_start);
2058 + #define vmad_is_vvar_map(map) 0
2062 #endif /* _VMADUMP_X86_H */