From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0002e601.pphosted.com (mx0b-0002e601.pphosted.com [148.163.154.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C0054A4836; Fri, 16 Oct 2026 12:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.154.28 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792154775; cv=fail; b=M4SQxYYLb+Jl7sXh/lbVOajwDzOfbbw3DFH8/H8soLWh/hC1ViOo3mVlJTkY9uo5fW1sDHyGV5evBOUvF9MA33Fq9dHLjTcjNFjSLJlAcwl/5/pWuEEM++eljijaGoTf7V+oO28r4H22oqKwzBGJP95yZO8kw3+aGRF3jq8/gtQ= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792154775; c=relaxed/simple; bh=E5ui66nFN2Sr0ub9ZpazLzs4UnrJ/zMMHuFp0BvzIlw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aofuz5tE7QUoz0hXhVCNG1rjFLsBYLOr3eb4KfTksPilTpdqLRJxDVFqEciRMG9cT9+uhs54LG1drtRvFpujY+L0RfzktDAwiFjGCjzxdwXokVQ88yXFEdWgh9HuYU0/1XGSHjDMyPJoMb/szTWTdhN9fw7mhm1+RfLNJ2cWt4M= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (2048-bit key) header.d=ti.com header.i=@ti.com header.b=GnrLAghD; dkim=pass (1024-bit key) header.d=ticloud.onmicrosoft.com header.i=@ticloud.onmicrosoft.com header.b=XkeYu7Qr; arc=fail smtp.client-ip=148.163.154.28 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ti.com header.i=@ti.com header.b="GnrLAghD"; dkim=pass (1024-bit key) header.d=ticloud.onmicrosoft.com header.i=@ticloud.onmicrosoft.com header.b="XkeYu7Qr" Received: from pps.filterd (m0374955.ppops.net [127.0.0.1]) by mx0b-0002e601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 69GACsNb559820; Fri, 16 Oct 2026 07:46:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= proofpoint-05-2026; bh=SlhDa3fyQ7A8/OZxniic/0HDueJPFWpgVWgWymuD9 Y4=; b=GnrLAghDvOeR1F2BLpff3y6/8I3A9ycOcivRIke13ZydiXBRCFZo3ODj/ JJBMtVVXyW/E9RqvY7Bx6d25ptHuEOCcc2rpBiAgbzi5M6vZlvr/xqFAy/jSRt9w rGwq/rTcboBosuQOXBrajLDyau+E5vQ0DlFdZWzylhqn1drm1eTb4FcSfj5lh0nq EkgOE7HlYAesUuJ3LrxyyyEdYwNjZsO4RxHeyZQTGQf/RmIv9xxqgACiyE5Id51h WApUSPvqrf+veVFxedgw9Vz+P9Zn70QbNHUjTRhgC8/Y9pZknjJvN29P90o43Auh K1GVdvBPGKhfOgRMun3uxnLwXUIGw== Received: from dm1pr04cu001.outbound.protection.outlook.com (mail-centralusazon11010008.outbound.protection.outlook.com [52.101.61.8]) by mx0b-0002e601.pphosted.com (PPS) with ESMTPS id 4hbhbd8sgs-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 16 Oct 2026 07:46:09 -0500 (CDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L+nHghRH3+24Fup7nzdBlEbJiEcy2LelMfqDO6E9tR3OllRqmXIlLEVMZSJfxVD6IVJakbtDxDUVywLSpDi6c9QW4LTd1LcM7vAyuo2v6fJYJHu7izrwBz9HhAbYjFlR80oOHvnn2aHKw4r1I70wtlIFf8veyabsjQGBfe8j9Gj6LS903kB1U2OYtIVYfioEo3qetekLIo6Ip9fHknS/mfSL+59tf/GXj8wPe5JKl3+acuTew9b4PmXw4GLGBHGI1cJzkFEbb4A5PTJbyj3JendR4g8S+6YEPSJlNAM7muRF6lW9mJezVJV6iahyClQQJOEHFw7soqeN+79FCItYow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SlhDa3fyQ7A8/OZxniic/0HDueJPFWpgVWgWymuD9Y4=; b=OpLtirMfD7uEg5tSRTUpuXl+JtuQmBBMIs1D2G0GfnX9FbJwra93svSQ6NugBDXi2nCjdZMlXOfKMQWWpUTiLVhoPoAd0cOajoRW1qAL0MDrITbYIuUn82ohTe96W1aF83vjlQ/a87vTETbcqfRUgVLiI4TrTxE1Y6PbfKDChuw3CeyUlWL6bBDJ+cTrldHTbkXFrXK/YPwINiAbjWWCpp3hzB834GAQ1KAbv/ShswBkrqhjs66JIsxbA5dWMOrhMtEG7CxAXyKt7NOTumZRND3aswF5nAKBFZEqWxJPG4jgKw4nf8+lJYCF8bn9CSf+veaJskrOW5uUx4XbiHGNIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.23.194) smtp.rcpttodomain=gondor.apana.org.au smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ticloud.onmicrosoft.com; s=selector1-ticloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SlhDa3fyQ7A8/OZxniic/0HDueJPFWpgVWgWymuD9Y4=; b=XkeYu7QrfNBzPGJI927RMRsvz2OUW7Cc00ACO81hctSioYNMadVEgIC31/B2KHLHpMqYhIqPQ6CDfnRsZQpW5UN/gfw4dho/oJQYKwl4ndAu6YgfP+xU5ZoRdq8jjwG9tBK1x9Pba1dbLyQ7EJa3St3Je3JNctJq5yEMradUThw= Received: from CH0PR04CA0085.namprd04.prod.outlook.com (2603:10b6:610:74::30) by CH3PR10MB7836.namprd10.prod.outlook.com (2603:10b6:610:1b1::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.546.11; Fri, 16 Oct 2026 12:45:59 +0000 Received: from BL02EPF00029927.namprd02.prod.outlook.com (2603:10b6:610:74:cafe::2d) by CH0PR04CA0085.outlook.office365.com (2603:10b6:610:74::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.522.4 via Frontend Transport; Fri, 16 Oct 2026 12:45:58 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 198.47.23.194) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.23.194 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.23.194; helo=lewvzet200.ext.ti.com; pr=C Received: from lewvzet200.ext.ti.com (198.47.23.194) by BL02EPF00029927.mail.protection.outlook.com (10.167.249.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.522.6 via Frontend Transport; Fri, 16 Oct 2026 12:45:57 +0000 Received: from DLEE200.ent.ti.com (157.170.170.75) by lewvzet200.ext.ti.com (10.4.14.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Fri, 16 Oct 2026 07:45:32 -0500 Received: from DLEE211.ent.ti.com (157.170.170.113) by DLEE200.ent.ti.com (157.170.170.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Fri, 16 Oct 2026 07:45:31 -0500 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DLEE211.ent.ti.com (157.170.170.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45 via Frontend Transport; Fri, 16 Oct 2026 07:45:31 -0500 Received: from pratham-Workstation-PC (pratham-workstation-pc.dhcp.ti.com [10.24.53.205]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 69GCjUjQ2531438; Fri, 16 Oct 2026 07:45:31 -0500 From: T Pratham To: T Pratham , Herbert Xu , "David S. Miller" CC: Sebin Francis , Manorit Chawdhry , Praneeth Bajjuri , Vishal Mahaveer , , Subject: [PATCH v10 06/15] crypto: ti - Align buffers to cacheline for DMA Date: Fri, 16 Oct 2026 18:14:47 +0530 Message-ID: <20261016124456.1802080-7-t-pratham@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261016124456.1802080-1-t-pratham@ti.com> References: <20261016124456.1802080-1-t-pratham@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00029927:EE_|CH3PR10MB7836:EE_ X-MS-Office365-Filtering-Correlation-Id: 204d4506-4135-4a00-93b4-08df2b836ced X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|23010399003|36860700016|1800799024|82310400026|56012099006|261009223027099003|10067099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: ZPGNMHSv/CDEx5GFbcFKYsjNK05s5ivWjR83vFbHkcHUhFABvqYei34HdXqMlBC3F6AOEHNSKAaFVgADxmF5tVbBr3NSBThdS6HMSBanIlEvhE+1hih6+p00IosVpIFuMhZOJu8RtrjzlMaL0y7u6BCAVpz6TC6XF00LCLBqmbzxISdxLbMizFGwxioEPIGi8LNkgyJ8LNxTRPRb4sPL8tPIKSvCyGopVFQBO5YQG22mWrqcnyFrWt9jtmZfuQnuU7IzEb2THsInEEjk/MCjBORdG+TiHLNa+5i0lDoY/ioiuig3MeEU20ubrLtLMUV71kJmGrjlnLlhBqDPdeZ1G3vEDFqYTVaWNGkNrEP2nkCHHMyt6YQAMCfEcPBE75XNFNeWoStP4reysuhSAH3+LAIGDAe1GhVwZ1GdEyBtnQLFKpQs01tD7WXxuDy7F1Ef0P+4rj4dFMqUyOOqDymHmGCfXNS4rU+o8ncDeNH3br8DYmAWhjYioOJ7x5c+hZsDm94x2HkXVrVd+rl6Vx7WAs+hwaRLlZuqDnAahgvBnIEGpBTpbS2whiTlwt4sFOPyw0nbrcouvRnrrUaKSsivJ7P4DFKMYS4njkEvgLT4odup0lFD1/kbj6w+HY5ngw1zBwwMw4QSS6H7eRtBibgWX/9JEhADrSdi9IPBLwHtOox2idAUeoHwvs4Mmh/lW+ojfHISo9X8afLdDdiFf0fbsw== X-Forefront-Antispam-Report: CIP:198.47.23.194;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:lewvzet200.ext.ti.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(23010399003)(36860700016)(1800799024)(82310400026)(56012099006)(261009223027099003)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sj6vCUi6K58Lh7RWi27QExKdgY0dvF7lOmiCXg6H3yLB+xuW3AGQQEaQop6nOSotNOz4g2x6paDRbyhN1GK1LcFjQVsXKBlyXvfNnW9+FeWoAosJ2rW0BuuRm0tLdDqMvhqLv8gwKLr4Tg4WzB6VJ3Ie3TiLgfuE2oE83NS8bQUgaZi59T3yfBf1uDI30Phf0Nqp2EQC1/zMW1HD4cS9qcJgA3kBlCGNlj4hKvevIdkXLWUCeRMVTI/8/pytahrrRexANzqf4YfafEN2IvnhO8q9YA8UMQ0zxRG/FDmbjBfOE4y5NhqGaIPOwORg2bBsFy/igJuC81n26WJCvKsJqFSx4eVBHLQtsX2JbskYU43u/vpg4OQraOjS0TCjfFY2+tT9EJHDnS28EEvmjq2UtzIVxywfi6utyzrqgW+yX1aCo0wtGuPhpbbNLIZdFVyr X-Exchange-RoutingPolicyChecked: ZmT7+Pj4T16UXIz175HYSGgw71swOFpzsl+oT/0kWBILPEk8EOMB/8OO0BI9gq781TYRYQmmwngTqFdX4hz5UXtvVhjkI5dP+uNBgqmLC40mUi5RYHhiV6OXvJNpJRmTTfGC6yLci1uwpo1HuozVWPEjZuSOMZrt0rl2Ooh8Ka93/qa2F68aD5NoJLn09rUxpdJv+wlWFobZR+TkjLRWJH+zEq4PDVKtxPHfsPG2fykyjm51Z3xoFBvhHik+QTWltZaTZHRPPdS17ZzlySsb3uie5xwOeKUm9gUgG6sgXkxQ9DKlokM68XGJ7jzi36FbTWKRs8uBSHbf7/V3zEONKA== X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2026 12:45:57.6970 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 204d4506-4135-4a00-93b4-08df2b836ced X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.23.194];Helo=[lewvzet200.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00029927.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7836 X-Proofpoint-Spam-Info: AW1haW4tMjYxMDE2MDA1MCBTYWx0ZWRfX/3v+21/rGqkT kkeRlGcok9skpVrvbbF3GL7X77C0t0cNcjlJcpnYm/PlOrA37ETNkF60iOaJH02i08LfpAmGa+n 75zDozXvQx/k7SXb7bWwCpcyVuuWwmE= X-Proofpoint-ORIG-GUID: 72R0AbY2CMfRmqjMOmyxPKv6otj93emI X-Authority-Analysis: v=2.4 cv=BooIUoX5 c=1 sm=1 tr=0 ts=6ad21c91 cx=c_pps a=E1AkXC+xFF28g4y6WI75Xg==:117 a=WotqVVQAdb04rnGuttW3Kw==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=660iZSQnnn4A:10 a=s63m1ICgrNkA:10 a=AlMIdn_sM9wA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Z8NIEmU8O1QQgoT56wFK:22 a=fPAWb5peG099m5CrUpKH:22 a=sozttTNsAAAA:8 a=dBz7rOeTUn-ILHDwuGIA:9 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDE2MDA1MCBTYWx0ZWRfX4UiXOyMNojCZ LYRTw8HwSd1DmPDGe7B48s6s1EMvxbE0kB8Qx9jXZMNtQLzSLeBj6Ywo3PPpJ0ugyL/L355+qHB 8cXYeGLSe22IDvL+OY6lp7UUBgKgWTMwUiePtY5hQ9fUD1nXdNYdHUISHoHrVk5+9pU3JN59zuS 56pDph//Vabi78Ax8Xrc9dieKVWjI6BCQwauaJBT0CtNqXblx0Gc+hnBSA6R8sNsuPf6nRmwhg+ S0JwqnpRipWB7GG0nQR27dfIMDxvybvmysDWmP5FZsPlRmyJQJCyiNoCJveH2IiWb1/7c0gNV14 oPd/I6yM+IWGhOugK1vCuuSS8kwXskOvczZ0aL34eauRTBCa2UnkU37L6KxT8DShH2ddu4R3hnE OyXLBio+5ogNwi3Sb1WNAxV0qAED9PbvdVp1eZsx6t3FTfZM7/fDj+Ve8lfynT2hI2pScpqBFO9 nJ467/bwZh3zVqYpaHg== X-Proofpoint-GUID: 72R0AbY2CMfRmqjMOmyxPKv6otj93emI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-16_01,2026-10-14_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 adultscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610080000 definitions=main-2610160050 Align padding buffer which are DMA mapped to cache line to avoid any potential cache coherence problem. Add DMA padding to reqctx and use req_ctx_dma helpers instead of req_ctx. Fixes: 35645ca63caa1 ("crypto: ti - Add support for AES-CTR in DTHEv2 driver") Signed-off-by: T Pratham --- drivers/crypto/ti/dthev2-aes.c | 46 +++++++++++++++++-------------- drivers/crypto/ti/dthev2-common.h | 2 ++ 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/drivers/crypto/ti/dthev2-aes.c b/drivers/crypto/ti/dthev2-aes.c index be7ec62ab2513..5be1bcaeee5ed 100644 --- a/drivers/crypto/ti/dthev2-aes.c +++ b/drivers/crypto/ti/dthev2-aes.c @@ -298,7 +298,7 @@ static void dthe_aes_set_ctrl_key(struct dthe_tfm_ctx *ctx, static int dthe_aes_do_fallback(struct skcipher_request *req) { struct dthe_tfm_ctx *ctx = crypto_skcipher_ctx(crypto_skcipher_reqtfm(req)); - struct dthe_aes_req_ctx *rctx = skcipher_request_ctx(req); + struct dthe_aes_req_ctx *rctx = skcipher_request_ctx_dma(req); SYNC_SKCIPHER_REQUEST_ON_STACK(subreq, ctx->skcipher_fb); @@ -314,7 +314,7 @@ static int dthe_aes_do_fallback(struct skcipher_request *req) static void dthe_aes_dma_in_callback(void *data) { struct skcipher_request *req = (struct skcipher_request *)data; - struct dthe_aes_req_ctx *rctx = skcipher_request_ctx(req); + struct dthe_aes_req_ctx *rctx = skcipher_request_ctx_dma(req); complete(&rctx->aes_compl); } @@ -323,7 +323,7 @@ static int dthe_aes_run(struct crypto_engine *engine, void *areq) { struct skcipher_request *req = container_of(areq, struct skcipher_request, base); struct dthe_tfm_ctx *ctx = crypto_skcipher_ctx(crypto_skcipher_reqtfm(req)); - struct dthe_aes_req_ctx *rctx = skcipher_request_ctx(req); + struct dthe_aes_req_ctx *rctx = skcipher_request_ctx_dma(req); struct dthe_data *dev_data = rctx->dev_data; unsigned int len = req->cryptlen; @@ -515,7 +515,7 @@ static int dthe_aes_run(struct crypto_engine *engine, void *areq) static int dthe_aes_crypt(struct skcipher_request *req) { struct dthe_tfm_ctx *ctx = crypto_skcipher_ctx(crypto_skcipher_reqtfm(req)); - struct dthe_aes_req_ctx *rctx = skcipher_request_ctx(req); + struct dthe_aes_req_ctx *rctx = skcipher_request_ctx_dma(req); struct dthe_data *dev_data; struct crypto_engine *engine; int ret; @@ -560,7 +560,7 @@ static int dthe_aes_crypt(struct skcipher_request *req) static int dthe_aes_encrypt(struct skcipher_request *req) { - struct dthe_aes_req_ctx *rctx = skcipher_request_ctx(req); + struct dthe_aes_req_ctx *rctx = skcipher_request_ctx_dma(req); rctx->enc = 1; return dthe_aes_crypt(req); @@ -568,7 +568,7 @@ static int dthe_aes_encrypt(struct skcipher_request *req) static int dthe_aes_decrypt(struct skcipher_request *req) { - struct dthe_aes_req_ctx *rctx = skcipher_request_ctx(req); + struct dthe_aes_req_ctx *rctx = skcipher_request_ctx_dma(req); rctx->enc = 0; return dthe_aes_crypt(req); @@ -735,7 +735,7 @@ static int dthe_aead_read_tag(struct dthe_aes_req_ctx *rctx, u32 *tag) static int dthe_aead_enc_get_tag(struct aead_request *req) { struct dthe_tfm_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req)); - struct dthe_aes_req_ctx *rctx = aead_request_ctx(req); + struct dthe_aes_req_ctx *rctx = aead_request_ctx_dma(req); u32 tag[AES_BLOCK_WORDS]; int nents; int ret; @@ -755,7 +755,7 @@ static int dthe_aead_enc_get_tag(struct aead_request *req) static int dthe_aead_dec_verify_tag(struct aead_request *req) { struct dthe_tfm_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req)); - struct dthe_aes_req_ctx *rctx = aead_request_ctx(req); + struct dthe_aes_req_ctx *rctx = aead_request_ctx_dma(req); u32 tag_out[AES_BLOCK_WORDS]; u32 tag_in[AES_BLOCK_WORDS]; int nents; @@ -836,7 +836,7 @@ static int dthe_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) static int dthe_aead_do_fallback(struct aead_request *req) { struct dthe_tfm_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req)); - struct dthe_aes_req_ctx *rctx = aead_request_ctx(req); + struct dthe_aes_req_ctx *rctx = aead_request_ctx_dma(req); SYNC_AEAD_REQUEST_ON_STACK(subreq, ctx->aead_fb); @@ -852,7 +852,7 @@ static int dthe_aead_do_fallback(struct aead_request *req) static void dthe_aead_dma_in_callback(void *data) { struct aead_request *req = (struct aead_request *)data; - struct dthe_aes_req_ctx *rctx = aead_request_ctx(req); + struct dthe_aes_req_ctx *rctx = aead_request_ctx_dma(req); complete(&rctx->aes_compl); } @@ -861,7 +861,7 @@ static int dthe_aead_run(struct crypto_engine *engine, void *areq) { struct aead_request *req = container_of(areq, struct aead_request, base); struct dthe_tfm_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req)); - struct dthe_aes_req_ctx *rctx = aead_request_ctx(req); + struct dthe_aes_req_ctx *rctx = aead_request_ctx_dma(req); struct dthe_data *dev_data = rctx->dev_data; unsigned int cryptlen = req->cryptlen; @@ -1140,7 +1140,7 @@ static int dthe_aead_run(struct crypto_engine *engine, void *areq) static int dthe_aead_crypt(struct aead_request *req) { struct dthe_tfm_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req)); - struct dthe_aes_req_ctx *rctx = aead_request_ctx(req); + struct dthe_aes_req_ctx *rctx = aead_request_ctx_dma(req); struct dthe_data *dev_data; struct crypto_engine *engine; unsigned int cryptlen = req->cryptlen; @@ -1212,7 +1212,7 @@ static int dthe_aead_crypt(struct aead_request *req) static int dthe_aead_encrypt(struct aead_request *req) { - struct dthe_aes_req_ctx *rctx = aead_request_ctx(req); + struct dthe_aes_req_ctx *rctx = aead_request_ctx_dma(req); rctx->enc = 1; return dthe_aead_crypt(req); @@ -1220,7 +1220,7 @@ static int dthe_aead_encrypt(struct aead_request *req) static int dthe_aead_decrypt(struct aead_request *req) { - struct dthe_aes_req_ctx *rctx = aead_request_ctx(req); + struct dthe_aes_req_ctx *rctx = aead_request_ctx_dma(req); rctx->enc = 0; return dthe_aead_crypt(req); @@ -1246,7 +1246,8 @@ static struct skcipher_engine_alg cipher_algs[] = { .cra_alignmask = AES_BLOCK_SIZE - 1, .cra_blocksize = AES_BLOCK_SIZE, .cra_ctxsize = sizeof(struct dthe_tfm_ctx), - .cra_reqsize = sizeof(struct dthe_aes_req_ctx), + .cra_reqsize = sizeof(struct dthe_aes_req_ctx) + + CRYPTO_DMA_PADDING, .cra_module = THIS_MODULE, }, .op.do_one_request = dthe_aes_run, @@ -1271,7 +1272,8 @@ static struct skcipher_engine_alg cipher_algs[] = { .cra_alignmask = AES_BLOCK_SIZE - 1, .cra_blocksize = AES_BLOCK_SIZE, .cra_ctxsize = sizeof(struct dthe_tfm_ctx), - .cra_reqsize = sizeof(struct dthe_aes_req_ctx), + .cra_reqsize = sizeof(struct dthe_aes_req_ctx) + + CRYPTO_DMA_PADDING, .cra_module = THIS_MODULE, }, .op.do_one_request = dthe_aes_run, @@ -1296,7 +1298,8 @@ static struct skcipher_engine_alg cipher_algs[] = { CRYPTO_ALG_NEED_FALLBACK, .cra_blocksize = 1, .cra_ctxsize = sizeof(struct dthe_tfm_ctx), - .cra_reqsize = sizeof(struct dthe_aes_req_ctx), + .cra_reqsize = sizeof(struct dthe_aes_req_ctx) + + CRYPTO_DMA_PADDING, .cra_module = THIS_MODULE, }, .op.do_one_request = dthe_aes_run, @@ -1321,7 +1324,8 @@ static struct skcipher_engine_alg cipher_algs[] = { .cra_alignmask = AES_BLOCK_SIZE - 1, .cra_blocksize = AES_BLOCK_SIZE, .cra_ctxsize = sizeof(struct dthe_tfm_ctx), - .cra_reqsize = sizeof(struct dthe_aes_req_ctx), + .cra_reqsize = sizeof(struct dthe_aes_req_ctx) + + CRYPTO_DMA_PADDING, .cra_module = THIS_MODULE, }, .op.do_one_request = dthe_aes_run, @@ -1349,7 +1353,8 @@ static struct aead_engine_alg aead_algs[] = { CRYPTO_ALG_NEED_FALLBACK, .cra_blocksize = 1, .cra_ctxsize = sizeof(struct dthe_tfm_ctx), - .cra_reqsize = sizeof(struct dthe_aes_req_ctx), + .cra_reqsize = sizeof(struct dthe_aes_req_ctx) + + CRYPTO_DMA_PADDING, .cra_module = THIS_MODULE, }, .op.do_one_request = dthe_aead_run, @@ -1374,7 +1379,8 @@ static struct aead_engine_alg aead_algs[] = { CRYPTO_ALG_NEED_FALLBACK, .cra_blocksize = 1, .cra_ctxsize = sizeof(struct dthe_tfm_ctx), - .cra_reqsize = sizeof(struct dthe_aes_req_ctx), + .cra_reqsize = sizeof(struct dthe_aes_req_ctx) + + CRYPTO_DMA_PADDING, .cra_module = THIS_MODULE, }, .op.do_one_request = dthe_aead_run, diff --git a/drivers/crypto/ti/dthev2-common.h b/drivers/crypto/ti/dthev2-common.h index 03a0b426041ac..cc20538ad6f36 100644 --- a/drivers/crypto/ti/dthev2-common.h +++ b/drivers/crypto/ti/dthev2-common.h @@ -114,7 +114,9 @@ struct dthe_tfm_ctx { */ struct dthe_aes_req_ctx { int enc; + __dma_from_device_group_begin(); u8 padding[2 * AES_BLOCK_SIZE]; + __dma_from_device_group_end(); struct completion aes_compl; struct dthe_data *dev_data; }; -- 2.34.1