From nobody Sun Feb 8 12:19:19 2026 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 CF017C77B75 for ; Mon, 22 May 2023 10:27:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232825AbjEVK1u (ORCPT ); Mon, 22 May 2023 06:27:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232839AbjEVK12 (ORCPT ); Mon, 22 May 2023 06:27:28 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A91C013E; Mon, 22 May 2023 03:27:26 -0700 (PDT) Date: Mon, 22 May 2023 10:27:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684751245; 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=QyoEJscqttA4sWRI20/kiCjpEBVOAmv+DBGxIn4KKCA=; b=hdkdGh31dIvHo/ZCBJHJE1Rw+bbnVsvChIA6M2zpHxUGu6GiZ6amqMMnphXnN61C/ndE7N Ge5wn0zBAU+SqMiUww4vUCFENYoR+WhR3hTMsOygiZnVEdtIJJeHDLwdtmcKP+zaXaR1+G IiIyDztjlzuEtEbLghgREqoz8k/GjWskW0hCXhWKrz1FtsenzUcLFuPHE852/bBarLn2n2 RfmuI0CUsUO5YlsOhckPLI5DtFXM0fpeMgtzsycz135F3B5g/awXcwsou4WqO0Nv+dGrsO IjHHpOBBfIKnJ1esf7XTTe7sVDr2HAnqDG0b/RQaUtOczqcWtS6Hi9+jRWCgDw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684751245; 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=QyoEJscqttA4sWRI20/kiCjpEBVOAmv+DBGxIn4KKCA=; b=PA/grkZfwT3sf7vS5+jW0GqRNtjjE+cFvcyotJNdWrLKLly2kFyURnoGFwTtJ6f+UUJUjC 5F4bNnfSDru4eqAw== 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] s390/cpum_sf: Convert to cmpxchg128() Cc: "Peter Zijlstra (Intel)" , Arnd Bergmann , Heiko Carstens , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230515080554.657068280@infradead.org> References: <20230515080554.657068280@infradead.org> MIME-Version: 1.0 Message-ID: <168475124454.404.7157778737320291304.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/core branch of tip: Commit-ID: 3cf363a4daf359e8392b5048c619b7e9e429f122 Gitweb: https://git.kernel.org/tip/3cf363a4daf359e8392b5048c619b7e9e= 429f122 Author: Peter Zijlstra AuthorDate: Mon, 15 May 2023 09:57:10 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 22 May 2023 10:49:51 +02:00 s390/cpum_sf: Convert to cmpxchg128() Now that there is a cross arch u128 and cmpxchg128(), use those instead of the custom CDSG helper. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Arnd Bergmann Acked-by: Heiko Carstens Link: https://lore.kernel.org/r/20230515080554.657068280@infradead.org --- arch/s390/include/asm/cpu_mf.h | 2 +- arch/s390/kernel/perf_cpum_sf.c | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/arch/s390/include/asm/cpu_mf.h b/arch/s390/include/asm/cpu_mf.h index 7e417d7..a0de5b9 100644 --- a/arch/s390/include/asm/cpu_mf.h +++ b/arch/s390/include/asm/cpu_mf.h @@ -140,7 +140,7 @@ union hws_trailer_header { unsigned int dsdes:16; /* 48-63: size of diagnostic SDE */ unsigned long long overflow; /* 64 - Overflow Count */ }; - __uint128_t val; + u128 val; }; =20 struct hws_trailer_entry { diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_s= f.c index 7ef72f5..8ecfbce 100644 --- a/arch/s390/kernel/perf_cpum_sf.c +++ b/arch/s390/kernel/perf_cpum_sf.c @@ -1271,16 +1271,6 @@ static void hw_collect_samples(struct perf_event *ev= ent, unsigned long *sdbt, } } =20 -static inline __uint128_t __cdsg(__uint128_t *ptr, __uint128_t old, __uint= 128_t new) -{ - asm volatile( - " cdsg %[old],%[new],%[ptr]\n" - : [old] "+d" (old), [ptr] "+QS" (*ptr) - : [new] "d" (new) - : "memory", "cc"); - return old; -} - /* hw_perf_event_update() - Process sampling buffer * @event: The perf event * @flush_all: Flag to also flush partially filled sample-data-blocks @@ -1352,7 +1342,7 @@ static void hw_perf_event_update(struct perf_event *e= vent, int flush_all) new.f =3D 0; new.a =3D 1; new.overflow =3D 0; - prev.val =3D __cdsg(&te->header.val, old.val, new.val); + prev.val =3D cmpxchg128(&te->header.val, old.val, new.val); } while (prev.val !=3D old.val); =20 /* Advance to next sample-data-block */ @@ -1562,7 +1552,7 @@ static bool aux_set_alert(struct aux_buffer *aux, uns= igned long alert_index, } new.a =3D 1; new.overflow =3D 0; - prev.val =3D __cdsg(&te->header.val, old.val, new.val); + prev.val =3D cmpxchg128(&te->header.val, old.val, new.val); } while (prev.val !=3D old.val); return true; } @@ -1636,7 +1626,7 @@ static bool aux_reset_buffer(struct aux_buffer *aux, = unsigned long range, new.a =3D 1; else new.a =3D 0; - prev.val =3D __cdsg(&te->header.val, old.val, new.val); + prev.val =3D cmpxchg128(&te->header.val, old.val, new.val); } while (prev.val !=3D old.val); *overflow +=3D orig_overflow; }