From patchwork Mon Dec 19 15:35:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13076739 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB186C4167B for ; Mon, 19 Dec 2022 15:43:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 42E9E8E0003; Mon, 19 Dec 2022 10:43:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0AF9A8E000D; Mon, 19 Dec 2022 10:43:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF88D8E000E; Mon, 19 Dec 2022 10:43:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5C83F8E0009 for ; Mon, 19 Dec 2022 10:43:45 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 433A01A0467 for ; Mon, 19 Dec 2022 15:43:45 +0000 (UTC) X-FDA: 80259476010.04.2639914 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf17.hostedemail.com (Postfix) with ESMTP id C2CFF40016 for ; Mon, 19 Dec 2022 15:43:43 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=BNNdcWpl; spf=none (imf17.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671464623; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:references:dkim-signature; bh=ltmheXPbH9IMNFHZ4P8NvOysWa92wKwMkpxaGeG832Q=; b=1vQ1qFKqmGa6cmJDYBtgNCessix+uU2NCvjfMmQZV9wmqqhGLSOkY+NhfOVYZxI+4KP1XT QGlxmMOLF8xgxlBjWcBBKcfaedwUUviOheerOSb5ZzUIiU9v3XrJdOr79h3+p80VyCjNNB 2ckS7Alse/xCtLN1g0J+rk92Y13AFbI= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=BNNdcWpl; spf=none (imf17.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671464623; a=rsa-sha256; cv=none; b=kpDQWgGZiTAuEjzlS+8uGzIDpUkl9Z+vcnQ9Mu2l2inhwZwjRrnER3C3szCi+7feeCw2ph 7CnrWI1KNjkuARjJQoA6ElFn1SNSE/orlhttJVC30qJPAVW3WWSRZeKqKtLVBJ8P8illUA jJXcflVAWtApd+JjbbuLy5dIWRBOgFg= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=ltmheXPbH9IMNFHZ4P8NvOysWa92wKwMkpxaGeG832Q=; b=BNNdcWplbia7Tdo9e9JhzPu744 gXUhVeJe6clEEF36/xkbfr3un7XfcOJP5RsPH/+K3YTh4jfl8/W0cviflURH82EDqZNU17198QH36 WtXvDaQ8shWg9Et9rZ0rynw5UAUIMvXqis8/K09oIZJGjXakQ2lD7xEJXx8DLdeYSyAUKUsAqn+gq wbwi6dU6OmKxe5dkQmHBEh1gsn+cqhS4KPU/uyspZ1uxqYCK58Od/ZX2TDOHMHLuybHLL61GBnq+1 2JKJPz5M+mHygNluwA1CvVZiz5OnHN0oZnOivqqc8Z5SwIEE2uc3zf2UtwWj74ZvPOIqz2jboZeLx U+GXIYdA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1p7III-00CeDn-27; Mon, 19 Dec 2022 15:43:11 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A44BA302E0D; Mon, 19 Dec 2022 16:43:06 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 6839D20114B73; Mon, 19 Dec 2022 16:43:06 +0100 (CET) Message-ID: <20221219154118.955831880@infradead.org> User-Agent: quilt/0.66 Date: Mon, 19 Dec 2022 16:35:27 +0100 From: Peter Zijlstra To: torvalds@linux-foundation.org Cc: corbet@lwn.net, will@kernel.org, peterz@infradead.org, boqun.feng@gmail.com, mark.rutland@arm.com, catalin.marinas@arm.com, dennis@kernel.org, tj@kernel.org, cl@linux.com, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, Herbert Xu , davem@davemloft.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, joro@8bytes.org, suravee.suthikulpanit@amd.com, robin.murphy@arm.com, dwmw2@infradead.org, baolu.lu@linux.intel.com, Arnd Bergmann , penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, Andrew Morton , vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, linux-crypto@vger.kernel.org, iommu@lists.linux.dev, linux-arch@vger.kernel.org Subject: [RFC][PATCH 02/12] crypto/ghash-clmulni: Use (struct) be128 References: <20221219153525.632521981@infradead.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C2CFF40016 X-Stat-Signature: uwt9tzdkckozy356qze7su7syfyynzfz X-HE-Tag: 1671464623-156691 X-HE-Meta: U2FsdGVkX19u/EISfFM1dZpDKgnVhou5alaCo5sRXV/0gbfPdW5ooowT7Ht+LBLQoJM28tQDJr4oWZ3VlNOasRX8R5HJykIS4ywD3wWJKHV73ZOS7+jf8egwG5EmPIELrPwbSDHtI+AbBGLHJKshhV2dWN+OCVUP5WwpjGZ0btOGVr+WeVI42ejuB5mr3W8+yNOdpmL2gV+Ym4sS6XaaPX98bpCQgGlHMVIt/kCalBcdFah6nDvAyxeVNMBze6QJCAwezVwOPSuwbvsluT+8+oAIMR5v8NIjy3RjJ1F4zaayPpYVuTQBP04Ooa/iLqB+LFty6mJy3pdjcZ0S956a4Ikgvf3jUB5xZ4yz05PXbi60f6DHPB8SILdRzjYeKDLVfXaAjFg8VvgNUnkGyrbbyJ9C92ezq2VoKANDzLNl7Aa7UQAc6xB+A8eubtiHuyshf7l56G4I8gTjjQkUs3hdz+E+EboBmduc6SLbgRW2mW92Ojat9CLxPzqn4QuRrPp2FrBhDRwbKRr9jwetocqZ+6CcNk98RV92XzXGbeRQbtXBnwzJdq9/9Pr7Q+2rxTdFKE+9oBLs8tQr7GzVAMa31zAaS0IdL1Y5YjrfG6UkqPdFq6narKs73UKSqrwvtisMRp6LbFITKJVBY92fojOD9l0PeF2pbMKaOqvXpw8AvlnJQtFw9aHxza1G9gkyCqu7Q7GsblHwrj2FwGiQ3+KzodsASLv+RR5DWJpPwmRbLlxl4vCOWuQGiz83YSO1RSefTHNXe3h/rrT71Zvl9nOYrvFTESSsuC+MyIAWaq7ONC2kOGPmBx3fbzuHW3zFUnjnbP5uBrNj6orNk+mxR/k4y50uDM1PCJ3Ft1yvJVw2BLCcKxbpt3XRPpaYtoHb4YqMqh/mWQ8ZWFIj21y3j+IfYxUFi9HXOtSzxgB7yAX6PPWotsK8flplVSHQKAe5RVVJTTmRAcqaRuMJDqDTZyc weQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Even though x86 is firmly little endian, use be128 because le128 is in fact the wrong way around :/ The actual code is already using be128 in ghash_setkey() so this shouldn't be more confusing. This frees up the u128 name for a real u128 type. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/crypto/ghash-clmulni-intel_asm.S | 4 ++-- arch/x86/crypto/ghash-clmulni-intel_glue.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) --- a/arch/x86/crypto/ghash-clmulni-intel_asm.S +++ b/arch/x86/crypto/ghash-clmulni-intel_asm.S @@ -88,7 +88,7 @@ SYM_FUNC_START_LOCAL(__clmul_gf128mul_bl RET SYM_FUNC_END(__clmul_gf128mul_ble) -/* void clmul_ghash_mul(char *dst, const u128 *shash) */ +/* void clmul_ghash_mul(char *dst, const le128 *shash) */ SYM_FUNC_START(clmul_ghash_mul) FRAME_BEGIN movups (%rdi), DATA @@ -104,7 +104,7 @@ SYM_FUNC_END(clmul_ghash_mul) /* * void clmul_ghash_update(char *dst, const char *src, unsigned int srclen, - * const u128 *shash); + * const le128 *shash); */ SYM_FUNC_START(clmul_ghash_update) FRAME_BEGIN --- a/arch/x86/crypto/ghash-clmulni-intel_glue.c +++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c @@ -23,17 +23,17 @@ #define GHASH_BLOCK_SIZE 16 #define GHASH_DIGEST_SIZE 16 -void clmul_ghash_mul(char *dst, const u128 *shash); +void clmul_ghash_mul(char *dst, const be128 *shash); void clmul_ghash_update(char *dst, const char *src, unsigned int srclen, - const u128 *shash); + const be128 *shash); struct ghash_async_ctx { struct cryptd_ahash *cryptd_tfm; }; struct ghash_ctx { - u128 shash; + be128 shash; }; struct ghash_desc_ctx {