From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-178.mta0.migadu.com (out-178.mta0.migadu.com [91.218.175.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EDAF3BB48 for ; Sat, 8 Aug 2026 07:33:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786174392; cv=none; b=pHbxPt8WWHMom1BQsYqF7t64RmqJdA+xvSCNvxEnwsnkOcMtFw/4xVnLxQTEwVL2NI3YZ/I6ohc1stY78w0wVyNxZcXXfusbX7Fmp7VYsgxlIzgjICCszjViF4cEi+c5LGgoqQBo8Nq1JMXWP47Pw0adSJa6jr/ZxFRpnPD3gKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786174392; c=relaxed/simple; bh=HChMSOzLztJXRYp5Rm23S0LWQB5UFl5/gH3kY079diQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IQ2aWmBsuwbeobubfVmLOJ36PagVJSHpz1hrgCyAxQUNCNFRSwerx8nfsZoRUhcJR1wxGBT0vXltI7tAQuTjPqaBeDcaXdB5DBTCVhXLoM/uI+kF8YLtO/InUdjrqbioJdUFYvzGx7XM2nMjVXV0ChwDpc3o1p/S7Z8HNOLETCg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=iovclzJp; arc=none smtp.client-ip=91.218.175.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="iovclzJp" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786174378; 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=rCzgX6JVLx9Ko3n6wKYEJsdgvY6Ca+XBEhJnvXYRW5o=; b=iovclzJpjR+LMVlQGMDC1PXGZcwCK7PEsPVXonLV3I6GYXXstpcVN2tQErwnvJQubWeZkW SeShr/mMhxwjUHw1ENdLhSGDivCiBRGJQ/ejL80ujQs1mOQN9teOlOUsNYf1YkdNDn/vij ctovi6HgvbyGlh6y6/v+IOE/V1+36d8= Date: Sat, 8 Aug 2026 00:32:49 -0700 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v8 05/22] RISC-V: Define indirect CSR access helpers To: Paul Walmsley Cc: Jiri Olsa , Mark Rutland , Rob Herring , Anup Patel , Namhyung Kim , Arnaldo Carvalho de Melo , Krzysztof Kozlowski , Ian Rogers , Will Deacon , James Clark , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-perf-users@vger.kernel.org, Conor Dooley References: <20260701-counter_delegation-v8-0-7909f863a645@meta.com> <20260701-counter_delegation-v8-5-7909f863a645@meta.com> <1b20aa77-0f0f-08c7-9439-972983adf709@kernel.org> <920aee80-5297-4d70-a1ea-616976db7f70@linux.dev> <09a1260b-aa91-f993-e81e-0c636cfd7942@kernel.org> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Atish Patra In-Reply-To: <09a1260b-aa91-f993-e81e-0c636cfd7942@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 8/7/26 6:04 PM, Paul Walmsley wrote: > On Wed, 5 Aug 2026, Atish Patra wrote: > >> On 8/4/26 5:39 PM, Paul Walmsley wrote: >>> On Wed, 1 Jul 2026, Atish Patra wrote: >>> >>>> From: Atish Patra >>>> >>>> The indirect CSR requires multiple instructions to read/write CSR. >>>> Add a few helper functions for ease of usage. >>>> >>>> Signed-off-by: Atish Patra >>> Thanks. These macros seem better implemented as static inline functions. >>> That also nicely aligns the code with what you write in the patch >>> description. >> I don't think inlining these macros in the following way will work because of >> the following reason. It won't build once anything calls it. >> >> csr_read()/csr_write() stringify the CSR argument straight into the inline asm >> template: > Yes, you're right; I should have caught that. Too bad, there are multiple > keyhole CSR index registers in use, otherwise it would have been a > reasonable thing to do. > > What's up with the subsequent followup message? Looks like a > cut-and-paste from an LLM. Oops. Ha ha. LLM agent was parsing the lore and preparing a draft response. It produced so much garbage that I replied manually. I have no idea what prompted it to send it after I sent the response! Sorry for the spam. > > - Paul