Reapply, with minor tweaks, r338025, from the original commit:Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INF
Reapply, with minor tweaks, r338025, from the original commit:Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INFO macro entirely. The 'table' parameter is now required tohave correct pointer (or array) type. Since all invocations of the macroalready had this property and the emitted PNP data continues to include theelement size, there is no functional change.Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci(Note that coccinelle invokes diff(1) via a PATH search and expects diff totolerate the -B flag, which BSD diff does not. So I had to link gdiff intoPATH as diff to use spatch.)Tinderbox'd (-DMAKE_JUST_KERNELS).Approved by: re (glen)
show more ...
Don't load ccp automatically with devmatchRemove the PNP info for the moment from the driver. It's anexperimental driver (as noted in r328150). It's performance is about1/10th that of aesni. It w
Don't load ccp automatically with devmatchRemove the PNP info for the moment from the driver. It's anexperimental driver (as noted in r328150). It's performance is about1/10th that of aesni. It will often panic when used with GELI (PR2279820). It's not in our best interest to have such a driver beautoloaded by default.Approved by: re@ (rgrimes)Reviewed By: cem@Differential Review: https://reviews.freebsd.org/D16959
Back out r338035 until Warner is finished churning GSoC PNP patchesI was not aware Warner was making or planning to make forward progress inthis area and have since been informed of that.It's ea
Back out r338035 until Warner is finished churning GSoC PNP patchesI was not aware Warner was making or planning to make forward progress inthis area and have since been informed of that.It's easy to apply/reapply when churn dies down.
Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INFO macro entirely. The 'table' parameter is now required tohave
Remove unused and easy to misuse PNP macro parameterInspired by r338025, just remove the element size parameter to theMODULE_PNP_INFO macro entirely. The 'table' parameter is now required tohave correct pointer (or array) type. Since all invocations of the macroalready had this property and the emitted PNP data continues to include theelement size, there is no functional change.Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci(Note that coccinelle invokes diff(1) via a PATH search and expects diff totolerate the -B flag, which BSD diff does not. So I had to link gdiff intoPATH as diff to use spatch.)Tinderbox'd (-DMAKE_JUST_KERNELS).
OpenCrypto: Convert sessions to opaque handles instead of integersTrack session objects in the framework, and pass handles between theframework (OCF), consumers, and drivers. Avoid redundancy and
OpenCrypto: Convert sessions to opaque handles instead of integersTrack session objects in the framework, and pass handles between theframework (OCF), consumers, and drivers. Avoid redundancy and complexity inindividual drivers by allocating session memory in the framework andproviding it to drivers in ::newsession().Session handles are no longer integers with information encoded in varioushigh bits. Use of the CRYPTO_SESID2FOO() macros should be replaced with theappropriate crypto_ses2foo() function on the opaque session handle.Convert OCF drivers (in particular, cryptosoft, as well as myriad others) tothe opaque handle interface. Discard existing session tracking as much aspossible (quick pass). There may be additional code ripe for deletion.Convert OCF consumers (ipsec, geom_eli, krb5, cryptodev) to handle-styleinterface. The conversion is largely mechnical.The change is documented in crypto.9.Inspired byhttps://lists.freebsd.org/pipermail/freebsd-arch/2018-January/018835.html .No objection from: ae (ipsec portion)Reported by: jhb
Remove "HMAC" from <HASH>_HMAC_BLOCK_LEN macro namesThe block size is a property of the underlying hash algorithm, and hasnothing to do with the HMAC construction.No functional change.
The PNP info has to follow the module definition. Move it from justafter the array to its proper location. Otherwise, the linker.hintsfile has things out of order and we associated it with whatever
The PNP info has to follow the module definition. Move it from justafter the array to its proper location. Otherwise, the linker.hintsfile has things out of order and we associated it with whatever wasthe previous module.
ccp(4): Store IV in output buffer in GCM software fallback when requestedApply r328361 to duplicate copy of ccr_gcm_soft in ccp(4).Properly honor the lack of the CRD_F_IV_PRESENT flag in the GCM
ccp(4): Store IV in output buffer in GCM software fallback when requestedApply r328361 to duplicate copy of ccr_gcm_soft in ccp(4).Properly honor the lack of the CRD_F_IV_PRESENT flag in the GCM softwarefallback case for encryption requests.
Add ccp(4): experimental driver for AMD Crypto Co-Processor* Registers TRNG source for random(4)* Finds available queues, LSBs; allocates static objects* Allocates a shared MSI-X for all queues.
Add ccp(4): experimental driver for AMD Crypto Co-Processor* Registers TRNG source for random(4)* Finds available queues, LSBs; allocates static objects* Allocates a shared MSI-X for all queues. The hardware does not have separate interrupts per queue. Working interrupt mode driver.* Computes SHA hashes, HMAC. Passes cryptotest.py, cryptocheck tests.* Does AES-CBC, CTR mode, and XTS. cryptotest.py and cryptocheck pass.* Support for "authenc" (AES + HMAC). (SHA1 seems to result in "unaligned" cleartext inputs from cryptocheck -- which the engine cannot handle. SHA2 seems to work fine.)* GCM passes for block-multiple AAD, input lengthsLargely based on ccr(4), part of cxgbe(4).Rough performance averages on AMD Ryzen 1950X (4kB buffer):aesni: SHA1: ~8300 Mb/s SHA256: ~8000 Mb/sccp: ~630 Mb/s SHA256: ~660 Mb/s SHA512: ~700 Mb/scryptosoft: ~1800 Mb/s SHA256: ~1800 Mb/s SHA512: ~2700 Mb/sAs you can see, performance is poor in comparison to aesni(4) and evencryptosoft (due to high setup cost). At a larger buffer size (128kB),throughput is a little better (but still worse than aesni(4)):aesni: SHA1:~10400 Mb/s SHA256: ~9950 Mb/sccp: ~2200 Mb/s SHA256: ~2600 Mb/s SHA512: ~3800 Mb/scryptosoft: ~1750 Mb/s SHA256: ~1800 Mb/s SHA512: ~2700 Mb/sAES performance has a similar story:aesni: 4kB: ~11250 Mb/s 128kB: ~11250 Mb/sccp: ~350 Mb/s 128kB: ~4600 Mb/scryptosoft: ~1750 Mb/s 128kB: ~1700 Mb/sThis driver is EXPERIMENTAL. You should verify cryptographic results ontypical and corner case inputs from your application against a known- goodimplementation.Sponsored by: Dell EMC IsilonDifferential Revision: https://reviews.freebsd.org/D12723