From patchwork Mon May 22 10:27:29 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: 97252 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1353186vqo; Mon, 22 May 2023 03:52:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ55wLFFdQHvxeKwKX8qTwkSh0pxwoBrIl80IlIpeX71XDr7PVLu4vD3SESeTJeSVsr3/SRw X-Received: by 2002:a05:6a21:998f:b0:10a:c0cb:43ea with SMTP id ve15-20020a056a21998f00b0010ac0cb43eamr8994234pzb.49.1684752740969; Mon, 22 May 2023 03:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684752740; cv=none; d=google.com; s=arc-20160816; b=Qba7VJDNekioi+Pf3ZvswCLuY9va8dlmtnER6Cg3NwglhUVIm/qpzHi0xm2HsX6/h0 IFVGtmA3MEtoIyKxgq66g6+PDXaoer6O02Axs8wiEzp9p/eJRmYtDMvgiOgISySGkjyc b/MYNNscOTITIfu7ZbxeZ4i4aoYpXyJzJj2H1B1cCYLoIK0Arg9lRvHgtgq27f+vBEu5 n8p5LYGHSA7H+01B90THwGYQTEUTngW97kEwNBp6Piv79PEfoGa3ojzvjPUCkpwWEv7I LkKLB2TYGQpYvFxoPqcrham9MUA49PJ1R0LYSjZ8ExWOv1Wn1C7XcVA8Nr9jeXMPX+DC GNQA== 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=WDmzPHq8N8NLyDm473tmWBhjWYbFtWVCH+cMOEV25O8=; b=pUaQAOxivsUOEKXbbKYsWuoRsZDgkBcwugeAVGtu+kxSKeGrmZpwkskL5CMi6jHBF8 7SMMhZVjjJ1v3QATmTnGvJapNshd2WwWsHqMtj38VKC4ihBv16SjbI57oiozTjNJILNW aD03G5Avp5IBR+0xvQWK32nfiW/kY5re6zIeLEgYT8Twn1VYarTIvxdSONnq+hvAcZem WINJpqs68VFr5JSAD0gZFZZKxGfSJQrfOEGuuaKYgPVqRXBzAV0bhW9aijzolaxricPO gnH1nxt23ia2mdwZ7KzCXt+QTEWhYsTtStyAu8J3aCcOFtOk/CkfIUKSBqGw4//Wgr+7 IJww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TVHAfJ3c; 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 q17-20020aa79831000000b0063b8685bab4si4602859pfl.113.2023.05.22.03.52.06; Mon, 22 May 2023 03:52:20 -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=TVHAfJ3c; 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 S230238AbjEVK2U (ORCPT + 99 others); Mon, 22 May 2023 06:28:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232775AbjEVK1f (ORCPT ); Mon, 22 May 2023 06:27:35 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EEEDE9; Mon, 22 May 2023 03:27:32 -0700 (PDT) Date: Mon, 22 May 2023 10:27:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684751249; 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=WDmzPHq8N8NLyDm473tmWBhjWYbFtWVCH+cMOEV25O8=; b=TVHAfJ3cPOjyAVyiAxmmzL95ZrIZRohZQyJuU6hm6O1dd/AqvNSC4RDKkRaOs6VG7R8VCH EcnU0whnWYUH1EUH0MHkOAweIkYBtwNI6uLjbKuKaYB3mH9ss2ow4wkhlzMi1qqMCk32Hb XYiA+XdR+6i993EWOt5PWHqhye9AxL14VfE9XdhH3I7myxVG2sHP4SNQZR/KsXgNWY5nzI ovp3jPATmYCzWCKZWV54BtIr4+WOYBxXdcaqQm4gntY2szr0AiVHagowMcMEilHpBcgrMR dmHutiGhwnAbH/c1Vj74x7iq5Ggq7H6KLgs9p1h5g9vFs8BsWFMVbcZcFgLCVA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684751249; 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=WDmzPHq8N8NLyDm473tmWBhjWYbFtWVCH+cMOEV25O8=; b=Sn+meX4fYPiRhpV9+eTTPatSU/tVommJhJZ5mH1RVfY5vnjhEv/pgYfIYo1xeWgOVFhaXh DTapTO2kIfaFAlDg== 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: <168475124922.404.17464873847581624680.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 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?1766591290144858339?= The following commit has been merged into the locking/core branch of tip: Commit-ID: c8c216a63fe28b247046a15e995688289ce416ad Gitweb: https://git.kernel.org/tip/c8c216a63fe28b247046a15e995688289ce416ad Author: Peter Zijlstra AuthorDate: Mon, 15 May 2023 09:57:01 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 22 May 2023 10:49:49 +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]) {