socsvn commit: r271090 - soc2014/op/freebsd-base/sys/kern

op at FreeBSD.org op at FreeBSD.org
Fri Jul 18 16:10:38 UTC 2014


Author: op
Date: Fri Jul 18 16:10:37 2014
New Revision: 271090
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=271090

Log:
  KSP: disallow inlining of lf_selfpatch_selftest, and change test bytes
  
  Signed-off-by: Oliver Pinter <oliver.pntr at gmail.com>
  
  git: https://github.com/opntr/opBSD/tree/op/gsoc2014/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	Fri Jul 18 16:10:15 2014	(r271089)
+++ soc2014/op/freebsd-base/sys/kern/kern_selfpatch.c	Fri Jul 18 16:10:37 2014	(r271090)
@@ -60,7 +60,7 @@
 SYSCTL_INT(_debug, OID_AUTO, selfpatch_debug, CTLFLAG_RWTUN,
     &selfpatch_debug, 0, "Set various levels of selfpatch debug");
 
-void lf_selfpatch_selftest(void);
+__noinline void lf_selfpatch_selftest(void);
 
 bool
 lf_selfpatch_patch_needed(struct lf_selfpatch *p)
@@ -211,12 +211,12 @@
 }
 
 
-void
+__noinline void
 lf_selfpatch_selftest(void)
 {
 	__asm __volatile(
 	"1:"
-	"	.byte 0xde,0xad,0xde,0xad ; "
+	"	ud2; ud2; ; "
 	"2:	"
 	"	.pushsection set_selfpatch_patch_set, \"ax\" ;  "
 	"3:	"


More information about the svn-soc-all mailing list