* [PATCH 0/4] riscv: some svpbmt fixes
@ 2022-05-18 17:02 Heiko Stuebner
2022-05-18 17:02 ` [PATCH 1/4] riscv: drop cpufeature_apply_feature tracking variable Heiko Stuebner
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Heiko Stuebner @ 2022-05-18 17:02 UTC (permalink / raw)
To: palmer, paul.walmsley
Cc: linux-riscv, linux-kernel, wefu, guoren, mick, samuel, cmuellner,
philipp.tomsich, hch, Heiko Stuebner
Some additionals comments and notes from autobuilders received
after the series got applied, warranted some changes.
So this is a small collection of cleanups for the svpbmt v10 series.
Heiko Stuebner (4):
riscv: drop cpufeature_apply_feature tracking variable
riscv: Improve description for RISCV_ISA_SVPBMT Kconfig symbol
riscv: make patch-function pointer more generic in
cpu_manufacturer_info struct
riscv: fix dependency for t-head errata
arch/riscv/Kconfig | 9 +++++++--
arch/riscv/Kconfig.erratas | 1 +
arch/riscv/kernel/alternative.c | 18 +++++++++---------
arch/riscv/kernel/cpufeature.c | 5 +----
4 files changed, 18 insertions(+), 15 deletions(-)
--
2.35.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] riscv: drop cpufeature_apply_feature tracking variable
2022-05-18 17:02 [PATCH 0/4] riscv: some svpbmt fixes Heiko Stuebner
@ 2022-05-18 17:02 ` Heiko Stuebner
2022-05-18 17:02 ` [PATCH 2/4] riscv: Improve description for RISCV_ISA_SVPBMT Kconfig symbol Heiko Stuebner
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Heiko Stuebner @ 2022-05-18 17:02 UTC (permalink / raw)
To: palmer, paul.walmsley
Cc: linux-riscv, linux-kernel, wefu, guoren, mick, samuel, cmuellner,
philipp.tomsich, hch, Heiko Stuebner, kernel test robot
The variable was tracking which feature patches got applied
but that information was never actually used - and thus resulted
in a warning as well.
Drop the variable.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
arch/riscv/kernel/cpufeature.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index dea3ea19deee..b33564df81e1 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -294,7 +294,6 @@ void __init_or_module riscv_cpufeature_patch_func(struct alt_entry *begin,
unsigned int stage)
{
u32 cpu_req_feature = cpufeature_probe(stage);
- u32 cpu_apply_feature = 0;
struct alt_entry *alt;
u32 tmp;
@@ -308,10 +307,8 @@ void __init_or_module riscv_cpufeature_patch_func(struct alt_entry *begin,
}
tmp = (1U << alt->errata_id);
- if (cpu_req_feature & tmp) {
+ if (cpu_req_feature & tmp)
patch_text_nosync(alt->old_ptr, alt->alt_ptr, alt->alt_len);
- cpu_apply_feature |= tmp;
- }
}
}
#endif
--
2.35.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] riscv: Improve description for RISCV_ISA_SVPBMT Kconfig symbol
2022-05-18 17:02 [PATCH 0/4] riscv: some svpbmt fixes Heiko Stuebner
2022-05-18 17:02 ` [PATCH 1/4] riscv: drop cpufeature_apply_feature tracking variable Heiko Stuebner
@ 2022-05-18 17:02 ` Heiko Stuebner
2022-05-18 17:02 ` [PATCH 3/4] riscv: make patch-function pointer more generic in cpu_manufacturer_info struct Heiko Stuebner
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Heiko Stuebner @ 2022-05-18 17:02 UTC (permalink / raw)
To: palmer, paul.walmsley
Cc: linux-riscv, linux-kernel, wefu, guoren, mick, samuel, cmuellner,
philipp.tomsich, hch, Heiko Stuebner
This improves the symbol's description to make it easier for
people to understand what it is about.
Suggested-by: Christoph Hellwig <hch@lst.de>
Suggested-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
arch/riscv/Kconfig | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 65285b980134..a4b299ad4473 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -356,8 +356,13 @@ config RISCV_ISA_SVPBMT
select RISCV_ALTERNATIVE
default y
help
- Adds support to dynamically detect the presence of the SVPBMT extension
- (Supervisor-mode: page-based memory types) and enable its usage.
+ Adds support to dynamically detect the presence of the SVPBMT
+ ISA-extension (Supervisor-mode: page-based memory types) and
+ enable its usage.
+
+ The memory type for a page contains a combination of attributes
+ that indicate the cacheability, idempotency, and ordering
+ properties for access to that page.
The SVPBMT extension is only available on 64Bit cpus.
--
2.35.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] riscv: make patch-function pointer more generic in cpu_manufacturer_info struct
2022-05-18 17:02 [PATCH 0/4] riscv: some svpbmt fixes Heiko Stuebner
2022-05-18 17:02 ` [PATCH 1/4] riscv: drop cpufeature_apply_feature tracking variable Heiko Stuebner
2022-05-18 17:02 ` [PATCH 2/4] riscv: Improve description for RISCV_ISA_SVPBMT Kconfig symbol Heiko Stuebner
@ 2022-05-18 17:02 ` Heiko Stuebner
2022-05-18 17:02 ` [PATCH 4/4] riscv: fix dependency for t-head errata Heiko Stuebner
2022-05-26 20:58 ` [PATCH 0/4] riscv: some svpbmt fixes Heiko Stübner
4 siblings, 0 replies; 7+ messages in thread
From: Heiko Stuebner @ 2022-05-18 17:02 UTC (permalink / raw)
To: palmer, paul.walmsley
Cc: linux-riscv, linux-kernel, wefu, guoren, mick, samuel, cmuellner,
philipp.tomsich, hch, Heiko Stuebner
During review the naming of the function-pointer was called
confusing as the vendor id is just one of three inputs for
the patching and indeed it serves no real purpose, as with
recent changes the function pointer is not a static
global element anymore, so drop the "vendor_" prefix.
Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
arch/riscv/kernel/alternative.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/riscv/kernel/alternative.c b/arch/riscv/kernel/alternative.c
index c9d0d3c53223..a7d26a00beea 100644
--- a/arch/riscv/kernel/alternative.c
+++ b/arch/riscv/kernel/alternative.c
@@ -20,7 +20,7 @@ struct cpu_manufacturer_info_t {
unsigned long vendor_id;
unsigned long arch_id;
unsigned long imp_id;
- void (*vendor_patch_func)(struct alt_entry *begin, struct alt_entry *end,
+ void (*patch_func)(struct alt_entry *begin, struct alt_entry *end,
unsigned long archid, unsigned long impid,
unsigned int stage);
};
@@ -40,16 +40,16 @@ static void __init_or_module riscv_fill_cpu_mfr_info(struct cpu_manufacturer_inf
switch (cpu_mfr_info->vendor_id) {
#ifdef CONFIG_ERRATA_SIFIVE
case SIFIVE_VENDOR_ID:
- cpu_mfr_info->vendor_patch_func = sifive_errata_patch_func;
+ cpu_mfr_info->patch_func = sifive_errata_patch_func;
break;
#endif
#ifdef CONFIG_ERRATA_THEAD
case THEAD_VENDOR_ID:
- cpu_mfr_info->vendor_patch_func = thead_errata_patch_func;
+ cpu_mfr_info->patch_func = thead_errata_patch_func;
break;
#endif
default:
- cpu_mfr_info->vendor_patch_func = NULL;
+ cpu_mfr_info->patch_func = NULL;
}
}
@@ -68,13 +68,13 @@ static void __init_or_module _apply_alternatives(struct alt_entry *begin,
riscv_cpufeature_patch_func(begin, end, stage);
- if (!cpu_mfr_info.vendor_patch_func)
+ if (!cpu_mfr_info.patch_func)
return;
- cpu_mfr_info.vendor_patch_func(begin, end,
- cpu_mfr_info.arch_id,
- cpu_mfr_info.imp_id,
- stage);
+ cpu_mfr_info.patch_func(begin, end,
+ cpu_mfr_info.arch_id,
+ cpu_mfr_info.imp_id,
+ stage);
}
void __init apply_boot_alternatives(void)
--
2.35.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] riscv: fix dependency for t-head errata
2022-05-18 17:02 [PATCH 0/4] riscv: some svpbmt fixes Heiko Stuebner
` (2 preceding siblings ...)
2022-05-18 17:02 ` [PATCH 3/4] riscv: make patch-function pointer more generic in cpu_manufacturer_info struct Heiko Stuebner
@ 2022-05-18 17:02 ` Heiko Stuebner
2022-05-20 7:55 ` Guo Ren
2022-05-26 20:58 ` [PATCH 0/4] riscv: some svpbmt fixes Heiko Stübner
4 siblings, 1 reply; 7+ messages in thread
From: Heiko Stuebner @ 2022-05-18 17:02 UTC (permalink / raw)
To: palmer, paul.walmsley
Cc: linux-riscv, linux-kernel, wefu, guoren, mick, samuel, cmuellner,
philipp.tomsich, hch, Heiko Stuebner, kernel test robot
alternatives only work correctly on non-xip-kernels and while the
selected alternative-symbol has the correct dependency the symbol
selecting it also needs that dependency.
So add the missing dependency to the T-Head errata Kconfig symbol.
Reported-by: kernel test robot <yujie.liu@intel.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
arch/riscv/Kconfig.erratas | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/riscv/Kconfig.erratas b/arch/riscv/Kconfig.erratas
index ebfcd5cc6eaf..457ac72c9b36 100644
--- a/arch/riscv/Kconfig.erratas
+++ b/arch/riscv/Kconfig.erratas
@@ -35,6 +35,7 @@ config ERRATA_SIFIVE_CIP_1200
config ERRATA_THEAD
bool "T-HEAD errata"
+ depends on !XIP_KERNEL
select RISCV_ALTERNATIVE
help
All T-HEAD errata Kconfig depend on this Kconfig. Disabling
--
2.35.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 4/4] riscv: fix dependency for t-head errata
2022-05-18 17:02 ` [PATCH 4/4] riscv: fix dependency for t-head errata Heiko Stuebner
@ 2022-05-20 7:55 ` Guo Ren
0 siblings, 0 replies; 7+ messages in thread
From: Guo Ren @ 2022-05-20 7:55 UTC (permalink / raw)
To: Heiko Stuebner
Cc: Palmer Dabbelt, Paul Walmsley, linux-riscv,
Linux Kernel Mailing List, Wei Fu, Nick Kossifidis,
Samuel Holland, Christoph Muellner, Philipp Tomsich,
Christoph Hellwig, kernel test robot
Reviewed-by: Guo Ren <guoren@kernel.org>
On Thu, May 19, 2022 at 1:03 AM Heiko Stuebner <heiko@sntech.de> wrote:
>
> alternatives only work correctly on non-xip-kernels and while the
> selected alternative-symbol has the correct dependency the symbol
> selecting it also needs that dependency.
>
> So add the missing dependency to the T-Head errata Kconfig symbol.
>
> Reported-by: kernel test robot <yujie.liu@intel.com>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
> arch/riscv/Kconfig.erratas | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/Kconfig.erratas b/arch/riscv/Kconfig.erratas
> index ebfcd5cc6eaf..457ac72c9b36 100644
> --- a/arch/riscv/Kconfig.erratas
> +++ b/arch/riscv/Kconfig.erratas
> @@ -35,6 +35,7 @@ config ERRATA_SIFIVE_CIP_1200
>
> config ERRATA_THEAD
> bool "T-HEAD errata"
> + depends on !XIP_KERNEL
> select RISCV_ALTERNATIVE
> help
> All T-HEAD errata Kconfig depend on this Kconfig. Disabling
> --
> 2.35.1
>
--
Best Regards
Guo Ren
ML: https://lore.kernel.org/linux-csky/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/4] riscv: some svpbmt fixes
2022-05-18 17:02 [PATCH 0/4] riscv: some svpbmt fixes Heiko Stuebner
` (3 preceding siblings ...)
2022-05-18 17:02 ` [PATCH 4/4] riscv: fix dependency for t-head errata Heiko Stuebner
@ 2022-05-26 20:58 ` Heiko Stübner
4 siblings, 0 replies; 7+ messages in thread
From: Heiko Stübner @ 2022-05-26 20:58 UTC (permalink / raw)
To: palmer, paul.walmsley
Cc: linux-riscv, linux-kernel, wefu, guoren, mick, samuel, cmuellner,
philipp.tomsich, hch
Am Mittwoch, 18. Mai 2022, 19:02:50 CEST schrieb Heiko Stuebner:
> Some additionals comments and notes from autobuilders received
> after the series got applied, warranted some changes.
>
> So this is a small collection of cleanups for the svpbmt v10 series.
I've just sent a v2 of this which added another patch onto the series.
See https://lore.kernel.org/r/20220526205646.258337-1-heiko@sntech.de
Heiko
> Heiko Stuebner (4):
> riscv: drop cpufeature_apply_feature tracking variable
> riscv: Improve description for RISCV_ISA_SVPBMT Kconfig symbol
> riscv: make patch-function pointer more generic in
> cpu_manufacturer_info struct
> riscv: fix dependency for t-head errata
>
> arch/riscv/Kconfig | 9 +++++++--
> arch/riscv/Kconfig.erratas | 1 +
> arch/riscv/kernel/alternative.c | 18 +++++++++---------
> arch/riscv/kernel/cpufeature.c | 5 +----
> 4 files changed, 18 insertions(+), 15 deletions(-)
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-05-26 20:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-18 17:02 [PATCH 0/4] riscv: some svpbmt fixes Heiko Stuebner
2022-05-18 17:02 ` [PATCH 1/4] riscv: drop cpufeature_apply_feature tracking variable Heiko Stuebner
2022-05-18 17:02 ` [PATCH 2/4] riscv: Improve description for RISCV_ISA_SVPBMT Kconfig symbol Heiko Stuebner
2022-05-18 17:02 ` [PATCH 3/4] riscv: make patch-function pointer more generic in cpu_manufacturer_info struct Heiko Stuebner
2022-05-18 17:02 ` [PATCH 4/4] riscv: fix dependency for t-head errata Heiko Stuebner
2022-05-20 7:55 ` Guo Ren
2022-05-26 20:58 ` [PATCH 0/4] riscv: some svpbmt fixes Heiko Stübner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).