From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0077.outbound.protection.outlook.com [104.47.41.77]) by dpdk.org (Postfix) with ESMTP id 256315584 for ; Tue, 6 Dec 2016 18:35:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TzKUO0j7E4SYeYvtsqH1oghyUfbSjN+aaRZq8YLnB0g=; b=nUcMWSFlA7F2KdoEp8o68ueXxMMtYesT3+782daDRx95C/t5lgVxV5wXWf/H6IawjbGtT31RRJdVc21jko0swI7p623wnWVLIsyFM7ruIF93BVhDCZ8BJrFpJYqVGYE1BtXrvnsWuiJVerMGBlwj7zbJx5L887k0PF1CzJwzWzI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Zbigniew.Bodek@cavium.com; Received: from localhost.localdomain (31.172.191.173) by BLUPR07MB547.namprd07.prod.outlook.com (10.141.205.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9; Tue, 6 Dec 2016 17:35:26 +0000 From: To: , CC: , Zbigniew Bodek Date: Tue, 6 Dec 2016 18:33:00 -0800 Message-ID: <1481077985-4224-8-git-send-email-zbigniew.bodek@caviumnetworks.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481077985-4224-1-git-send-email-zbigniew.bodek@caviumnetworks.com> References: <1480851219-45071-1-git-send-email-zbigniew.bodek@caviumnetworks.com> <1481077985-4224-1-git-send-email-zbigniew.bodek@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: VI1PR01CA0023.eurprd01.prod.exchangelabs.com (10.162.116.33) To BLUPR07MB547.namprd07.prod.outlook.com (10.141.205.17) X-MS-Office365-Filtering-Correlation-Id: 9807046e-ea4d-4a34-3eb6-08d41dfe449d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BLUPR07MB547; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB547; 3:6yrn2KThCYfeT+z6gCSKVEg/Wa9OlbYiT5ogOMIcQNZ4EpGl/gZcg4EmtHzb8zYsWtJX0WmiTwhKUmjJs3u064yhYEaypQdsy8ukfBjAHLeMrCOToXhC3gMeEor7fjjpwLOlexS7z/z5F7P2VPTGg5N12jm82yxCAWZBct5CjCfFFf+fK1IwEndDKwboOnatUrROFHvMdgeIIAK02usvjdfBskSg42vw9hLdAIOxPFZPNG8CFRixw9vHvITpoCiXdPSyfamWgONOeYwNqWTcTQ== X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB547; 25:IzDgTaqzK23gQBG0Jv73dQQh+5LrbOZ3Wb5mpHhdZdAujWkM1ZxAiIOOn/y+oS8VI1nhftYQi0fJYhJ1NIrv1z/9dEyy47eWu2NM39zGwJIoRYJLfM0l0h14X2WnznrGeWCMtV002lIZz3PSMsyHOn/wz1mEuR64e0kuLf6UMm+0bbQcSxkjhHkhsG60fLydwDIvHyd/0s/bFAhcb30owsSgS6yCaYFixpYL+WZX1/Erkf3DDXvBLkCMbdnLbNxIibCP8fvSIlzx58GrBE+NKCtB0AjZLcQSRnga9vzjva3Sis/SopjMBnWc5zQcOvlPnv9CG7Jt+0RGMPz95yCg+eVA2D9Bv/wGB0nuDOCImA43Qv+zJ2qra2QZAQrgCBwpjBgQMX3cHqfnLdcFXNXOF9UNl4OO3XtJslIjqgWo4WTlZtvaP1AnoxQ5GYDv9zc485iudq2RcZeh8wj8mz5+Cn4yycwJfWdPolPJxmUni2YoGSXSyXh5yPAqO8K9Q1R3+CID7BFvNeCvqEOz4Atqw3vuFAcWfI7802naJ3dfzxyXieoKfDqn4e2cgP1hYEUwNrFWJgGP3ehbe9ygErhBoIRiE8Jb8yw1axpgMPZ9J12fTFYaBTt2h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RHtm1vYj9KbjjCgrb6QmZqp03Ok2PUVJhFl1fVaf9O4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123560025)(20161123562025)(20161123564025)(20161123555025)(6072148); SRVR:BLUPR07MB547; BCL:0; PCL:0; RULEID:; SRVR:BLUPR07MB547; X-Microsoft-Exchange-Diagnostics: 1; BLUPR07MB547; 4:GMu9J5Q11w+dkU+FaVla7o0ofFFZJjkVSlFKZosmjn5XZ41QnGkiqq87CawQJLFobHzAP4nKJQ3QN91qNlLGnbUKlB2uSv/DgSaRc0gxXVB+DkqfqTUVAlpvc+8px0PIPnwt8sXd6AN+DTqlJ4HeDe4HWaGvXd/XFmLlwITjopO+fCo8Sfw+Z50mU7t7NMYxjK1EUNKqFwsLXHYpHYo8Xl2itWLG0IZ9AXH1VkeVwQF09rpnZSJOpszXKsYCUaOdRFtudkozh8iDLuikHWT6ka33IW4lijmndm2PS5ji7EAfGJ8v+pj+oo1ZDVakSYx4/6Mj375XWYwkS0SaetgOzdCOIIiRfCcTqvM9vBrQa7UJ+4hiXiAS+mLaxv6W/BqJpHwWe7iE1o6PrxbymEpgjX4K9IEWrfOVHypeWUi1v00McEtMs25J++wNnHQBA6xGPa/hKhOzzM5Nnfw4Bxwear/OKoerBlNGnnNbEyCLPO5YDNmCtGncjE2gUx7K4TBRVHT4QCvqnUpOpbFYFvFWoHjMG4c/pwh6AcfKIcwBlxJwtdOnUysJBzIXvNI9qAXnGX1hom5d3SRCwE9x/v0M+w== X-Forefront-PRVS: 01480965DA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(86152002)(33646002)(97736004)(5001770100001)(39450400002)(107886002)(4326007)(6506006)(6636002)(50466002)(6862003)(50226002)(6512006)(6486002)(4001430100002)(189998001)(39840400001)(39850400001)(2906002)(2950100002)(2876002)(6666003)(39410400001)(42882006)(5660300001)(733004)(68736007)(8676002)(81156014)(50986999)(3846002)(7736002)(76176999)(106356001)(81166006)(7846002)(92566002)(101416001)(105586002)(48376002)(36756003)(38730400001)(5003940100001)(47776003)(6116002)(42186005)(305945005)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR07MB547; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR07MB547; 23:3x4vOzOOELZoRCmKPjeoG8tf+TxDzoGwkk/51amqaE?= =?us-ascii?Q?x/+m+s1CpowDXAT92WHeKJ7NDcGaLK2wx1sUwx10a58wUwJGU3CTv9bScQki?= =?us-ascii?Q?MF3JG2WrdlJ9ef8EBGcGV4/wyEfR4dQ47y4EbS6E2LJlaWSIoYhlhaQOCv4U?= =?us-ascii?Q?dboNOx0hOnRTc6l665QYRtd+/l2gucUZRFm8J/uHSbQbTQodm131U5gg8zQU?= =?us-ascii?Q?L0KLkJDwf8E5Iic5tu0rW2Nrvww4PjpmyKK8RDt2AL42S0DLNwujc98LZllA?= =?us-ascii?Q?3SqSwm0FynujKTk6mHsew2G9F8Tgolhd+PAfH9MSNjdmkx5mH6vNwZykHjPI?= =?us-ascii?Q?SdwdgoPclt2eOmnP8A1WbDLTh5yb9IXicVPW+GApnz65LS+Ra5m1YGig5027?= =?us-ascii?Q?Qfy0D09QqbkkFDSUJTahaKOEOqgI9PrYJiis7RU9x4j0pAT4PLH59u9VborW?= =?us-ascii?Q?EYUGyC9B3lUBCvvbUeln8LY2frrLZm7/bMGZezD43aGFBV0flEIy7YpQjQDz?= =?us-ascii?Q?gWFeU1sEGHwbtx1ZMBJb+CaCdbiGP0CQjIpRVI1WL2bWTCywLM1Lhw0GRMQ5?= =?us-ascii?Q?vnfBBuNvqdLwX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KhIxFTgnzJqDDMElJSY+eMGJA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2016 17:35:26.9541 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR07MB547 Subject: [dpdk-dev] [PATCH v2 07/12] crypto/armv8: generate ASM symbols automatically X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 17:35:30 -0000 From: Zbigniew Bodek In order to acquire crypto_arg structure fields from the assembly code it is necessary to generate macros that will define offsets to those fields during app build. This will allow for free crypto_arg structure modifications in the future without the necessity to make similar changes for the assembly code. Introduce genassym.c file that will be used to generate phony assembly code containing pattern followed by field offset value. Use awk to create "define NAME value" sequence in the newly created assym.s file. Signed-off-by: Zbigniew Bodek --- drivers/crypto/armv8/Makefile | 12 +++++++++ drivers/crypto/armv8/genassym.c | 55 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 drivers/crypto/armv8/genassym.c diff --git a/drivers/crypto/armv8/Makefile b/drivers/crypto/armv8/Makefile index 2d053a4..8fdd374 100644 --- a/drivers/crypto/armv8/Makefile +++ b/drivers/crypto/armv8/Makefile @@ -69,4 +69,16 @@ DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += lib/librte_mempool DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += lib/librte_ring DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO) += lib/librte_cryptodev +# runtime generated assembly symbols +all: clean assym.s + +assym.s: genassym.c + @$(CC) $(CFLAGS) -O0 -S $< -o - | \ + awk '($$1 == "") { print "#define " $$2 "\t" $$3 }' > \ + $(SRCDIR)/asm/$@ + +.PHONY: clean +clean: + @rm -f $(SRCDIR)/asm/assym.s + include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/crypto/armv8/genassym.c b/drivers/crypto/armv8/genassym.c new file mode 100644 index 0000000..44604ce --- /dev/null +++ b/drivers/crypto/armv8/genassym.c @@ -0,0 +1,55 @@ +/* + * BSD LICENSE + * + * Copyright (C) Cavium networks Ltd. 2016. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium networks nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#include "rte_armv8_defs.h" + +#define ASSYM(name, offset) \ +do { \ + asm volatile("----------\n"); \ + /* Place pattern, name + value in the assembly code */ \ + asm volatile("\n " #name " %0\n" :: "i" (offset)); \ +} while (0) + + +static void __rte_unused +generate_as_symbols(void) +{ + + ASSYM(CIPHER_KEY, offsetof(struct crypto_arg, cipher.key)); + ASSYM(CIPHER_IV, offsetof(struct crypto_arg, cipher.iv)); + + ASSYM(HMAC_KEY, offsetof(struct crypto_arg, digest.hmac.key)); + ASSYM(HMAC_IKEYPAD, offsetof(struct crypto_arg, digest.hmac.i_key_pad)); + ASSYM(HMAC_OKEYPAD, offsetof(struct crypto_arg, digest.hmac.o_key_pad)); +} -- 1.9.1