Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp211793rdh; Tue, 13 Feb 2024 14:38:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXtEjkE6S/KkAfuUemum1NcBICk03fgwvXzolt+m0jGX/+wWxcVyYtO9bzeAHGbPhq4Ohc1QAgmx+PxWBvsCghIsB/SrP8dzUtD8Uxfow== X-Google-Smtp-Source: AGHT+IFZbdiKBFPLKENkxrZjxRqaOJwI+6SqxbphTJkhdBNdEO7CcKJC4MOx/X77FK3nP6xD8Bux X-Received: by 2002:ac8:7fd3:0:b0:42c:67fc:e46c with SMTP id b19-20020ac87fd3000000b0042c67fce46cmr1029053qtk.17.1707863906901; Tue, 13 Feb 2024 14:38:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707863906; cv=pass; d=google.com; s=arc-20160816; b=0gPq9KWw7qSFBYrOsJ5PLukcr/HFZgXzVpV3WWflg+N/m7DND0Bjoz5HqBbtzRpmh+ AYH5s8O08KVfT35i9zNFEP4p+qFIR8C8/jznc2taNnLhX7AK8OR4OIUU+OzmSwovrMk/ afOxirFn1kAPrwoQGPh8YdAiUtaMLMA1VsmjDt9Y2PjGfYGJWoRZsTlMjOcYHIFUy9gG RbkdxYh2h9RFV9uHbawJLialNXGjN4yVOoCrK7x5pzdlMrBYig0aRgSynhHygtAGa0s6 pJab6C4yHZEtu7FDiSKvfoLV0fcKD7cEF6CWhDS3IU4JeZgawiUSHnbG+4YH+CHCnb+p nC4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=CfHqPDKZSILy8wF93jY+PBQlYR8jUuDqYcw6uvluZVk=; fh=PAsZQJ7VKvk3TadODDlRQn7jvT+8oaipSzwZPqz1n/g=; b=e23mculd6o3L+udXo+teyI9zvUx4pqf4dz87vGjXRqj/g1JT6VZNGvsIrcQZjB2iIf vZhU2Q0WirwTBWQ+Uezz29pbWzC+T8fFzuiEvEyT+aeXLpsbTR24sj6KNw9tAVmbmiCb PbUkcZ158gvOGPTpb7XX3ygdycsYNAfnN25tCTZtqeeJH1MZ8a+zViiTOBccqdUF2ESz nJeTGxfMdz2BmfelOn6IhtUaquAJuCnaFicCVfvTIEobaBt/7tdDWCaabrfuuez3n3Uz +XJlII2QBwGcshMiAdO3tzd3LNTIdh4+tpLMwDaCpZPL2v7NehqGnCqwZPD1wLuwQtQl PTyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=NkWdNEBm; arc=pass (i=1 spf=pass spfdomain=flex--ericchancf.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-64467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCVWwyYjXv24RjTCphyF0dHFMgAg5OmUy2+6GRTN7iN+ElWiRECBUSKiB4eh55MZly9h+Eon5T0kvX056j+vuHnGChRlU/sM8gq0TilvnQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v5-20020ac873c5000000b0042c376a6cb3si3802163qtp.292.2024.02.13.14.38.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 14:38:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=NkWdNEBm; arc=pass (i=1 spf=pass spfdomain=flex--ericchancf.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-64467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64467-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9A9C41C26DC4 for ; Tue, 13 Feb 2024 22:38:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72D32627F7; Tue, 13 Feb 2024 22:38:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NkWdNEBm" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AF5E12E59 for ; Tue, 13 Feb 2024 22:38:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707863899; cv=none; b=QfJZe524UILatJCrdmrz+tKHwQLL8+CUSKDCuOloGa58bbrq4V0OA+EQuuG3rW8H7SAtJY8jAxYPdx12dJd9qg/oU2JTFXQLg/jSAX5AHyJF09QvnSKQExfS4EIb+fZTGvBctfnOwLDq3iBD4g4iLMdVL9/in54kEYtiAFp57Z4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707863899; c=relaxed/simple; bh=oETUawuU8yy1VJ9yIj8p2lHOiphBiJDo5LBjLpJt1UY=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=JJwICBhNMdtvEH/G02rTPpfogyh2MuWDAo4kzFOh/39pGyZtkQ0sUPGYYAchvXtK9V42oqFTG0zWN39vNScYwS17P6D9thPfoMTVcbGpZQmZbJunJmDZcdO2099adXlwQ2ArKlkQVvXx7rGqlQMGu45kStqqtXqZgKbBEaLOeEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ericchancf.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=NkWdNEBm; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ericchancf.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dcbfe1a42a4so3920889276.2 for ; Tue, 13 Feb 2024 14:38:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707863897; x=1708468697; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=CfHqPDKZSILy8wF93jY+PBQlYR8jUuDqYcw6uvluZVk=; b=NkWdNEBmy7OYy/QwFHIc8dAJn3I96dcGV6I7JCvl359xNNpUDKFxliZ90yklDS2CM8 tfeAbG6pK3YwW45vloipkKJEGV1ifmkDzozwr7H5rTIpMm639aSuNKLd+/KpwA7yfW3X cy4LrAybGUjee0ZxUo9nKgZ8IuRYIWa3g+OconjwG03LY4rzO28APtStyJafilJWyJum pRu6ZbXPeDpxE6xLrh9dyg3whyS3S+9+gk5glQCtpFEUwtsi76O6My+ivBXEcwYTijl2 SWCdE57LLXiZk64K3n3UFEzhZdAd0VyoftWG8NWoaEQLh5v2zWlATBFHzqpiN1RTw/Uq v1Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707863897; x=1708468697; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CfHqPDKZSILy8wF93jY+PBQlYR8jUuDqYcw6uvluZVk=; b=WKbzuWB411H0/3OLyDhXO70gXaJc2FZ+5DXhfEOn16xRa0YggjSr70sGAHO9DrXW7c UA1tlkjIcEr1RIEO1CIxov2fOVSUVqX8x3HZ00R6dViccEPM326a1ubwD3CsSc57bibN bFyEF8eoh0uJ4PsIpC1p7jlC7ax3fQGgzuaSwhuZG9As9OJ1cfY7cr6jzaHbseXyjW1x yYIBC7HBPpdtOCFOndIR01YE5i8yzYllCo6KDvvgH7cMu9n74TWoCviKrjipHrCVDGjf 8qE62ooI0CKuz+1ubzceu0GKXX8ejpUcP1s8iT2Fy7ZPiLDVtCi3GQGAPBotLfWglc+/ Y2Xw== X-Forwarded-Encrypted: i=1; AJvYcCV+JNDIEqIo4wyyZ1wqvmIxjpERpksYhD6CfxU4UEqn7EK3I2l8ms76p1SH3Uj3XjO96kjqQpqexHPXiKcJIH33mhMuxBCKFyxnP7Um X-Gm-Message-State: AOJu0YxlFhYN/QRjUfJP1DDFPiCfs6o5J1Hi3r23vzFuz5t4onDqIRTE n0yjXMzNpPTuzSpme/rGyUkRsMb2PNB3niFIHWERPQTsOdvupWs5cCBeWlzKJz3hdQiaTfgwG6I qDouM3ttm1Bf494e7Ng== X-Received: from ericchancf.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:4139]) (user=ericchancf job=sendgmr) by 2002:a05:6902:1007:b0:dc9:5ef8:2b2d with SMTP id w7-20020a056902100700b00dc95ef82b2dmr175464ybt.4.1707863897101; Tue, 13 Feb 2024 14:38:17 -0800 (PST) Date: Tue, 13 Feb 2024 22:38:09 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog Message-ID: <20240213223810.2595804-1-ericchancf@google.com> Subject: [PATCH v5 0/4] riscv/barrier: tidying up barrier-related macro From: Eric Chan To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, ericchancf@google.com Content-Type: text/plain; charset="UTF-8" This series makes barrier-related macro more neat and clear. This is a follow-up to [0-2], change to multiple patches, for readability, create new message thread. v4 -> v5: [PATCH 3/4] __atomic_acquire_fence and __atomic_release_fence omit-the-fence-on-uniprocessor optimization, and fix the typo of RISCV_RELEASE_BARRIER when spliting the patch in v3. v3 -> v4: fix [PATCH 1/4] commit message weird line breaks and let [PATCH 3/4] fix the form that can pass the checking of checkpatch.pl. v2 -> v3: split the patch into multiple patches for one problem per patch. Also review the changelog to make the description more precise. v1 -> v2: makes compilation pass with allyesconfig instead of defconfig only, also satisfy scripts/checkpatch.pl. - (__asm__ __volatile__ (RISCV_FENCE_ASM(p, s) : : : "memory")) + ({ __asm__ __volatile__ (RISCV_FENCE_ASM(p, s) : : : "memory"); }) [0](v1/v2) https://lore.kernel.org/lkml/20240209125048.4078639-1-ericchancf@google.com/ [1] (v3) https://lore.kernel.org/lkml/20240213142856.2416073-1-ericchancf@google.com/ [2] (v4) https://lore.kernel.org/lkml/20240213200923.2547570-1-ericchancf@google.com/ Eric Chan (4): riscv/barrier: Define __{mb,rmb,wmb} riscv/barrier: Define RISCV_FULL_BARRIER riscv/barrier: Consolidate fence definitions riscv/barrier: Resolve checkpatch.pl error arch/riscv/include/asm/atomic.h | 17 ++++++++--------- arch/riscv/include/asm/barrier.h | 21 ++++++++++----------- arch/riscv/include/asm/cmpxchg.h | 5 ++--- arch/riscv/include/asm/fence.h | 10 ++++++++-- arch/riscv/include/asm/io.h | 8 ++++---- arch/riscv/include/asm/mmio.h | 5 +++-- arch/riscv/include/asm/mmiowb.h | 2 +- 7 files changed, 36 insertions(+), 32 deletions(-) -- 2.43.0.687.g38aa6559b0-goog