From owner-svn-soc-all@FreeBSD.ORG Thu Aug 14 09:09:08 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00C62E37 for ; Thu, 14 Aug 2014 09:09:07 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E200F285C for ; Thu, 14 Aug 2014 09:09:07 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7E997gK074193 for ; Thu, 14 Aug 2014 09:09:07 GMT (envelope-from op@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id s7E997AN074191 for svn-soc-all@FreeBSD.org; Thu, 14 Aug 2014 09:09:07 GMT (envelope-from op@FreeBSD.org) Date: Thu, 14 Aug 2014 09:09:07 GMT Message-Id: <201408140909.s7E997AN074191@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to op@FreeBSD.org using -f From: op@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r272395 - soc2014/op/freebsd-base/sys/kern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Aug 2014 09:09:08 -0000 Author: op Date: Thu Aug 14 09:09:07 2014 New Revision: 272395 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272395 Log: KSP: added critical_{enter,exit} to lf_selfpatch Signed-off-by: Oliver Pinter git: https://github.com/opntr/opBSD/tree/op/gsoc2014/smap+kpatch Modified: soc2014/op/freebsd-base/sys/kern/kern_selfpatch.c Modified: soc2014/op/freebsd-base/sys/kern/kern_selfpatch.c ============================================================================== --- soc2014/op/freebsd-base/sys/kern/kern_selfpatch.c Thu Aug 14 08:42:16 2014 (r272394) +++ soc2014/op/freebsd-base/sys/kern/kern_selfpatch.c Thu Aug 14 09:09:07 2014 (r272395) @@ -134,6 +134,8 @@ count = stop - start; DBG("count: %d\n", count); + critical_enter(); + for (patch = start; patch != stop; patch++) { DBG("apply: %p\n", patch); ret = lf_selfpatch_apply(lf, patch, mod); @@ -141,6 +143,8 @@ return (ret); } + critical_exit(); + #ifdef KSP_DEBUG /* * when selfpatch does not works, the system should crash