Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1501924rwo; Wed, 2 Aug 2023 15:29:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlHGyZg8O/GYkr0c8WC9aJgm0C9RXSXxqbmHjF9YAsqW3U8qUVM2T/PuW8Yol6G04uPiNrww X-Received: by 2002:a17:906:9bc4:b0:994:34a6:50cf with SMTP id de4-20020a1709069bc400b0099434a650cfmr6244925ejc.49.1691015391283; Wed, 02 Aug 2023 15:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691015391; cv=none; d=google.com; s=arc-20160816; b=qE0I10Pae7uWkDYSekrbOTd4z7ltjwU/p6XpFSC3NaXN5TySJ/U0UpJwuGNLfo03RG I//g5NFVcpUAXZDyUsfQsGRG5XFRezg18C4MSbz/i92HwmIVelSmflpf2z7oO/imZxNi D8l+CDm+O+tX6s86bXd09s/FqcXKFm6ycoNtzFW1X5AFrAXHVbZwh3kPQgoX8Jim0Jz/ VJwD/iLINK2yc/KPhad42qoRarDcUgMDybTPgUEsbKiGWeUahwnU/kuFyQWmZQ/8weo4 vmMMrI7CK4WTor5dJSY8V9pOv/Q4SOw6jY8Boqt8LWAvCwzqlApkWUQSvxkMFdSfL7SW x/jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=WPlGYk9DpKaFa+HTTbJErYVJ3cCFtjdP9KNGf5Y9bG4=; fh=UeP/h+b0ySGzsj2DmlA86+WGv4DkE0TJUoETcWbRv3E=; b=do/ds/NLJmmbzB4hksP6tyfOqx0idvPxmz+s7aNIehUfcBRIRgZdH/4JfFbe+aVPvJ 6PeEyJKB02p6i0IojoIidsSUoo2lo8E2Y8zYycwyPod+RGETW1wAJShqSvW1XJX/4P1e PLijqUStq/cPAAXNiFlf+I2//e1/PDSCW6XBRrGZo0gdP8G9JFF6KpY2RGR1NIW9ZVOc QdRwEkTDL1m1AKHMszSZXnDGpHx3hPKm1xow1fmD5IMN+wKDHmxz7tsRNYIED2g1wntM OmIGxeOUKTEKc3hcINGCX4HsF473gZtSK2N9fSqbDt0WEbVxRVDbA9shRlIEkyK4MHSc l23Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RqZ97bHS; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q24-20020a17090622d800b00997bd42d213si11022060eja.165.2023.08.02.15.29.27; Wed, 02 Aug 2023 15:29:51 -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=@redhat.com header.s=mimecast20190719 header.b=RqZ97bHS; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232803AbjHBVwg (ORCPT + 99 others); Wed, 2 Aug 2023 17:52:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbjHBVwe (ORCPT ); Wed, 2 Aug 2023 17:52:34 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 230F8173A for ; Wed, 2 Aug 2023 14:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691013113; h=from:from: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=WPlGYk9DpKaFa+HTTbJErYVJ3cCFtjdP9KNGf5Y9bG4=; b=RqZ97bHSSghDu+VYEt8CYCKqN5PwJPMK74twspl+bR9rfo3G4ATNl1P2YC9XzpVQWYgABt s2Kd8K/YIiV/juziaQ+ZEbloooEy+4fSL0fROpbekVCfxVZPRyC/SWqondFYNfTMyYWFFd i8F4Ig9e40zBqyw1X/iJv4jNo80HCHc= Received: from mail-oa1-f71.google.com (mail-oa1-f71.google.com [209.85.160.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-528-CprmSLwzNm2C9bIAbj1Gyg-1; Wed, 02 Aug 2023 17:51:52 -0400 X-MC-Unique: CprmSLwzNm2C9bIAbj1Gyg-1 Received: by mail-oa1-f71.google.com with SMTP id 586e51a60fabf-1bb67d16387so278331fac.1 for ; Wed, 02 Aug 2023 14:51:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691013111; x=1691617911; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=WPlGYk9DpKaFa+HTTbJErYVJ3cCFtjdP9KNGf5Y9bG4=; b=ZsgIHZKUvDNXuFQccEJVKLzxWo3xsKhs8YbjOveNDmVnPi87fsFIGKRDmiTCdbNHyq FX7ycXZLgaBmuyLlJI7KxCG1dci3NNUmBqtnOQPB2KkcIL7R+ZcBqxe+DfRbQEatjW03 QTawAk89TtrIyz0oznE9mR60xkRu990jmANyFEXpf6gKAW7jYmvNOjIVk8nDoN5zotHY 4nG9A278KtK0HVA+hh4ocBZu1yAxLiArdWh5eXZomWOdl8UkqLFa1IEIfr3nYQd7oenY MA9YR4NoQKooTM/oYNqSKDqCy91kAMheadeF+YFFajBw5a8eqoyinSgoEc9ExU+FSyR0 0KBw== X-Gm-Message-State: ABy/qLY6a6ph5mexjjTMXcjlbyCIsK5fhH4IHUnuEFy6CuZ1QVY6LXMd ivuBKahOOEUuFboxgM6qlGrNkuHBfmLnsJVI7JeaXsW4nOCHblUpn8lbd2llkLT8CwvFTxgxd/b rlTqxT7d5Yx554FXOerLFxMkr X-Received: by 2002:a05:6870:e2d3:b0:1b0:653a:af92 with SMTP id w19-20020a056870e2d300b001b0653aaf92mr17824511oad.8.1691013111442; Wed, 02 Aug 2023 14:51:51 -0700 (PDT) X-Received: by 2002:a05:6870:e2d3:b0:1b0:653a:af92 with SMTP id w19-20020a056870e2d300b001b0653aaf92mr17824507oad.8.1691013111247; Wed, 02 Aug 2023 14:51:51 -0700 (PDT) Received: from ?IPv6:2804:1b3:a801:d380:694f:4f52:764c:4b7f? ([2804:1b3:a801:d380:694f:4f52:764c:4b7f]) by smtp.gmail.com with ESMTPSA id v2-20020a4a5a02000000b005660ed0becesm6759353ooa.39.2023.08.02.14.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 14:51:50 -0700 (PDT) Message-ID: <2f301cd6c4009248c5eb6af00f12f36f3127ca10.camel@redhat.com> Subject: Re: [RFC PATCH v1 0/2] Deduplicating RISCV cmpxchg.h macros From: Leonardo =?ISO-8859-1?Q?Br=E1s?= To: Andrea Parri Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Conor Dooley , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Date: Wed, 02 Aug 2023 18:51:47 -0300 In-Reply-To: References: <20230406082018.70367-1-leobras@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,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 On Thu, 2023-04-06 at 19:19 +0200, Andrea Parri wrote: > On Thu, Apr 06, 2023 at 05:20:17AM -0300, Leonardo Bras wrote: > > While studying riscv's cmpxchg.h file, I got really interested in > > understanding how RISCV asm implemented the different versions of > > {cmp,}xchg. > >=20 > > When I understood the pattern, it made sense for me to remove the > > duplications and create macros to make it easier to understand what exa= ctly > > changes between the versions: Instruction sufixes & barriers. > >=20 > > Thanks! > > Leo > >=20 > > Changes since RFCv3: > > - Squashed the 6 original patches in 2: one for cmpxchg and one for xch= g > > https://lore.kernel.org/all/20230404163741.2762165-1-leobras@redhat.com= / > >=20 > > Changes since RFCv2: > > - Fixed macros that depend on having a local variable with a magic nam= e > > - Previous cast to (long) is now only applied on 4-bytes cmpxchg > > https://lore.kernel.org/all/20230321074249.2221674-1-leobras@redhat.com= / > >=20 > > Changes since RFCv1: > > - Fixed patch 4/6 suffix from 'w.aqrl' to '.w.aqrl', to avoid build err= or > > https://lore.kernel.org/all/20230318080059.1109286-1-leobras@redhat.com= / > >=20 > > Leonardo Bras (2): > > riscv/cmpxchg: Deduplicate cmpxchg() asm and macros > > riscv/cmpxchg: Deduplicate xchg() asm functions > >=20 > > arch/riscv/include/asm/cmpxchg.h | 319 +++++++------------------------ > > 1 file changed, 67 insertions(+), 252 deletions(-) >=20 > LGTM. AFAICT, this would need to be rebased, cf. e.g. >=20 > a8596dda1fbf7e ("arch: rename all internal names __xchg to __arch_xchg"= ) >=20 > from the tip tree. >=20 > Andrea Thanks for the heads up! I will update this and re-send! And sorry about the delay :( For some weird reason neither the cover letter, nor your message reached my gmail, and just now looking at lore I could find your message.=20