Date: Wed, 23 Jul 2014 13:06:32 GMT From: op@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r271271 - soc2014/op/freebsd-base/sys/x86/include Message-ID: <201407231306.s6ND6WCe068244@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <oliver.pntr@gmail.com> 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__ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407231306.s6ND6WCe068244>