Commit Graph

12272 Commits

Author SHA1 Message Date
Daniel Pouzzner
7c2aefcfdd linuxkm: enable the rest of the _asm implementations for x86, wrapped in {SAVE,RESTORE}_VECTOR_REGISTERS(). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
331fe47eb6 linuxkm: add ASFLAGS_FPU_DISABLE_SIMD_ENABLE ASFLAGS_FPU_ENABLE_SIMD_DISABLE ASFLAGS_FPUSIMD_DISABLE ASFLAGS_FPUSIMD_ENABLE to facilitate erroring for unexpected fp/simd instructions in Kbuild, while allowing expected ones. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
96fe6dc049 test.h: fix math in final "stack used" message when -DHAVE_STACK_SIZE_VERBOSE. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
60a686f48c tidying suggested by Sean in review. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
a9cad51b65 sp_mod_word(): add unoptimized alternative if -U__GNUC__. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
c8cd042bdd configure.ac: for linuxkm, make --enable-sp-math the default, and add additional exclusions --enable-fastrsa and --with-libz. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
5f972d2ae6 test.c: now that sp math is fixed and working in linuxkm, reenable prime_test() for WOLFSSL_LINUXKM, and add a small stack refactor for it. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
fdbd6addd0 sp_int.c: add sp_mod_word() gated on WOLFSSL_SP_MOD_WORD_RP for runtimes lacking intrinsic support for int128 % int64; for linuxkm, use WOLFSSL_SP_DIV_WORD_HALF and the new WOLFSSL_SP_MOD_WORD_RP. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
8f130f3642 test.c: tweaks to accommodate clang's belligerent -Wparentheses-equality. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
447a238e8e test.c: missed a _SMALL_STACK spot in rsa_ecc_certgen_test(). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
5bfb5a3a83 test.c: fix missed spot in rsa_certgen_test(), and do another _SMALL_STACK refactor of a missed object in rsa_ecc_certgen_test(). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
fdf87fe152 test.c: another missed spot. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
ebca451c93 test.c: missed a spot -- inadvertently unused return value. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
99501ffefd m4/ax_linuxkm.m4: use test "$var" = "" construct, not test -z "$var", for maximal portability. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
43c12ede50 ge448_double_scalarmult_vartime(): streamline WOLFSSL_SMALL_STACK refactor. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
80961ea913 test.c:ecc_decode_test(): WOLFSSL_SMALL_STACK refactor 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
5801719ac3 wolfcrypt/src/asn.c:wc_GetKeyOID(): stack->heap refactor. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
dbe0273bf4 test.c: additional WOLFSSL_SMALL_STACK refactoring, covering --enable-sp-math and various missed spots. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
4f5bbbdca8 rsa.c:wc_CheckProbablePrime(): WOLFSSL_SMALL_STACK refactor 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
af6bd1d163 configure.ac: tidying linuxkm reqs/exclusions tests at end. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
16267a1889 configure.ac: error when ENABLED_LINUXKM but $KERNEL_ARCH is empty (no default, no user value). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
cd88a2c7df wolfcrypt/test/test.c: when WOLFSSL_LINUXKM, don't do the large-malloc-incurring wc_scrypt()s in scrypt_test(). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
76cba38971 wolfcrypt/src/ge_448.c: redo small stack refactor of ge448_double_scalarmult_vartime(), so that when -UWOLFSSL_SMALL_STACK, code is effectively unchanged. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
f4981d4c91 linuxkm/module_exports.c.template: include openssl compat layer headers in case user configuration needs them. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
8331079c36 configure.ac: --enable-compkey gates in the recursive do_mp_jacobi(). mutex with --enable-linuxkm. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
dc4b15a265 test.c: fix gating on heap deallocation in hc128_test() to match earlier tweak to gating on allocation. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
b52d50d903 test.c: various improvements and fixes pursuant to dgarske's comments on PR #3244 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
a80b0c1982 test.c: don't exclude prime_test when -DOLD_PRIME_CHECK, but to exclude it when -DWOLFSSL_LINUXKM. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
170322956b wolfssl/test.h: polish implementation of HAVE_STACK_SIZE_VERBOSE, now enabled with --enable-stacksize-verbose; internal symbol renamed from original DEBUG_STACK_SIZE_VERBOSE, helper functions and macros refactored to be formally threadsafe and to track the overall high water mark (reports same "stack used" value as --enable-stacksize after final return); add "setting stack relative offset reference mark in funcname() to x" message at entry; add configure mutexing of --enable-stacksize[-verbose] relative to --enable-linuxkm. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
63e3eae416 src/wolfio.c: update patch to wolfIO_HttpProcessResponse() (PR #3204). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
b99908ae66 configure.ac: refactor test -z "${KERNEL_ROOT}" into "${KERNEL_ROOT}" = "", and remove new AM_CFLAGS="$AM_CFLAGS -msse4" (bringing back identical to logic in master) now that $CFLAGS_SIMD_ENABLE et al take care of it. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
d033b1fe24 m4/ax_linuxkm.m4: add autosensing of -msse4. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
5589565051 linuxkm: add autotools detection of usable compiler flags for enabling and disabling SIMD and fp registers and auto-vectorization, and integrate into linuxkm makefiles. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
5d1bea4ff7 linuxkm/Makefile: rename KERNEL_OPT to KERNEL_EXTRA_CFLAGS. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
767f1972e3 aes.{c,h}: move SIMD includes from aes.h to aes.c, to avoid compiler errors on other .c's compiled -mno-sse for linuxkm. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
5504d9cd4e linuxkm: dial in SIMD options in Kbuild; add boilerplate at the top of all files added for linuxkm. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
4f38fb2f78 linuxkm/Kbuild: gate EXPORT_SYMBOL(wolfcrypt_test) on -UNO_CRYPT_TEST. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
cd14cfb092 linuxkm: override-disable SIMD instructions for all .c.o's, with exceptions enumerated in Kbuild (currently only aes.c), and couple -msse with -fno-builtin-functions; export ENABLED_ASM for use as a pivot in Kbuild; use asm/i387.h, not asm/simd.h, for kernel_fpu_{begin,end}() protos. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
3626332334 wolfcrypt/src/aes.c for linuxkm: add missing vector register push/pops. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
87b2384cac linuxkm settings.h: define NO_STDIO_FILESYSTEM 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
69052ff535 linuxkm: explanatory message and error exit on attempted make install. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
e881d92366 add linuxkm/module_exports.c.template to linuxkm/include.am $EXTRA_DIST. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
05bca8b0ee when BUILD_LINUXKM, suppress building the library; rename $KROOT/$KARCH to $KERNEL_ROOT/$KERNEL_ARCH; remove SIMD enablement from linuxkm CFLAGS; add linuxkm support for -DKERNEL_OPT=x. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
360c749703 add {SAVE,RESTORE}_VECTOR_REGISTERS() macros for kernel_fpu_{begin,end} when WOLFSSL_LINUXKM, to allow safe use of AESNI and SIMD instructions in the kernel. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
2c564a7728 update .gitignore with more artifacts from linuxkm build. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
9549a5f973 linuxkm: add linuxkm/module_exports.c.template, and autogenerate linuxkm/module_exports.c. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
e8b69f8a6a dh_test(): fix missing casts for XMALLOC(). 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
7bc33f4ec1 linuxkm: retain noinline from kernel headers, and use it directly in wolfssl/wolfcrypt/sp.h. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
9aa3a4c559 linuxkm/Kbuild: make dependency on get_thread_size order-only, to suppress frivolous rebuilds on kernel 4.x. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
f440089e92 dh_test(): fix typo (undersized dynamic buffers). 2020-09-23 18:32:16 -05:00