From patchwork Sat May 20 10:49:00 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: 96752 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp283980vqo; Sat, 20 May 2023 03:51:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7q7JCUua2w2/FHtlUecgSnQHYgDEkn/1Hf6ydbRgqjsOAN89J8vB2hNv8IlX88b/ml2EzH X-Received: by 2002:a05:6a20:d805:b0:104:c2c:52ed with SMTP id iv5-20020a056a20d80500b001040c2c52edmr5056733pzb.34.1684579898586; Sat, 20 May 2023 03:51:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684579898; cv=none; d=google.com; s=arc-20160816; b=SZ8OEW+iSkwj/CJxdohKMBC5uxHgrx2uZWO+JJm+pG4COTnGVgZ+0hJD5EMyiEKyQV xmHHjxRGVlY9iipVQr0uxbsfV4CE+ihzHl7NgKgwzEdVXdwns1VfBzDPfj5E8c7k1xfZ wd+Z5HJNB4KkNLms2vApUIiCoLNRkrvkqkOuVjD0YuFCwJIGFUUS8fWVz1iiUlazpN4M mHXozcke/u7SJkftOVm2aM4mo3czXitSsiIGr5Xnuea3fbsEs4mRpRnhmT7/5SMSPGXr lbaMox8d+yuyYKaLA825fHgQiMO3YbPpeK6QRT9jhPwEtrXRavythoCaQ8ItNnm4NAqE W6YQ== 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=cPLgs9688f7qR4gd53HIiO9RQxgYGUDHWdJpOUX2Fds=; b=wsdh+kid7lC/FUflx8bFFxTAlDVtH6ebdWp/UdqZUuPzXIJrFs12VY7hCysoMhml+o N1P608nwTDSQnLjFgqQz55uhJQ27YX+V+WzNa4V9j9XVQ6Xyo1Ak+ZzXxdRSFM4o8h3+ YQZtabP1jumZ1/IVVGyeCnW4pjmQ94cq/sn5lVfQo4F8m2j1FWosAfQZ1gpECJBXOskm fu5pVgFyTDbTwRyxIIhMTgEJp8W7sP2PxWf4kYDWDBIV0K2kvnniOvLVq6ZTztLqe5sJ 5Z87QU6tI8KEVTYM+NVKAVb5E/8ithVAmfDXcZsS0Y9osMl0/ahUqLjMSSJx4L+0XHaX 17sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="HP/2rZKg"; 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 o30-20020a63731e000000b0050b508f68d8si1333001pgc.206.2023.05.20.03.51.24; Sat, 20 May 2023 03:51:38 -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="HP/2rZKg"; 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 S231281AbjETKtH (ORCPT + 99 others); Sat, 20 May 2023 06:49:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbjETKtF (ORCPT ); Sat, 20 May 2023 06:49:05 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 350D1E52; Sat, 20 May 2023 03:49:04 -0700 (PDT) Date: Sat, 20 May 2023 10:49:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684579741; 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=cPLgs9688f7qR4gd53HIiO9RQxgYGUDHWdJpOUX2Fds=; b=HP/2rZKgZZLax1TvoIrTLj3MKiAz/rEXkN/KWqAnqy0FAJfr4JKlf/qduS0CBUMsQ19PXc F7kEJJx+go8TXH1zuRcSg/IItRBIAx/Rgk/f9MaJGPCBXWDxQB49uxzzOeWshkP6tdKYld iLiAUtxDzUMhfW669VWE79TcTBf3eOVXeVkITlF0SjNUGRksxO5Z6G/HjSZ9xxyte4DAoM pOeqG8I+MU4s6Gcr5kkHbEqHyG6Bne/T6pvaYDQYEvnkFMUAdcrI2hAk8hAQCy7Vwg3n9A hOStRAWo4PFUtO4HdShxCgJlY3HutLBuysmHPypSWxqCOcGPMfxG5ugnFwBhNw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684579741; 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=cPLgs9688f7qR4gd53HIiO9RQxgYGUDHWdJpOUX2Fds=; b=z43g199Ys9pJoGH7NcsSoBlaWjNbLHWe75NIZ2q33+OvPr4YTsVoDE7GD6NMjZOaiICrUw yFnp2VBvsGF5rhDQ== 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: <168457974010.404.13588891713487239670.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?1765947845002250403?= X-GMAIL-MSGID: =?utf-8?q?1766410052027998008?= The following commit has been merged into the locking/core branch of tip: Commit-ID: 71af29d0671b5bd38846176fb48f31152a026925 Gitweb: https://git.kernel.org/tip/71af29d0671b5bd38846176fb48f31152a026925 Author: Peter Zijlstra AuthorDate: Mon, 15 May 2023 09:57:10 +02:00 Committer: Peter Zijlstra CommitterDate: Fri, 19 May 2023 12:35:15 +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; }; 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; }