public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Walmsley <pjw@kernel.org>
To: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	 Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	 Alexandre Ghiti <alex@ghiti.fr>,
	Charlie Jenkins <charlie@rivosinc.com>,
	 Song Liu <song@kernel.org>, Yu Kuai <yukuai3@huawei.com>,
	 linux-riscv@lists.infradead.org, linux-raid@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	Chunyan Zhang <zhang.lyra@gmail.com>
Subject: Re: [PATCH V3 3/5] raid6: riscv: Prevent compiler with vector support to build already vectorized code
Date: Tue, 25 Nov 2025 02:26:42 -0700 (MST)	[thread overview]
Message-ID: <6c2a11f4-27ac-1389-23a6-5f5bcf1c5048@kernel.org> (raw)
In-Reply-To: <20250718072711.3865118-4-zhangchunyan@iscas.ac.cn>

Hi,

On Fri, 18 Jul 2025, Chunyan Zhang wrote:

> To avoid the inline assembly code to break what the compiler could have
> vectorized, this code must be built without compiler support for vector.
> 
> Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>

This one has been queued with a somewhat modified commit message to 
reflect what I thought the intention is.  But I might be wrong.  Can you 
check it, please?

thanks,


- Paul

From: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
Date: Mon, 17 Nov 2025 21:19:24 -0700

raid6: riscv: Prevent compiler from breaking inline vector assembly code

To prevent the compiler from breaking the inline vector assembly code,
this code must be built without compiler support for vector.

Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn>
Link: https://patch.msgid.link/20250718072711.3865118-4-zhangchunyan@iscas.ac.cn
[pjw@kernel.org: cleaned up commit message]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
---
 lib/raid6/rvv.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/raid6/rvv.c b/lib/raid6/rvv.c
index 89da5fc247aa..015f3ee4da25 100644
--- a/lib/raid6/rvv.c
+++ b/lib/raid6/rvv.c
@@ -20,6 +20,10 @@ static int rvv_has_vector(void)
 	return has_vector();
 }
 
+#ifdef __riscv_vector
+#error "This code must be built without compiler support for vector"
+#endif
+
 static void raid6_rvv1_gen_syndrome_real(int disks, unsigned long bytes, void **ptrs)
 {
 	u8 **dptr = (u8 **)ptrs;
-- 
2.48.1


  reply	other threads:[~2025-11-25  9:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-18  7:27 [PATCH V3 0/5] Add an optimization also raid6test for RISC-V support Chunyan Zhang
2025-07-18  7:27 ` [PATCH V3 1/5] raid6: riscv: Clean up unused header file inclusion Chunyan Zhang
2025-07-18  7:27 ` [PATCH V3 2/5] raid6: riscv: replace one load with a move to speed up the caculation Chunyan Zhang
2025-07-18  7:27 ` [PATCH V3 3/5] raid6: riscv: Prevent compiler with vector support to build already vectorized code Chunyan Zhang
2025-11-25  9:26   ` Paul Walmsley [this message]
2025-11-25  9:43     ` Chunyan Zhang
2025-07-18  7:27 ` [PATCH V3 4/5] raid6: riscv: Allow code to be compiled in userspace Chunyan Zhang
2025-07-18  7:27 ` [PATCH V3 5/5] raid6: test: Add support for RISC-V Chunyan Zhang
2025-07-18 14:08   ` Alexandre Ghiti
2025-10-13  1:42     ` Chunyan Zhang
2025-11-25  9:29       ` Paul Walmsley
2025-08-06 17:15 ` [PATCH V3 0/5] Add an optimization also raid6test for RISC-V support patchwork-bot+linux-riscv

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c2a11f4-27ac-1389-23a6-5f5bcf1c5048@kernel.org \
    --to=pjw@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=charlie@rivosinc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=song@kernel.org \
    --cc=yukuai3@huawei.com \
    --cc=zhang.lyra@gmail.com \
    --cc=zhangchunyan@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox