Received: by 10.223.185.111 with SMTP id b44csp235395wrg; Fri, 9 Mar 2018 04:14:29 -0800 (PST) X-Google-Smtp-Source: AG47ELv9vWAKnPIDajy3ZMSn1WfttQx8sYND0nbhIi3vGApUu3YqeI7O4PgB0EBhF4RbZAAUjx/o X-Received: by 2002:a17:902:6b81:: with SMTP id p1-v6mr22553052plk.181.1520597669150; Fri, 09 Mar 2018 04:14:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520597669; cv=none; d=google.com; s=arc-20160816; b=Ldtch9EwF+nR9UHKKUddQ3+JJyuXuRy5UtZPz2XkUhL5rN9StRY7J6KFvlw4dG38rv 2otwyjZFPBMn9HLYBIVXip6LBt7kIEI2VR5hSfG8W4K/J28/G9FYYxwGi7Wq8LCv72X+ lNwMvUOrYmGw3wCPE/aP+Pj4Q+9PLWCeEtNv5NOLw7meSupbZYV7b7HbRKHfhcEcEHMm sUob4XR//0A1gyEGiTubmkCT1ep7rPHmIpI0dlgTaZ/QJIZ6trXYWrjlwj4dDR6bdTsp DAMr0SipkF/Ppc9fpqJhDhtCWHF08HQwZGDkYYqwt9Hfn+NiTmSgp6MHDdsPjjMvNVUP y8PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=CsFkOSsnA5vXWloonn8BEHAt285wfQwMuInGFACS4Ac=; b=0HNGXOtu4bgJZl+7IrvBVBA1WniITcYSMvp99PG1rPbRJIN+1QxuyfPpWfvVtRGoDk Yz+ExsKCLCra1S3XBvJ1ZaKQL21AmYeLH49+fgPuv8ucIHBqmhcS9MDHrupv0Jlous1S tOd8tptB7gbldOjp4A98cP8YiZP7OdOlt72bRhPbGJ04j1Z9VuFqqiem3UTDQXjIP2zo 41hde4Xvk+JQIYs3gxfncdDZfUseZGwAwHmYKk9yB0BKQq+zG8Nj6ND9u38vnhugrWCu 5Vz2yN4pZV3BP69ESw0+FYPwrrY7haEBolpZN0QjxI9SHXHcuvb5b06YRGasfM17eXZk WcPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HjCrlFOi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si783015plg.227.2018.03.09.04.14.14; Fri, 09 Mar 2018 04:14:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HjCrlFOi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751182AbeCIMNP (ORCPT + 99 others); Fri, 9 Mar 2018 07:13:15 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:34809 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751122AbeCIMNN (ORCPT ); Fri, 9 Mar 2018 07:13:13 -0500 Received: by mail-wr0-f193.google.com with SMTP id o8so8831784wra.1 for ; Fri, 09 Mar 2018 04:13:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=CsFkOSsnA5vXWloonn8BEHAt285wfQwMuInGFACS4Ac=; b=HjCrlFOiorYFpH9Hhx6AbrVLpRlhQpVwvctuqPH3kCbMpIl6DqgMiOPZ+EeNpn3/NW 73tnUeUUU0KgPl2QcInYTqizzLwULziwyAAR+a5xgm8O3vBNoxtDhvEPGckI1ipG0vuO JVLNEwpgys/BloHRdwOMQBFo7zC1Sxkhc6UaBm28L3ie6wvNGcug6NUhLBq0gtg2Ymya 5BN694p46wYqkuHt6edhfmwUqcwkLg4I4dDT9P9SbAYrKfzHl6rcFqaKHYI3nDEya51c DcVHBMoE5pF9VMgsrckOtPlz9SlyR6g9/QzDzsIqGgTQPhhaKAtux66eQDCgQRSMLuef 4jpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CsFkOSsnA5vXWloonn8BEHAt285wfQwMuInGFACS4Ac=; b=XzfitoriMYCeeHJJ/ZjVnKSK0IGWUU6s+CFl3HeMWqMzIuvRANhGuGcL3z6IPfVISw 4j/kQ12aigmCE7jgC3RFdaBbE7q3QzX38LGhPGm/Am4bALhSABfbQmM3CF5By8m0/44d lzRX4QQbcC1hFhwvtJnm0MOvmgjbbOPY+rE4OSQ3Y8XDi7aheG3VsSpoxon1tOWMpn1U 6zQthbTPmdjv4ei0gUj2D2cvx5vyl+zrYu4MIwibkSY6CXG/Gwa+aX7lnWsSer2RnZYl w4Nb0g0ED+IruNRaHpVVoXaPaGtmHNKOIb8Jjn0Ru4sKVBEuJzts40JzZqLiwZVsH3Ea E/3A== X-Gm-Message-State: APf1xPDJouoUE6on0MgFzGAAoMORcwuaGNm0vsFoD07WTA55CqDUX1It nTu3scq5H5F8KWU/+bci3jM= X-Received: by 10.223.182.16 with SMTP id f16mr24992532wre.51.1520597592303; Fri, 09 Mar 2018 04:13:12 -0800 (PST) Received: from andrea.amarulasolutions.com (85.100.broadband17.iol.cz. [109.80.100.85]) by smtp.gmail.com with ESMTPSA id h1sm716111wre.16.2018.03.09.04.13.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 04:13:11 -0800 (PST) From: Andrea Parri To: Palmer Dabbelt , Albert Ou Cc: Daniel Lustig , Alan Stern , Will Deacon , Peter Zijlstra , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , Paul McKenney , Akira Yokosawa , Ingo Molnar , Linus Torvalds , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Andrea Parri Subject: [PATCH v2 0/2] riscv/spinlock,atomic: Miscellaneous fixes Date: Fri, 9 Mar 2018 13:12:39 +0100 Message-Id: <1520597559-16547-1-git-send-email-parri.andrea@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, The series is a follow-up on the discussion in [1], which led to the discovery of a few issues in the current implementations of RISC-V locking and atomic operations. In summary, this series proposes the following modifications: 1. Use lightweigth fences for acquire/release (locking, atomics) 2. Use the combination of .rl and full fences for fully-ordered atomics implemented with LR/SC pairs. 3. A few style changes (80-chars lines, alignment). Applies on top of "next-smp_sl_ar". Cheers, Andrea Changes since v1 [2]: - correct implementation of atomic_{xchg,cmpxchg}_release(). [1] https://marc.info/?l=linux-kernel&m=151930201102853&w=2 [2] https://marc.info/?l=linux-kernel&m=152027423529883&w=2 Andrea Parri (2): riscv/spinlock: Strengthen implementations with fences riscv/atomic: Strengthen implementations with fences arch/riscv/include/asm/atomic.h | 417 ++++++++++++++++++++++++-------------- arch/riscv/include/asm/cmpxchg.h | 391 ++++++++++++++++++++++++++++------- arch/riscv/include/asm/fence.h | 12 ++ arch/riscv/include/asm/spinlock.h | 29 +-- 4 files changed, 615 insertions(+), 234 deletions(-) create mode 100644 arch/riscv/include/asm/fence.h -- 2.7.4