From patchwork Mon Sep 25 15:17:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chang S. Bae" X-Patchwork-Id: 13397999 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01A49CE7A81 for ; Mon, 25 Sep 2023 15:31:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232187AbjIYPby (ORCPT ); Mon, 25 Sep 2023 11:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232086AbjIYPby (ORCPT ); Mon, 25 Sep 2023 11:31:54 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 468B395; Mon, 25 Sep 2023 08:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695655908; x=1727191908; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Ohmo0uphE7YPdh5WwFbU8+KeksI6x6RafAzGQ1Oq1QM=; b=IgLsAW7H7m+4ZZPxHo+meX4GcowK2hqx+zUQUBzafrgVRxlMpceTQKfS KR3Dp/Upc5lpjdOpu5hdg/GGR6IOOJCpg81MZ7qEJYMUfq30ZWoThyK8O /gjpbOwou0gptwdfI1zRu/V04KJMqOACd2lyVluw3D7gTfXqpI//pxbcl zv5DPbKmSMCtbS9BZ2hfxpATwqKt0zU8XYAqz2oDUaxR7dPP3rANNUE0p NVzWTCt6s0WNv2BWH7SfKiB7RRyQG5aOVRZ/QY9N3bnb3UvpSon0Q0LZP oaZ14f7fU586so4YHrDB33cP93p2Wm68Lo9YTi+0cYjnYMw+p1lfN4Qr9 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="361533581" X-IronPort-AV: E=Sophos;i="6.03,175,1694761200"; d="scan'208";a="361533581" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2023 08:31:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="725023003" X-IronPort-AV: E=Sophos;i="6.03,175,1694761200"; d="scan'208";a="725023003" Received: from chang-linux-3.sc.intel.com ([172.25.66.173]) by orsmga006.jf.intel.com with ESMTP; 25 Sep 2023 08:31:45 -0700 From: "Chang S. Bae" To: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, davem@davemloft.net, ebiggers@kernel.org, x86@kernel.org, chang.seok.bae@intel.com Subject: [PATCH 0/3] crypto: x86/aesni - Improve XTS data type Date: Mon, 25 Sep 2023 08:17:49 -0700 Message-Id: <20230925151752.162449-1-chang.seok.bae@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The field within the struct aesni_xts_ctx is currently defined as a byte array, sized to match the struct crypto_aes_ctx. However, it actually represents the struct data type. To accurately redefine the data type, some adjustments have to be made to the address alignment code. It involved refactoring the common alignment code initially, followed by updating the structure's definition. Finally, the XTS alignment is now performed early in the process, rather than at every access point. This change was suggested during Eric's review of another series intended to enable an alternative AES implementation [1][2]. I viewed it as an enhancement to the mainline, independent of the series. I have divided these changes into incremental pieces, making them considerably more reviewable and maintainable. The series is based on the cryptodev's master branch: git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master Thanks, Chang [1] https://lore.kernel.org/all/ZFWQ4sZEVu%2FLHq+Q@gmail.com/ [2] https://lore.kernel.org/all/20230526065414.GB875@sol.localdomain/ Chang S. Bae (3): crypto: x86/aesni - Refactor the common address alignment code crypto: x86/aesni - Correct the data type in struct aesni_xts_ctx crypto: x86/aesni - Perform address alignment early for XTS mode arch/x86/crypto/aesni-intel_glue.c | 52 ++++++++++++++---------------- 1 file changed, 25 insertions(+), 27 deletions(-) base-commit: 1c43c0f1f84aa59dfc98ce66f0a67b2922aa7f9d