public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Enable Zicbom in usermode
@ 2024-10-25  9:15 Yunhui Cui
  2024-10-25 10:16 ` Conor Dooley
  2024-12-19 14:12 ` Andrew Jones
  0 siblings, 2 replies; 9+ messages in thread
From: Yunhui Cui @ 2024-10-25  9:15 UTC (permalink / raw)
  To: punit.agrawal, paul.walmsley, palmer, aou, conor, cleger, charlie,
	evan, samuel.holland, andybnac, linux-riscv, linux-kernel
  Cc: Yunhui Cui

Like Zicboz, by enabling the corresponding bits of senvcfg,
the instructions cbo.clean, cbo.flush, and cbo.inval can be
executed normally in user mode.

Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
---
 arch/riscv/kernel/cpufeature.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index 1992ea64786e..bc850518ab41 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -924,7 +924,7 @@ unsigned long riscv_get_elf_hwcap(void)
 void __init riscv_user_isa_enable(void)
 {
 	if (riscv_has_extension_unlikely(RISCV_ISA_EXT_ZICBOZ))
-		current->thread.envcfg |= ENVCFG_CBZE;
+		current->thread.envcfg |= ENVCFG_CBIE | ENVCFG_CBCFE | ENVCFG_CBZE;
 	else if (any_cpu_has_zicboz)
 		pr_warn("Zicboz disabled as it is unavailable on some harts\n");
 }
-- 
2.39.2


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-12-20  6:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-25  9:15 [PATCH] RISC-V: Enable Zicbom in usermode Yunhui Cui
2024-10-25 10:16 ` Conor Dooley
2024-10-25 16:32   ` Jessica Clarke
2024-10-31  8:29     ` [External] " yunhui cui
2024-11-13 17:37       ` Andrew Jones
2024-10-29 19:20   ` Deepak Gupta
2024-11-13 15:11   ` Palmer Dabbelt
2024-12-19 14:12 ` Andrew Jones
2024-12-20  6:01   ` [External] " yunhui cui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox