From owner-svn-src-all@freebsd.org Mon Oct 19 16:03:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9524A19E68; Mon, 19 Oct 2015 16:03:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2ED18CA; Mon, 19 Oct 2015 16:03:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9JG38EA047013; Mon, 19 Oct 2015 16:03:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9JG38Ub047012; Mon, 19 Oct 2015 16:03:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510191603.t9JG38Ub047012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Oct 2015 16:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289593 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2015 16:03:09 -0000 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 + #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_ */