From owner-freebsd-bugs@FreeBSD.ORG Fri Sep 7 18:50:12 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF2CB106566C for ; Fri, 7 Sep 2012 18:50:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A843A8FC12 for ; Fri, 7 Sep 2012 18:50:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q87IoCRW006831 for ; Fri, 7 Sep 2012 18:50:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q87IoCIc006822; Fri, 7 Sep 2012 18:50:12 GMT (envelope-from gnats) Date: Fri, 7 Sep 2012 18:50:12 GMT Message-Id: <201209071850.q87IoCIc006822@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Shane Nievera Tablizo Cc: Subject: kern/170200: [crypto] [patch] AES-NI XTS mode performance lower than CBC revised patch X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Shane Nievera Tablizo List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 18:50:12 -0000 The following reply was made to PR kern/170200; it has been noted by GNATS. From: Shane Nievera Tablizo To: bug-followup@FreeBSD.org Cc: Subject: kern/170200: [crypto] [patch] AES-NI XTS mode performance lower than CBC revised patch Date: Fri, 07 Sep 2012 12:40:48 -0600 This is a multi-part message in MIME format. --_----------=_1347043248118301 Content-Transfer-Encoding: 7bit Content-Type: text/plain This update removes the perl/openssl dependencies. The c implementation is a drop-in replacement for the existing assembly code. It captures most of the performance of the openssl module, and I still have a few optimizations to try. amd64 only until I get clang to cross compile the module. gcc4.2 lacks the opcodes for the new instructions, but it will compile with gcc47 from ports. The module will compile with -mavx and improves performance in user-space. Shane Nievera Tablizo nievera@mm.st --_----------=_1347043248118301 Content-Disposition: attachment; filename="patchv2.txt" Content-Id: <1347042863.10252.fae6270cf6c45bc6aa9d45c129ec3636611c6b50@messagingengine.com> Content-Transfer-Encoding: base64 Content-Type: text/plain; name="patchv2.txt" SW5kZXg6IGNvbmYvZmlsZXMuYW1kNjQKPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PQotLS0gY29uZi9maWxlcy5hbWQ2NAkocmV2aXNpb24gMjQwMTI3KQorKysg Y29uZi9maWxlcy5hbWQ2NAkod29ya2luZyBjb3B5KQpAQCAtOTMsNiArOTMs MTEgQEAKIAluby1vYmogbm8taW1wbGljaXQtcnVsZQliZWZvcmUtZGVwZW5k CQkJCVwKIAljbGVhbgkJImFjcGlfd2FrZWRhdGEuaCIKICMKK2Flc19lbmNk ZWMubwkJCW9wdGlvbmFsCWFlc25pCQkJXAorCWRlcGVuZGVuY3kJIiRTL2Ny eXB0by9hZXNuaS9hZXNfZW5jZGVjLmMiCQkJXAorCWNvbXBpbGUtd2l0aAki Y2xhbmcgJHtDRkxBR1M6Ti1tbm8tc3NlfSAtbXNzZSAtYyAkey5JTVBTUkN9 IglcCisJbm8taW1wbGljaXQtcnVsZSBjbGVhbiAiYWVzX2VuY2RlYy5vIgor IwogYW1kNjQvYW1kNjQvYW1kNjRfbWVtLmMJCW9wdGlvbmFsCW1lbQogI2Ft ZDY0L2FtZDY0L2FwaWNfdmVjdG9yLlMJc3RhbmRhcmQKIGFtZDY0L2FtZDY0 L2F0b21pYy5jCQlzdGFuZGFyZApAQCAtMTMxLDcgKzEzNiw3IEBACiBhbWQ2 NC9hbWQ2NC92bV9tYWNoZGVwLmMJc3RhbmRhcmQKIGFtZDY0L3BjaS9w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CkKKwkJCQlicmVhazsKKwkJCWluaXRfdHdlYWtzKHQs IDYpOworCQl9CisKKwl9CisJaWYgKG4gJSAyID09IDEpIHsKKwkJKmRzdCsr ID0gKnQgXiBDUllQVCgqdCBeICpzcmMrKyk7CisJCSp0ID0gR0YxMjhfc2hs KCp0KTsKKwkJLS1uOworCX0KKwlzd2l0Y2ggKG4gJT0gNikgeworCWNhc2Ug MjoKKwkJbiA9IDI7CisJCWluaXRfdHdlYWtzKHQsIG4pOworCQlsbGVsX2Ny eXB0KGRpciwgcm91bmRzLCBzY2hlZCwgZCwgdCwgJnNyYywgbik7CisJCW91 dF94b3IoZCwgdCwgJmRzdCwgbik7CisJCWJyZWFrOworCWNhc2UgNDoKKwkJ biA9IDQ7CisJCWluaXRfdHdlYWtzKHQsIG4pOworCQlsbGVsX2NyeXB0KGRp ciwgcm91bmRzLCBzY2hlZCwgZCwgdCwgJnNyYywgbik7CisJCW91dF94b3Io ZCwgdCwgJmRzdCwgbik7CisJCWJyZWFrOworCX0KK30KKwordm9pZAorYWVz bmlfZW5jKGludCByb3VuZHMsIGNvbnN0IHVpbnQ4X3QgKnJlc3RyaWN0IHNj aGVkLCBjb25zdCB1aW50OF90ICpzcmMsCisgICAgdWludDhfdCAqZHN0LCBj b25zdCB1aW50OF90ICpyZXN0cmljdCBpdikKK3sKKworCSooZHF1YWQqKWRz dCA9IGVuY2RlYygxLCByb3VuZHMsIChkcXVhZCopc2NoZWQsIGl2ID09IE5V TEwgPworCQkJCSooZHF1YWQqKXNyYyA6ICooZHF1YWQqKXNyYyBeIG1vdmRx dShpdikpOworfQorCit2b2lkCithZXNuaV9kZWMoaW50IHJvdW5kcywgY29u c3QgdWludDhfdCAqcmVzdHJpY3Qgc2NoZWQsIGNvbnN0IHVpbnQ4X3QgKnNy YywKKyAgICB1aW50OF90ICpkc3QsIGNvbnN0IHVpbnQ4X3QgKnJlc3RyaWN0 IGl2KQoreworCisJKihkcXVhZCopZHN0ID0gZW5jZGVjKDAsIH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FTiwKKwkJ CQkoZHF1YWQqKWRhdCwgaXYpKQorfQorCisjZGVmaW5lIENSWVBUX1hFWF9Y NihkaXIpCShcCisJCWNyeXB0X3hleF9YNigoZGlyKSwgcm91bmRzLCBzY2hl ZCwgbGVuIC8gQUVTX0JMT0NLX0xFTiwJXAorCQkJKGRxdWFkKilzcmMsIChk cXVhZCopZHN0LAkJCVwKKwkJCWVuY2RlYygxLCByb3VuZHMsIHhzY2hlZCwg bW92ZHF1KGl2cCkpKQkJXAorCQkpCit2b2lkCithZXNuaV9lbmNyeXB0X3h0 cyhpbnQgcm91bmRzLCBjb25zdCB2b2lkICpyZXN0cmljdCBzY2hlZCwKKyAg ICBjb25zdCB2b2lkICpyZXN0cmljdCB4c2NoZWQsIHNpemVfdCBsZW4sIGNv bnN0IHVpbnQ4X3QgKnNyYywgdWludDhfdCAqZHN0LAorICAgIGNvbnN0IHVp bnQ4X3QgKnJlc3RyaWN0IGl2cCkKK3sKKworCVNXX1JPVU5EUyhyb3VuZHMs IENSWVBUX1hFWF9YNigxKSkKK30KKwordm9pZAorYWVzbmlfZGVjcnlwdF94 dHMoaW50IHJvdW5kcywgY29uc3Qgdm9pZCAqcmVzdHJpY3Qgc2NoZWQsCisg ICAgY29uc3Qgdm9pZCAqcmVzdHJpY3QgeHNjaGVkLCBzaXplX3QgbGVuLCBj b25zdCB1aW50OF90ICpzcmMsIHVpbnQ4X3QgKmRzdCwKKyAgICBjb25zdCB1 aW50OF90ICpyZXN0cmljdCBpdnApCit7CisKKwlTV19ST1VORFMocm91bmRz LCBDUllQVF9YRVhfWDYoMCkpCit9CisKSW5kZXg6IGNyeXB0by9hZXNuaS9h ZXNuaV93cmFwLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gY3J5cHRv L2Flc25pL2Flc25pX3dyYXAuYwkocmV2aXNpb24gMjQwMTI3KQorKysgY3J5 cHRvL2Flc25pL2Flc25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