From: Andrew Jones <ajones@ventanamicro.com>
To: Yunhui Cui <cuiyunhui@bytedance.com>
Cc: alexghiti@rivosinc.com, andybnac@gmail.com,
aou@eecs.berkeley.edu, charlie@rivosinc.com,
cleger@rivosinc.com, conor.dooley@microchip.com,
conor@kernel.org, corbet@lwn.net, evan@rivosinc.com,
jesse@rivosinc.com, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-riscv@lists.infradead.org, palmer@dabbelt.com,
paul.walmsley@sifive.com, samuel.holland@sifive.com,
shuah@kernel.org
Subject: Re: [PATCH v3 1/3] RISC-V: Enable cbo.clean/flush in usermode
Date: Mon, 13 Jan 2025 09:53:58 +0100 [thread overview]
Message-ID: <20250113-62458ced6e6997eca091f325@orel> (raw)
In-Reply-To: <20250113083635.73826-1-cuiyunhui@bytedance.com>
On Mon, Jan 13, 2025 at 04:36:33PM +0800, Yunhui Cui wrote:
> Enabling cbo.clean and cbo.flush in user mode makes it more
> convenient to manage the cache state and achieve better performance.
>
> Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
> Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
> ---
> arch/riscv/kernel/cpufeature.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
> index c0916ed318c2..60d180b98f52 100644
> --- a/arch/riscv/kernel/cpufeature.c
> +++ b/arch/riscv/kernel/cpufeature.c
> @@ -30,6 +30,7 @@
> #define NUM_ALPHA_EXTS ('z' - 'a' + 1)
>
> static bool any_cpu_has_zicboz;
> +static bool any_cpu_has_zicbom;
>
> unsigned long elf_hwcap __read_mostly;
>
> @@ -87,6 +88,8 @@ static int riscv_ext_zicbom_validate(const struct riscv_isa_ext_data *data,
> pr_err("Zicbom disabled as cbom-block-size present, but is not a power-of-2\n");
> return -EINVAL;
> }
> +
> + any_cpu_has_zicbom = true;
> return 0;
> }
>
> @@ -944,6 +947,11 @@ void __init riscv_user_isa_enable(void)
> current->thread.envcfg |= ENVCFG_CBZE;
> else if (any_cpu_has_zicboz)
> pr_warn("Zicboz disabled as it is unavailable on some harts\n");
> +
> + if (riscv_has_extension_unlikely(RISCV_ISA_EXT_ZICBOM))
> + current->thread.envcfg |= ENVCFG_CBCFE;
> + else if (any_cpu_has_zicbom)
> + pr_warn("Zicbom disabled as it is unavailable on some harts\n");
> }
>
> #ifdef CONFIG_RISCV_ALTERNATIVE
> --
> 2.39.2
>
Please use a cover letter with a changelog or at least changelogs under
the '---' of each patch.
Thanks,
drew
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Jones <ajones@ventanamicro.com>
To: Yunhui Cui <cuiyunhui@bytedance.com>
Cc: alexghiti@rivosinc.com, andybnac@gmail.com,
aou@eecs.berkeley.edu, charlie@rivosinc.com,
cleger@rivosinc.com, conor.dooley@microchip.com,
conor@kernel.org, corbet@lwn.net, evan@rivosinc.com,
jesse@rivosinc.com, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-riscv@lists.infradead.org, palmer@dabbelt.com,
paul.walmsley@sifive.com, samuel.holland@sifive.com,
shuah@kernel.org
Subject: Re: [PATCH v3 1/3] RISC-V: Enable cbo.clean/flush in usermode
Date: Mon, 13 Jan 2025 09:53:58 +0100 [thread overview]
Message-ID: <20250113-62458ced6e6997eca091f325@orel> (raw)
In-Reply-To: <20250113083635.73826-1-cuiyunhui@bytedance.com>
On Mon, Jan 13, 2025 at 04:36:33PM +0800, Yunhui Cui wrote:
> Enabling cbo.clean and cbo.flush in user mode makes it more
> convenient to manage the cache state and achieve better performance.
>
> Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
> Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
> ---
> arch/riscv/kernel/cpufeature.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
> index c0916ed318c2..60d180b98f52 100644
> --- a/arch/riscv/kernel/cpufeature.c
> +++ b/arch/riscv/kernel/cpufeature.c
> @@ -30,6 +30,7 @@
> #define NUM_ALPHA_EXTS ('z' - 'a' + 1)
>
> static bool any_cpu_has_zicboz;
> +static bool any_cpu_has_zicbom;
>
> unsigned long elf_hwcap __read_mostly;
>
> @@ -87,6 +88,8 @@ static int riscv_ext_zicbom_validate(const struct riscv_isa_ext_data *data,
> pr_err("Zicbom disabled as cbom-block-size present, but is not a power-of-2\n");
> return -EINVAL;
> }
> +
> + any_cpu_has_zicbom = true;
> return 0;
> }
>
> @@ -944,6 +947,11 @@ void __init riscv_user_isa_enable(void)
> current->thread.envcfg |= ENVCFG_CBZE;
> else if (any_cpu_has_zicboz)
> pr_warn("Zicboz disabled as it is unavailable on some harts\n");
> +
> + if (riscv_has_extension_unlikely(RISCV_ISA_EXT_ZICBOM))
> + current->thread.envcfg |= ENVCFG_CBCFE;
> + else if (any_cpu_has_zicbom)
> + pr_warn("Zicbom disabled as it is unavailable on some harts\n");
> }
>
> #ifdef CONFIG_RISCV_ALTERNATIVE
> --
> 2.39.2
>
Please use a cover letter with a changelog or at least changelogs under
the '---' of each patch.
Thanks,
drew
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2025-01-13 8:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-13 8:36 [PATCH v3 1/3] RISC-V: Enable cbo.clean/flush in usermode Yunhui Cui
2025-01-13 8:36 ` Yunhui Cui
2025-01-13 8:36 ` [PATCH v3 2/3] RISC-V: hwprobe: Expose Zicbom extension and its block size Yunhui Cui
2025-01-13 8:36 ` Yunhui Cui
2025-01-13 9:07 ` Andrew Jones
2025-01-13 9:07 ` Andrew Jones
2025-01-13 11:29 ` [External] " yunhui cui
2025-01-13 11:29 ` yunhui cui
2025-01-13 12:41 ` Andrew Jones
2025-01-13 12:41 ` Andrew Jones
2025-01-13 8:36 ` [PATCH v3 3/3] RISC-V: selftests: Add TEST_ZICBOM into CBO tests Yunhui Cui
2025-01-13 8:36 ` Yunhui Cui
2025-01-13 9:18 ` Andrew Jones
2025-01-13 9:18 ` Andrew Jones
2025-01-13 11:49 ` [External] " yunhui cui
2025-01-13 11:49 ` yunhui cui
2025-01-13 12:42 ` Andrew Jones
2025-01-13 12:42 ` Andrew Jones
2025-01-13 8:53 ` Andrew Jones [this message]
2025-01-13 8:53 ` [PATCH v3 1/3] RISC-V: Enable cbo.clean/flush in usermode Andrew Jones
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=20250113-62458ced6e6997eca091f325@orel \
--to=ajones@ventanamicro.com \
--cc=alexghiti@rivosinc.com \
--cc=andybnac@gmail.com \
--cc=aou@eecs.berkeley.edu \
--cc=charlie@rivosinc.com \
--cc=cleger@rivosinc.com \
--cc=conor.dooley@microchip.com \
--cc=conor@kernel.org \
--cc=corbet@lwn.net \
--cc=cuiyunhui@bytedance.com \
--cc=evan@rivosinc.com \
--cc=jesse@rivosinc.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=samuel.holland@sifive.com \
--cc=shuah@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.