Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp184924rdh; Tue, 13 Feb 2024 13:31:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWTNB1tpY4qEz6947S8nWQov60bgIEDhO23CUhoSKMxU/sN7T8mN+8oyjNN5IxEDVK6amOEGC1lQlajIDNS+I9U6QSLdPiUe2qJFsp5Iw== X-Google-Smtp-Source: AGHT+IHD35QlLWeDXhc75qSHAJoeQFrFn7SF4HabxGvl3TBRbvpsdrZrk0NyxOn+wkw7KBMgCFVf X-Received: by 2002:a92:ce49:0:b0:363:b167:b7e9 with SMTP id a9-20020a92ce49000000b00363b167b7e9mr1004411ilr.18.1707859881048; Tue, 13 Feb 2024 13:31:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707859881; cv=pass; d=google.com; s=arc-20160816; b=w/r6MkbdqshU+BpNhcP091lQL3z2mEyS3w5m19aMNa9C5a2MiV35y7H2y0FjSa5NsD i7R6AFpGyUSWDBhVAyLTKZi83eMsQRp+KPgJ6j/OgYbSPC7S85GhPxLvY70Bl7unZd0b +gURkdNXHwoAnw7U7w+O46B50oEG2Zz1JCnVK/d+cshAw/AQc6RSgmBKJ/ozqIFAgU9A Vrwpa2Mp6Y8eve9hHGU8Fx1DGLIPM7jp3g6OjMl4u9beYm+hJgV79t0vY5BVCOn8zm+d M5aClWfQKvqWXwNo+L3l9FvDalPlr0JUTm3xe4iteR5ybR25xBxGuV174COZcG2ZSY1J uEbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=PYDJgiAqQGDP9GzbDPgSy0bCIuBLtER9XQ6AW4LDXW4=; fh=oq3FRT4Pzcyi1THD21mv6JNJhpRkPJU8CVV9d9rAseQ=; b=ADwxSFf/OtoDHI/ejgTFbO8UpRm/jfH/rizVzpwmAgSsTEMIqSIO9Wuou+tWV+eyi+ CrGrZNpC/dFTjqu1Ks9m8A3vu5kbMepAMvFsIZ/X5rGgT3Lc4S552AfxmCbEBajWaFsM Z0ysJOaedKzMkbxk84TrF+1cWLvx1RhBZRv0aSJQJocpds0XChhz/b+5VCbkOvf35b69 Fu1bcshc41DqKdGO+hhsNwbKsvcOn5EC5e1/dO/Hin7nqWrsvMwKi6Nqq03L3RiQtm1y dWih90E29v5LgtHYwP5rxLxNxZqRC/DZkrizkfBxxQ9wLjOnjDLEnl0diN2KDmc0xeBB Yy3Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=AdSqnfaq; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-64333-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com X-Forwarded-Encrypted: i=2; AJvYcCWr2GBdSdPPusibehu9nfNzIeHczgun46u8o60bYbAjNlrpqVggP9DglqLgi5ieyNUE6zlX7QcqXPCfEYdNFLu6YpjFQtX+49NaglzwgQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g28-20020a63375c000000b005dc365174desi2548687pgn.377.2024.02.13.13.31.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:31:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64333-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=AdSqnfaq; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-64333-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AF80F28169D for ; Tue, 13 Feb 2024 21:31:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32E0461675; Tue, 13 Feb 2024 21:31:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="AdSqnfaq" Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 9FE556166B for ; Tue, 13 Feb 2024 21:31:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707859875; cv=none; b=qxivPZnkr6pG1XNittHsAoEo4bvHDXaLe8ne3Cx4QX86KQ9EBLSSkMIceGSuXXYKCvvfA84Vd/91iFYLcrYRtix7dEQL+nAEbRbUyuT1cKTpc3rMghELXYEbmny3gTeGs6lBySOsqG2hnr3YLWDH1zE+SBw/9DcqVlo503I4UeI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707859875; c=relaxed/simple; bh=vofXMPJrQC+q6/Lnct60uFCq3gSpscykTf56gJnkQAI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bIef4Y9NGB6pTTCrsKtHZWZ/9I8kPB2PH4q3aI9061RTLPcNFu5TCEWbwldQJy3znN9jsYj7slDxzBVQsB69L1ruYqI9z6kIQne+HVx+MNBRMJDsk3VWf/A4JgGKJptrjkJ/+tlUMn8VwikYYnv26VIzAFU+kzt5BCSRxB+1dJA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com; spf=pass smtp.mailfrom=sifive.com; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b=AdSqnfaq; arc=none smtp.client-ip=209.85.222.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-785d453c8e9so160627585a.3 for ; Tue, 13 Feb 2024 13:31:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1707859872; x=1708464672; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PYDJgiAqQGDP9GzbDPgSy0bCIuBLtER9XQ6AW4LDXW4=; b=AdSqnfaqpfOI//YAy9DBjF52QL1Ex6l9hEMA7C00UOKWPwg4mQ2A0pEijdIJsT6oyO 1tcv6h1hndZGBe1MTflKpWVNl/Kw9PfoM4m/+UiQ1CdLHIQVetVajDhBLiRJGcdGlW7l Kboksf1IWu8rFuw0tr5zb7djmEfmztko+jn3HTIquBgFIKVVn0M0kY7cmsFbif9jo+oy BnUZaYIXb/q0L+2rpaLNSEldetPhD3TV/1unzVdpES7EJrpkVbVg/3Ke7Htf6Ka77EX/ 2ItH0jFqEpZvyRFfLNR2k7tTvKodINoZezEC2cHfD2CkXxp/iqQq8/rQ1vxZkw6WazM0 vQiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707859872; x=1708464672; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PYDJgiAqQGDP9GzbDPgSy0bCIuBLtER9XQ6AW4LDXW4=; b=bhxSUdpxzMoKyhxttG7kNfbwgJ6ZNRL3ZpoPp1ZQLWrOnB3tdmBwA+AxKNWtvvfQT8 pXmQm2uBQ1mbV7ItyD3yLnIc5MGjF7DjuZsAgBKzSyfzxJtuXNu/NQzmO7xiUjUeyd59 msWW9+k0ZesAmd+R56IzEhZmG4LP8+5pxmw5KurJ6FHBEGq5IDcLFufNNcF0N+G+oNfD uN0xGbwkBG71TqaUZtDW4yxqjNcwCXw0mnWtCHCnR3FTws4C3A6blFg4G2isXyNhN//s REoXTREkL663icb1k6o3xKQfK9t1nLuT9OyhUBfdPTp+wWSNrzpagSpAMGH0wlwPxsqq FKyA== X-Forwarded-Encrypted: i=1; AJvYcCXCjiPc7uNcQvipspKANowWXZ7Th0wQ6d3+2HIZXwJQxRx3h4KxtHJgrgD1BOxZ3Z5WgHM9txtie+bzohl6oNvIoU3IOyxywSYcDKE8 X-Gm-Message-State: AOJu0YxapXVTFPI9aIIhW6Ry9U3dkTOMKXADuwlE7LY7F+cmxymalNbM tfOyoTWjq1oYp/W6EOaoEZk4epy62ORLOTv6cyBusHJ7UShWl3XZNg/WlMBQV0Y= X-Received: by 2002:a05:620a:4590:b0:787:1631:6920 with SMTP id bp16-20020a05620a459000b0078716316920mr1029472qkb.34.1707859872527; Tue, 13 Feb 2024 13:31:12 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU+BDpt4pBjCo/TnTlQWv/RqyO2ITx8HDD405KDduEgmwpfU99upKZQBNXadPD86wkWEO518ONVRpCM19z3Mggm5L4+2fTCH2q2L7NeRVMflHX4HjAkuguQvFriU5HKvtXBpcYrICdOOVZV6DMMiBp+p8trk4/JBFLJOcLEk/vI0Yd7Awn8tB0tXj/C7hECIhcF Received: from [100.64.0.1] ([170.85.8.192]) by smtp.gmail.com with ESMTPSA id v15-20020a05620a122f00b00785d3729eb0sm2265833qkj.41.2024.02.13.13.31.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 13 Feb 2024 13:31:12 -0800 (PST) Message-ID: <2d4d939d-4b49-44d7-8405-e075de844884@sifive.com> Date: Tue, 13 Feb 2024 15:31:10 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 3/4] riscv/barrier: Consolidate fence definitions Content-Language: en-US To: Eric Chan , paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240213200923.2547570-1-ericchancf@google.com> <20240213201210.2549488-1-ericchancf@google.com> From: Samuel Holland In-Reply-To: <20240213201210.2549488-1-ericchancf@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Eric, On 2024-02-13 2:12 PM, Eric Chan wrote: > Disparate fence implementations are consolidated into fence.h. > Also introduce RISCV_FENCE_ASM to make fence macro more reusable. > > Signed-off-by: Eric Chan > --- > v3 -> v4: fix the form that can pass the checking of checkpatch.pl. > arch/riscv/include/asm/atomic.h | 8 ++------ > arch/riscv/include/asm/barrier.h | 3 +-- > arch/riscv/include/asm/cmpxchg.h | 1 - > 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, 18 insertions(+), 19 deletions(-) > > diff --git a/arch/riscv/include/asm/atomic.h b/arch/riscv/include/asm/atomic.h > index 31e6e2e7cc18..19050d13b6c1 100644 > --- a/arch/riscv/include/asm/atomic.h > +++ b/arch/riscv/include/asm/atomic.h > @@ -17,13 +17,9 @@ > #endif > > #include > -#include > > -#define __atomic_acquire_fence() \ > - __asm__ __volatile__(RISCV_ACQUIRE_BARRIER "" ::: "memory") > - > -#define __atomic_release_fence() \ > - __asm__ __volatile__(RISCV_RELEASE_BARRIER "" ::: "memory"); > +#define __atomic_acquire_fence() RISCV_FENCE(r, rw) > +#define __atomic_release_fence() RISCV_FENCE(rw, r) This change removes the omit-the-fence-on-uniprocessor optimization, like you added some instances of in your previous patch. Should we keep this optimization? Regards, Samuel