From patchwork Thu Sep 28 07:25:05 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: 14651 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3264662vqu; Thu, 28 Sep 2023 05:13:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5322dCnfWYoz8OP/2814Itr6va1pPdLGhnX4bLpMcCk1bcllJJTUK7rabBuu26bJo9hZe X-Received: by 2002:a81:5403:0:b0:59d:d85e:795d with SMTP id i3-20020a815403000000b0059dd85e795dmr885497ywb.51.1695903234862; Thu, 28 Sep 2023 05:13:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695903234; cv=none; d=google.com; s=arc-20160816; b=IcR+e8Q06LkAYsimje7/gaOYx+KwlpjYKlz3xfj9Bh2j2VupyWgRR6peOJy/pwsh9Y ZdNYlhYpjWl320aBmn+HR5MbGvSGmi6+B9X5TZXY3XtFQu1/o1hwkbpuYfozhnjHgU9p t6xW9+kVYKJmZtG6YxIETrSuvflaensv7KDTUsCttF7ffETHRaaq8w/5A7DIl/Mqtb2V NErZ/o6C+B0MUqyKURIOoHZfpMpASiTiC9KWwtxqswP/2hTFJuWxny3QLmQM8RG6hX2X onGgmX7+lpZRTD8f8JPzPdPbqE+ib0HMfNtCP5uwjbp2/L/+Oxntd8S8BB3FQMIklznp fWnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qw31w5FtGftCkP1Yjg5Z8T0dYbboTi7QLUlCgNSanH0=; fh=tviR08lFG+54esGJyrLHT4lrARHdK8RLPqfNKMCXuuE=; b=S7piojz9NJ07E+8sDD84hmSzDXNXKyQSjbGkuBJT0drHFJv5odSw2/rEtp9pY1eAzd wAk6WaqJKNR9yLPKC1Hp6XRD26f4imY3Va+6/mo0POwhCOenOdHdP4+6fPzeDPLDzKRc ZXZCDkqHYMEtbt8ykEqcjhV3VLIerMD9WeLTP0LDH1Jl5ZcYI4ivIxQRRY4TUCZfHed4 07fqn96HKaOQN4TiLoeVw4ESeEaE69K62Rj5BoIdisHjzxtph5WOHagRF2BOg+MYBzVx bMx96hwmuvgOxyATwZFfK5KlUTiPB96VQl3JIn2duFtydTSrjOetfX9ozCFg7c1yp7B9 +BAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=J1a9Flam; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id g16-20020a631110000000b00573f7ef60aesi18659038pgl.154.2023.09.28.05.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:13:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=J1a9Flam; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CC09B8215AEA; Thu, 28 Sep 2023 00:39:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230314AbjI1HjC (ORCPT + 20 others); Thu, 28 Sep 2023 03:39:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230295AbjI1HjA (ORCPT ); Thu, 28 Sep 2023 03:39:00 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B413AC; Thu, 28 Sep 2023 00:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695886739; x=1727422739; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=40nXyAPgocdeKIF3kA25jghB0Z6YVlYWl0z9fcbH7IA=; b=J1a9FlampS2PPq+hvytNIZ96u+ToAmAyTNZTQG6c9F6Qw1ejwR/eCrbQ Rx0GSZdG8zPHUixnh8D99G1Up4OlDHOYP+8/1WBg9//ix18J0jQfxvhcI qc2O1hPVVbTJCbCi5JQKGpaH7WjZRqI7athbWNgwrAxPkuIW1B0Z3/v1s FKhnZ5z2Z5w5Dn+MvuwZ2IpXegWi2l4DRQ5CiSmVUzLWZ/oe++VgO3Bn3 Aucj3LeKkmvJJIuhMCPVNG3PdCvdwsL6CLXuRiTRyPqbqIJ4iH3/hNfx1 boaom9OTITLCJm3KageGpMnDtkMQoS4X3iLkT1TZ0OGG3hLB5aJTxFnHQ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="367064857" X-IronPort-AV: E=Sophos;i="6.03,183,1694761200"; d="scan'208";a="367064857" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 00:38:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="742990418" X-IronPort-AV: E=Sophos;i="6.03,183,1694761200"; d="scan'208";a="742990418" Received: from chang-linux-3.sc.intel.com ([172.25.66.173]) by orsmga007.jf.intel.com with ESMTP; 28 Sep 2023 00:38:57 -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 v2 0/3] crypto: x86/aesni - Improve XTS data type Date: Thu, 28 Sep 2023 00:25:05 -0700 Message-Id: <20230928072508.218368-1-chang.seok.bae@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230925151752.162449-1-chang.seok.bae@intel.com> References: <20230925151752.162449-1-chang.seok.bae@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 28 Sep 2023 00:39:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778044769304697201 X-GMAIL-MSGID: 1778283430383887086 V1->V2: * Drop the unnecessary casts (Eric). * Put the 'Link:' tag right after 'Suggested-by' (Eric). --- 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