From patchwork Tue Mar 28 15:57:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary R Hook X-Patchwork-Id: 9650097 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B8535602C8 for ; Tue, 28 Mar 2017 15:58:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA12D28405 for ; Tue, 28 Mar 2017 15:58:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A84A32842E; Tue, 28 Mar 2017 15:58:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7118E28458 for ; Tue, 28 Mar 2017 15:58:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752553AbdC1P5u (ORCPT ); Tue, 28 Mar 2017 11:57:50 -0400 Received: from mail-co1nam03on0080.outbound.protection.outlook.com ([104.47.40.80]:16000 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752545AbdC1P5t (ORCPT ); Tue, 28 Mar 2017 11:57:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BJSi+GM1kHGyOuFLo8o3VVXwC1ldpTzRVGSQ0EW3Ld4=; b=gPn7U+Pv2D1Xgpl+zb7yMIYr1kUSWHxTMOKwgoDcnabE2l3QrMYtexc0pbKiepKIQD0EmsGXM1LqDYPNyGGQRxhxS5A6SqWFK50GNVU4NjOHpAXwrgmsv+N33MOTNupp+JECQVNMqdWcTLR0L8KQluIq8qWGTWuRpLqdJVjzEhE= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from [10.236.19.42] (165.204.77.1) by BLUPR12MB0468.namprd12.prod.outlook.com (10.162.92.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Tue, 28 Mar 2017 15:57:31 +0000 Subject: [PATCH V2] crypto: ccp - Rearrange structure members to minimize size From: Gary R Hook To: CC: , , , , Date: Tue, 28 Mar 2017 10:57:26 -0500 Message-ID: <20170328155725.9578.85077.stgit@taos> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR12CA0069.namprd12.prod.outlook.com (10.175.83.159) To BLUPR12MB0468.namprd12.prod.outlook.com (10.162.92.149) X-MS-Office365-Filtering-Correlation-Id: 20467e0c-fb4c-41c7-1beb-08d475f324e2 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423062)(201703031133068); SRVR:BLUPR12MB0468; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0468; 3:Ku+Q6KqIvKkwp9u413TT97KpmQBCf2t+JZpPiKuhg/XcMtBIllxrrDy2NrFwDNgbeBrfNWgogCNBHdsimt8E/pAl30zsDQfwrYMaCNHT4nprW6RKv/bZIOkULIgu/+dpQt7GQ0yjW6qB3+Z4xsciu4Y8G3EgrM3spSgROsAEfwSkZt2x6AAlSfSbgxoI8ejY+QLd0nGFTeGKyvTtmwogU/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pWaLug/Spcq9XZDddQcIBJoo/te0qwqKrTBYZe3yMVgWFOwMp/HT+DPefK4+nqT0d2QQGOdT/P/fYGIfZVi/YP65lC7kDbr5iacTlCUyTct7Z2N06LjdRBLHdgwb83pVczxZZeHffd0bZV17PXJ1ILBgQGQN5NWZuL2j8gl2CvEUaRe6W/S6pTtEt3YrdU+qEmEHtK18tX+uav/mM9RIe6KBf0Rhy0Nu2IE6Dk37uYsSgqzM2FMgbTHnREcs7YU/ewQXiWheggLYyz1DjzDrVhlodyLpw39NJ7Q2ob86nvy84AQqF5+srAh6vOmxxkwNV12iUlHUKRIK6908ZC3rFz3yt/Emjd7GqIDcYu80SgxllW9Kr X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040437)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(201703131423062)(201702281528062)(201703061421062)(201703061406062)(20161123564025)(20161123558025)(20161123560025)(20161123562025)(20161123555025)(6072148); SRVR:BLUPR12MB0468; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0468; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0468; 4:SI620LKE0fk/HNBvMmfAD+JO41bR07FcE2gZKLsc4PbMGHxIb8VS5IYXm2EiWLCmdDc+OTe/m2S7CHTkTd6CzFCGivs3ulyE0zqWghZso0j0u/sCt+Ag9PigNoWwABYPtxR9/sC1HPu9ZiTdCJgL7vRY4tqzYLfErIe7+rGfpaEQBW8YvAOLURHC9kLfBGL2vNCMfZ3jhuKCFdh+NmxYJerzzBKveHXbOHfE0OeLlNLT9Bn7UT6/of8Qf7uW5CUgsBx1dMr6YnslRYzLUPkiKMFJI9sea1n+2QWyK3mYAuEcIKFj89OutUbnA8blUdACJ1MW/12SJ+JJfWm+ZrwkioBHJzJrhR58q6JRSDT5XS3FVFbnz65+shpO98y8IjO6e9h4XclrTTsTECeSuUAqUjLCAejPyOQnDyvGaU8yOp6yuVkOxdZ7TczxGuvCsTZQvT6j0dM1FdJsksrvqjDmQRXL5YI+HzWruK+MeSklFCHPLy1EW2mer/6OD6pr3BFM0lqYjOc40QtbZy4A7IDNrivJyiHYkhHg3qd/DhZ78KyaQcglyPAOohnplB+TKj3LPx6MY+n0FYzJdxTXJHitn45CmdO4x+o5E1fUGD3akHXXtpaUe+hRu4XZYc56OoSPxwjQKoMrV2suCcEDgXdTuMdTqPIhqD1MeR73r3QEsV7vsx3lFAzCB5YFY8LR/ezsMMkcHrUx34xrHJZd04W/OfhzQOAJWv2mTWfiRy6zDuphgcmdwyWLQ8YI4YBndQmKCczLJ5mH0S60OGi0yYNQ2YXHswYXUPSIdVsKzpslQlI= X-Forefront-PRVS: 0260457E99 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(39860400002)(39840400002)(39450400003)(39410400002)(39400400002)(39850400002)(47776003)(230700001)(42186005)(6116002)(3846002)(66066001)(1076002)(2351001)(4001350100001)(33646002)(83506001)(50466002)(305945005)(50986999)(54906002)(6666003)(7736002)(6916009)(103116003)(97746001)(81166006)(8676002)(90366009)(38730400002)(110136004)(9686003)(6486002)(2906002)(77096006)(33716001)(25786009)(53936002)(86362001)(4326008)(189998001)(23676002)(5660300001)(54356999); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0468; H:[10.236.19.42]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTFVQUjEyTUIwNDY4OzIzOjBxK2YxNkRaTU92RFM3cUJaMmdueEQvem1X?= =?utf-8?B?Ui9VTGFveWdya21CWXphRDNmREFnK09LVFNCY0xVd2xlZHBoZVpOdmZoR1Zj?= =?utf-8?B?eUlMTXFBTHE4eXRoYUhFWnJoWmQzVHFkV21Xd0pRQk9GNUVDTm5kM3AyWUtP?= =?utf-8?B?bERhOVFweXVtUWw4ekFBendhNHcxUkdpeVM2O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Yjr3aWBS+8CocKKvDC5eozS7h+Nw2FhpSkTcZ9Kx5YHwlaNbkoLKgcwv9FN6aGcxFeCap61Uqix/wLhVqldbRJLphLpbwkD7oad5Vpk18mD5zrQjq0yhS1+DRf6bsZ211TQGyl01DFdvjbbMXiYB0Q==; 24:+UyevOR6b7CfjlQ8xpd0wQ4vEoazxTBpT5b6+I1FGeMqpipAkfX2guRjeYMNgKGJ9r4X6qlS7TErW0BqO398DE92Yd58eCkjTwZgDgOjXCU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0468; 7:OSF1SudfYgS1Y5CxFap6sZBTgjwZxsFkkMTR87y0W+O1aeE8VY3HCY2CqjnSUZR1Ri3/rb7obYHz2K3rlvFbo9IDkhP8EZQObtTy/26QTWlRqCheKEgE71JLGxr+/jV4HElqphIA34cRi6ioNl2H8CUZDdBwmKwi8rs3NGbgwjGj9l7JtTTvwtdtHs9HIKxal847veG6V34HoXbBeAv+cxZaSM41YN1Credz6ul2u9hAew1/tF2paP3yBuMnU2ZlfQTKL3+Cz9cfaDW/Ih4F+nISSqn1pt+d/63QZziDYVz/xpAcxW4RvuJv+xuE/1eKgGox/wmV60do/PPDSr5GWQ==; 20:/RiPzSlyqau2rsxjCtM3mimuUZtqQd29TTd5cdP3JaSkJgw83O1XPx/hNhwohnoy+I1aVzZA9stZ4ukdZ+1wu00nn9XVCyqUIwCuGWDFArqer08lMJ9eJ+IeFT3Jd1ly5m/SM68n0LQMViqj40KGzU7OWU4jAE/x+2RoBv30e+6pymzTIA7SdjOjO2/Ru7UNEBI16I3mJ6VtuPt3UVMn+TOarXyPMIcQavEQYOntvcQC0LqtviTTrgC4OtFYp7zW X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2017 15:57:31.8239 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0468 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The AES GCM function (in ccp-ops) requires a fair amount of stack space, which elicits a complaint when KASAN is enabled. Rearranging and packing a few structures eliminates the warning. Signed-off-by: Gary R Hook --- drivers/crypto/ccp/ccp-dev.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dev.h b/drivers/crypto/ccp/ccp-dev.h index 3a45c2a..191274d 100644 --- a/drivers/crypto/ccp/ccp-dev.h +++ b/drivers/crypto/ccp/ccp-dev.h @@ -427,33 +427,33 @@ enum ccp_memtype { }; #define CCP_MEMTYPE_LSB CCP_MEMTYPE_KSB + struct ccp_dma_info { dma_addr_t address; unsigned int offset; unsigned int length; enum dma_data_direction dir; -}; +} __packed __aligned(4); struct ccp_dm_workarea { struct device *dev; struct dma_pool *dma_pool; - unsigned int length; u8 *address; struct ccp_dma_info dma; + unsigned int length; }; struct ccp_sg_workarea { struct scatterlist *sg; int nents; + unsigned int sg_used; struct scatterlist *dma_sg; struct device *dma_dev; unsigned int dma_count; enum dma_data_direction dma_dir; - unsigned int sg_used; - u64 bytes_left; };