From patchwork Sat May 20 10:49:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 96759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp295781vqo; Sat, 20 May 2023 04:17:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Z80gOdi6o8AvftwvNQp88GDwg88pnMVj3F+3qN/8xXCXJD3ecbxb2BvSNGiS2RTyx8hjJ X-Received: by 2002:a17:90a:2c4d:b0:253:2ee7:bbd with SMTP id p13-20020a17090a2c4d00b002532ee70bbdmr4675729pjm.11.1684581420682; Sat, 20 May 2023 04:17:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684581420; cv=none; d=google.com; s=arc-20160816; b=p2ULEIiysXrxtFN9gAtK3zk03HgwyAGI38+73BGqEcKJe98lmY4bjtAtWBNSPfXulb ySElx9W/wWFZIB1P1/ETBF1iPlpXFFq19YxG5qGR3fHWhNplUh0HKPWEJH5fafO+Q0RR z9NHogel7h8xAIf8xWj1D6ipwgUZRTP0NLMf2MfBV0Z/YIni1WO+XP2OnxzIv+LsYQLr yJBD6xjnm48/Bx8rTRt2atpPdmg3Vuk6WYMn+XXB2EdbdKPStpEYhpQnWnclFIvoKole 7YAsku4PPkNzE2HSFrrh1ytsg4+AwGN+VPSsn1gPhgSp+ZV4OEWMW+Y2mY8pTTViJ5au DtGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=aH2Ohb05YwZe/otHvSs0r1c79czQSc9dK7wj6jHNME8=; b=wb+g+BL+fdoDzxlK46Z5zql0HGG7ep/ZAb6yv8hUx2/OVTbVDiw9GBny9uT2bMNeRM +Kh1N4IAwZXrtrpQDP8l5KyDo5p9tOPYLjAscsTS/Rntd9pS37/8T2Wps4GuuS7rDGAJ LLdjqmtr2ouohP0xhridivMRqKbVy0jBOiDa6DfFZQH6AwaNTCyVEiT3a8Zk8p1tVdkp EWd9Y4rZYM0g8T2eIaepZmXf9OhJo1S63fGusgh8i9y3Gwe4St99JG6jXBg3ITSXB11j 0YGr/mpRr3xRv4713tBMWw4M1tF8tVrJSBM4oYlxqpkhcpy+79rvjMuQ2NDhLzmseal2 c/VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nTbaTzh6; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c4-20020a633504000000b0052c4296d8casi1421437pga.325.2023.05.20.04.16.40; Sat, 20 May 2023 04:17:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nTbaTzh6; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231645AbjETKtV (ORCPT + 99 others); Sat, 20 May 2023 06:49:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231409AbjETKtI (ORCPT ); Sat, 20 May 2023 06:49:08 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F9FBE5D; Sat, 20 May 2023 03:49:07 -0700 (PDT) Date: Sat, 20 May 2023 10:49:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684579745; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aH2Ohb05YwZe/otHvSs0r1c79czQSc9dK7wj6jHNME8=; b=nTbaTzh6aXgROOF+Hq16W3DA/QPy1SBux6oo0LAszaNFP5YuSVIFKEsljTfTy9f5OkGjEJ zDMWN8Uq7g8zioYdU+6O1whdUIlnRQQymmgQ3dgGHTCKD6KdJf3vP1TGkhDXW8dmicIQGr EfVdOmc1Mk95X2n3Bsal4/5PdMsXnyeAQuIQD0reX48E5grc/myy/m6e4PJnRwFnie6LAs YVsUgFIcZ2nwriPp+bgAiWalVturI+S6BAN4NgxYPydOgbG+kfa6ZR0ZKeGphp4Pa7+wlV 1TFUamOvkETkfWmKf8OL8N8NkmNUvwmaENjymo4gYpxT+zs5ePtopZke1/3asA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684579745; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aH2Ohb05YwZe/otHvSs0r1c79czQSc9dK7wj6jHNME8=; b=l//Iih+LaVgiukaUpZ0p6OjTkxEpnGBfKwQm1Kdrb0oS4SGiZnS3L4oSj6kobddtEE/glh EJwpkewjIaymQnCw== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] types: Introduce [us]128 Cc: "Peter Zijlstra (Intel)" , Arnd Bergmann , Herbert Xu , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230515080554.047618712@infradead.org> References: <20230515080554.047618712@infradead.org> MIME-Version: 1.0 Message-ID: <168457974454.404.3651021680456124884.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765946836020700411?= X-GMAIL-MSGID: =?utf-8?q?1766411647834860218?= The following commit has been merged into the locking/core branch of tip: Commit-ID: 1fbd899da7d7a5eb7dd81404d37342b4de95f48f Gitweb: https://git.kernel.org/tip/1fbd899da7d7a5eb7dd81404d37342b4de95f48f Author: Peter Zijlstra AuthorDate: Mon, 15 May 2023 09:57:01 +02:00 Committer: Peter Zijlstra CommitterDate: Fri, 19 May 2023 12:35:11 +02:00 types: Introduce [us]128 Introduce [us]128 (when available). Unlike [us]64, ensure they are always naturally aligned. This also enables 128bit wide atomics (which require natural alignment) such as cmpxchg128(). Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Arnd Bergmann Acked-by: Herbert Xu Link: https://lore.kernel.org/r/20230515080554.047618712@infradead.org --- include/linux/types.h | 5 +++++ include/uapi/linux/types.h | 4 ++++ lib/crypto/curve25519-hacl64.c | 2 -- lib/crypto/poly1305-donna64.c | 2 -- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/linux/types.h b/include/linux/types.h index 688fb94..becb8cd 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -10,6 +10,11 @@ #define DECLARE_BITMAP(name,bits) \ unsigned long name[BITS_TO_LONGS(bits)] +#ifdef __SIZEOF_INT128__ +typedef __s128 s128; +typedef __u128 u128; +#endif + typedef u32 __kernel_dev_t; typedef __kernel_fd_set fd_set; diff --git a/include/uapi/linux/types.h b/include/uapi/linux/types.h index 308433b..6375a06 100644 --- a/include/uapi/linux/types.h +++ b/include/uapi/linux/types.h @@ -13,6 +13,10 @@ #include +#ifdef __SIZEOF_INT128__ +typedef __signed__ __int128 __s128 __attribute__((aligned(16))); +typedef unsigned __int128 __u128 __attribute__((aligned(16))); +#endif /* * Below are truly Linux-specific types that should never collide with diff --git a/lib/crypto/curve25519-hacl64.c b/lib/crypto/curve25519-hacl64.c index 771d82d..c40e5d9 100644 --- a/lib/crypto/curve25519-hacl64.c +++ b/lib/crypto/curve25519-hacl64.c @@ -14,8 +14,6 @@ #include #include -typedef __uint128_t u128; - static __always_inline u64 u64_eq_mask(u64 a, u64 b) { u64 x = a ^ b; diff --git a/lib/crypto/poly1305-donna64.c b/lib/crypto/poly1305-donna64.c index d34cf40..988702c 100644 --- a/lib/crypto/poly1305-donna64.c +++ b/lib/crypto/poly1305-donna64.c @@ -10,8 +10,6 @@ #include #include -typedef __uint128_t u128; - void poly1305_core_setkey(struct poly1305_core_key *key, const u8 raw_key[POLY1305_BLOCK_SIZE]) {