Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Oct 2015 16:03:08 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289593 - head/sys/ofed/include/linux
Message-ID:  <201510191603.t9JG38Ub047012@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Oct 19 16:03:08 2015
New Revision: 289593
URL: https://svnweb.freebsd.org/changeset/base/289593

Log:
  The returned value from vm_fault_disable_pagefaults() must be stored
  and passed to vm_fault_enable_pagefaults(). Else possible recursion on
  the state can be lost.
  
  Sponsored by:	Mellanox Technologies
  Suggested by:	kib @

Modified:
  head/sys/ofed/include/linux/uaccess.h

Modified: head/sys/ofed/include/linux/uaccess.h
==============================================================================
--- head/sys/ofed/include/linux/uaccess.h	Mon Oct 19 15:56:59 2015	(r289592)
+++ head/sys/ofed/include/linux/uaccess.h	Mon Oct 19 16:03:08 2015	(r289593)
@@ -30,17 +30,26 @@
 #ifndef	_LINUX_UACCESS_H_
 #define	_LINUX_UACCESS_H_
 
+#include <linux/compiler.h>
+
 #define	get_user(_x, _p)	-copyin((_p), &(_x), sizeof(*(_p)))
 #define	put_user(_x, _p)	-copyout(&(_x), (_p), sizeof(*(_p)))
 
-static inline void pagefault_disable(void)
+/*
+ * NOTE: The returned value from pagefault_disable() must be stored
+ * and passed to pagefault_enable(). Else possible recursion on the
+ * state can be lost.
+ */
+static inline int __must_check
+pagefault_disable(void)
 {
-	curthread_pflags_set(TDP_NOFAULTING | TDP_RESETSPUR);
+	return (vm_fault_disable_pagefaults());
 }
 
-static inline void pagefault_enable(void)
+static inline void
+pagefault_enable(int save)
 {
-	curthread_pflags_restore(~(TDP_NOFAULTING | TDP_RESETSPUR));
+	vm_fault_enable_pagefaults(save);
 }
 
 #endif	/* _LINUX_UACCESS_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510191603.t9JG38Ub047012>