From patchwork Mon Jun 5 07:42:48 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: 103161 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2513829vqr; Mon, 5 Jun 2023 00:45:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4yutiCSkJJlzWYmVaFHSo4oizAkFBvhdNDw7e0hSXgAJoR/sfKdTJIB+mDPReGzmWD8blo X-Received: by 2002:a05:6830:135a:b0:6af:7a06:fb5b with SMTP id r26-20020a056830135a00b006af7a06fb5bmr9573203otq.12.1685951135231; Mon, 05 Jun 2023 00:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685951135; cv=none; d=google.com; s=arc-20160816; b=phsByp2EkFdSGv17BoyN05INH67QrsFg8CSrBec8lywFL/OxYYK06XMUKu+NKa+wX3 nEETcCl9+YCMpw+qqruhAeEOLqv2wtQUaBRzkNTUpCBH9J/6C9jY+WlSMIIq/sVdE6Kb i2rms/1F8eBPZidxXA95NturRhrxC0MLb/wDkvWsbqXRODE8u9wP3EBnLrxWIwPXgzTL QBlSEoJb+A7Z3rcdn8TI1VWIR8C/WdH7bwysI7K0KCWPfYn7z9XBnwKd0NxUHKdHIP8Z p82CmgZtiHD+6Eh8RJGECcJpwtWYKWexnJmnQaXHc91CR+/0YC6DVPKzgxB2wRpAIhQm JpfA== 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=8T43z+bFqrRPOUXgVLPudvMYdsUzhzBF2ToF+rDkcbE=; b=E4eNo0uQMMLF7PRmsUNTqDYL7JRRj5E9ZVunAvWoqv/16GDWW7/ebUuqwu9WjdpiRw c4dDNrUCIvQHPyqUqi532SdcQprSPkbN5YeZrEtrq/g3AH8eOcr4bw1AxY2X5gumrjls 68n0AB+m6r1rOIDFVPS45BQFlgPtuJsVsO/x3pwzDedRlE/7Pszv35SeteR3nkZSJ35F 1qeCQFph4xTBN79EDvrZXlNkN0h/Vo3gapeAmKFZ4137+js8oJTMUfjjLXBHtVw4aF25 +RZDRVYRwNl59HJa+GVUEBiYGvbIsSYmw1o/pjTfCsuqTSbJl5RGFV/V8ksz3y3GAc41 n09Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=k+JRjJWZ; 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 d64-20020a621d43000000b0064d2c1fb45dsi3080088pfd.154.2023.06.05.00.45.23; Mon, 05 Jun 2023 00:45:35 -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=k+JRjJWZ; 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 S230296AbjFEHm4 (ORCPT + 99 others); Mon, 5 Jun 2023 03:42:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbjFEHmw (ORCPT ); Mon, 5 Jun 2023 03:42:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0478BA1; Mon, 5 Jun 2023 00:42:51 -0700 (PDT) Date: Mon, 05 Jun 2023 07:42:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685950969; 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=8T43z+bFqrRPOUXgVLPudvMYdsUzhzBF2ToF+rDkcbE=; b=k+JRjJWZYDHO8aSZk4mVFZs10Ppnu55n5ORmUKT3QxmKJ6gPFgDNZTCKoHgXjZEL4qRO6v xOeFWxWieviw497UuJ6pSqRdTkXF3vcLd5ZBtDXGV2HoahVrZtYbiE9uUrbbBcF7nOBW4h 2jorB4PPC0xgU4z30gHxTRavuxDmR0O4Qqnu06nk84YCA/Ezzjjh+dhpb0qGfi0mZyYf7V 7oHi3V08jXY9jfT+oiYrgCqdptmOh0OypGtxybcq9I0zUiK0NP/rWIke+2x5/Bb2ELBVqr 5B2VlVF1im8cVdl7ABmjeXjlJAsQwmZfcCsOEnjxqRW9lK7U/HMdveDeCydJqQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685950969; 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=8T43z+bFqrRPOUXgVLPudvMYdsUzhzBF2ToF+rDkcbE=; b=hppRXyoRQfwdRpJcCrmaHcvWhk/jGFRDDyLB9maJc1r7e8ayq3x2fmPB/dXMV3M/6ExQID RQEoCsLrPW+0CwBQ== 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 , Mark Rutland , Heiko Carstens , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230531132324.058821078@infradead.org> References: <20230531132324.058821078@infradead.org> MIME-Version: 1.0 Message-ID: <168595096882.404.380408005160138313.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?1767417394990419153?= X-GMAIL-MSGID: =?utf-8?q?1767847897251768728?= The following commit has been merged into the locking/core branch of tip: Commit-ID: 497cc42bf53b55185ab3d39c634fbf09eb6681ae Gitweb: https://git.kernel.org/tip/497cc42bf53b55185ab3d39c634fbf09eb6681ae Author: Peter Zijlstra AuthorDate: Wed, 31 May 2023 15:08:45 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 05 Jun 2023 09:36:40 +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 Reviewed-by: Mark Rutland Acked-by: Heiko Carstens Tested-by: Mark Rutland Link: https://lore.kernel.org/r/20230531132324.058821078@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; }; struct hws_trailer_entry { diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.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 *event, unsigned long *sdbt, } } -static inline __uint128_t __cdsg(__uint128_t *ptr, __uint128_t old, __uint128_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 *event, int flush_all) new.f = 0; new.a = 1; new.overflow = 0; - prev.val = __cdsg(&te->header.val, old.val, new.val); + prev.val = cmpxchg128(&te->header.val, old.val, new.val); } while (prev.val != old.val); /* Advance to next sample-data-block */ @@ -1562,7 +1552,7 @@ static bool aux_set_alert(struct aux_buffer *aux, unsigned long alert_index, } new.a = 1; new.overflow = 0; - prev.val = __cdsg(&te->header.val, old.val, new.val); + prev.val = cmpxchg128(&te->header.val, old.val, new.val); } while (prev.val != old.val); return true; } @@ -1636,7 +1626,7 @@ static bool aux_reset_buffer(struct aux_buffer *aux, unsigned long range, new.a = 1; else new.a = 0; - prev.val = __cdsg(&te->header.val, old.val, new.val); + prev.val = cmpxchg128(&te->header.val, old.val, new.val); } while (prev.val != old.val); *overflow += orig_overflow; }