From owner-svn-soc-all@FreeBSD.ORG Wed Jul 23 13:06:32 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3413446 for ; Wed, 23 Jul 2014 13:06:32 +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 BED9428DF for ; Wed, 23 Jul 2014 13:06:32 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6ND6WPh068246 for ; Wed, 23 Jul 2014 13:06:32 GMT (envelope-from op@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.8/8.14.8/Submit) id s6ND6WCe068244 for svn-soc-all@FreeBSD.org; Wed, 23 Jul 2014 13:06:32 GMT (envelope-from op@FreeBSD.org) Date: Wed, 23 Jul 2014 13:06:32 GMT Message-Id: <201407231306.s6ND6WCe068244@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: r271271 - soc2014/op/freebsd-base/sys/x86/include 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 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: Wed, 23 Jul 2014 13:06:33 -0000 Author: op Date: Wed Jul 23 13:06:31 2014 New Revision: 271271 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=271271 Log: KSP: updated selfpatches Signed-off-by: Oliver Pinter git: https://github.com/opntr/opBSD/tree/op/gsoc2014/kpatch Modified: soc2014/op/freebsd-base/sys/x86/include/selfpatch-asmacros.h Modified: soc2014/op/freebsd-base/sys/x86/include/selfpatch-asmacros.h ============================================================================== --- soc2014/op/freebsd-base/sys/x86/include/selfpatch-asmacros.h Wed Jul 23 13:06:21 2014 (r271270) +++ soc2014/op/freebsd-base/sys/x86/include/selfpatch-asmacros.h Wed Jul 23 13:06:31 2014 (r271271) @@ -63,68 +63,73 @@ #define KSP_INSTR_NOP9 KSP_INSTR_INTEL_NOP9 #define KSP_INSTR_XSAVE_XSAVEOPT(_ARG) \ - "0723:" \ - " xsave " _ARG " ; " \ - "0724: " \ - " .pushsection set_selfpatch_patch_set, \"ax\" ; " \ - "0725: " \ - " xsaveopt " _ARG " ;" \ - "0726: " \ - " .popsection " \ - " .pushsection set_selfpatch_set, \"a\" ; " \ - " .quad 0723b ; " \ - " .quad 0725b ; " \ - " .int 0724b-0723b ; " \ - " .int 0726b-0725b ; " \ - " .int " KSP_CPUID2 " ; " \ - " .int " CPUID2_OSXSAVE " ; " \ - " .quad 0 ; " \ - " .popsection ; " - -#define _xsave_xsaveopt(_ARG) KSP_INSTR_XSAVE_XSAVEOPT(_ARG) - + 0723: \ + xsave _ARG ; \ + 0724: \ + .pushsection set_selfpatch_patch_set, "ax" ; \ + 0725: \ + xsaveopt _ARG ; \ + 0726: \ + .popsection \ + .pushsection set_selfpatch_set, "a" ; \ + .quad 0723b ; \ + .quad 0725b ; \ + .int 0724b-0723b ; \ + .int 0726b-0725b ; \ + .int KSP_CPUID2 ; \ + .int CPUID2_OSXSAVE ; \ + .quad 0 ; \ + .popsection ; + +#ifndef _xsave_xsaveopt +#define _xsave_xsaveopt(_ARG) KSP_INSTR_XSAVE_XSAVEOPT(_ARG) +#endif #define KSP_INSTR_NOP3_CLAC \ - "0723:" \ - " " KSP_INSTR_NOP3 " ; " \ - "0724: " \ - " .pushsection set_selfpatch_patch_set, \"ax\" ; " \ - "0725: " \ - " clac " ;" \ - "0726: " \ - " .popsection " \ - " .pushsection set_selfpatch_set, \"a\" ; " \ - " .quad 0723b ; " \ - " .quad 0725b ; " \ - " .int 0724b-0723b ; " \ - " .int 0726b-0725b ; " \ - " .int " KSP_CPUID_STDEXT " ; " \ - " .int " CPUID_STDEXT_SMAP " ; " \ - " .quad 0 ; " \ - " .popsection ; " + 0723: \ + KSP_INSTR_NOP3 ; \ + 0724: \ + .pushsection set_selfpatch_patch_set, "ax" ; \ + 0725: \ + clac ; \ + 0726: \ + .popsection \ + .pushsection set_selfpatch_set, "a" ; \ + .quad 0723b ; \ + .quad 0725b ; \ + .int 0724b-0723b ; \ + .int 0726b-0725b ; \ + .int KSP_CPUID_STDEXT ; \ + .int CPUID_STDEXT_SMAP ; \ + .quad 0 ; \ + .popsection ; +#ifndef _clac #define _clac KSP_INSTR_NOP3_CLAC +#endif #define KSP_INSTR_NOP3_STAC \ - "0723:" \ - " " KSP_INSTR_NOP3 " ; " \ - "0724: " \ - " .pushsection set_selfpatch_patch_set, \"ax\" ; " \ - "0725: " \ - " stac " ;" \ - "0726: " \ - " .popsection " \ - " .pushsection set_selfpatch_set, \"a\" ; " \ - " .quad 0723b ; " \ - " .quad 0725b ; " \ - " .int 0724b-0723b ; " \ - " .int 0726b-0725b ; " \ - " .int " KSP_CPUID_STDEXT " ; " \ - " .int " CPUID_STDEXT_SMAP " ; " \ - " .quad 0 ; " \ - " .popsection ; " + 0723: \ + KSP_INSTR_NOP3 ; \ + 0724: \ + .pushsection set_selfpatch_patch_set, "ax" ; \ + 0725: \ + stac ; \ + 0726: \ + .popsection \ + .pushsection set_selfpatch_set, "a" ; \ + .quad 0723b ; \ + .quad 0725b ; \ + .int 0724b-0723b ; \ + .int 0726b-0725b ; \ + .int KSP_CPUID_STDEXT ; \ + .int CPUID_STDEXT_SMAP ; \ + .quad 0 ; \ + .popsection ; +#ifndef _stac #define _stac KSP_INSTR_NOP3_STAC +#endif #endif /* __X86_SELFPATCH_ASMACROS_H__ */