* [PATCH 0/5] riscv: alternative/cpufeature related cleanups
@ 2023-02-21 18:55 Andrew Jones
2023-02-21 18:55 ` [PATCH 1/5] riscv: Rename Kconfig.erratas to Kconfig.errata Andrew Jones
` (4 more replies)
0 siblings, 5 replies; 18+ messages in thread
From: Andrew Jones @ 2023-02-21 18:55 UTC (permalink / raw)
To: linux-riscv
Cc: 'Jisheng Zhang ', 'Heiko Stuebner ',
'Paul Walmsley ', 'Palmer Dabbelt ',
'Conor Dooley ', 'Albert Ou '
This series has no intended functional change. These cleanups were
found while renaming errata_id to patch_id in order to better
convey that its purpose is larger than errata (it's also for
cpufeatures).
Based on riscv-linux/for-next
Thanks,
drew
Andrew Jones (5):
riscv: Rename Kconfig.erratas to Kconfig.errata
riscv: alternatives: Remove unnecessary define and unused struct
riscv: alternatives: Rename errata_id to patch_id
riscv: lib: Include hwcap.h directly
riscv: cpufeature: Drop unused includes
arch/riscv/Kconfig | 8 +--
.../riscv/{Kconfig.erratas => Kconfig.errata} | 0
arch/riscv/errata/sifive/errata.c | 8 +--
arch/riscv/errata/thead/errata.c | 4 +-
arch/riscv/include/asm/alternative-macros.h | 72 +++++++++----------
arch/riscv/include/asm/alternative.h | 9 +--
arch/riscv/kernel/cpufeature.c | 11 +--
arch/riscv/lib/strcmp.S | 3 +-
arch/riscv/lib/strlen.S | 3 +-
arch/riscv/lib/strncmp.S | 3 +-
10 files changed, 53 insertions(+), 68 deletions(-)
rename arch/riscv/{Kconfig.erratas => Kconfig.errata} (100%)
--
2.39.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 18+ messages in thread* [PATCH 1/5] riscv: Rename Kconfig.erratas to Kconfig.errata 2023-02-21 18:55 [PATCH 0/5] riscv: alternative/cpufeature related cleanups Andrew Jones @ 2023-02-21 18:55 ` Andrew Jones 2023-02-23 23:11 ` Conor Dooley 2023-02-24 12:37 ` Heiko Stübner 2023-02-21 18:56 ` [PATCH 2/5] riscv: alternatives: Remove unnecessary define and unused struct Andrew Jones ` (3 subsequent siblings) 4 siblings, 2 replies; 18+ messages in thread From: Andrew Jones @ 2023-02-21 18:55 UTC (permalink / raw) To: linux-riscv Cc: 'Jisheng Zhang ', 'Heiko Stuebner ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' Errata is already plural for erratum. Rename it to make the grammar gooder. Signed-off-by: Andrew Jones <ajones@ventanamicro.com> --- arch/riscv/Kconfig | 2 +- arch/riscv/{Kconfig.erratas => Kconfig.errata} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename arch/riscv/{Kconfig.erratas => Kconfig.errata} (100%) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 6f52d3ec93c3..736f42f572aa 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -244,7 +244,7 @@ config AS_HAS_INSN def_bool $(as-instr,.insn r 51$(comma) 0$(comma) 0$(comma) t0$(comma) t0$(comma) zero) source "arch/riscv/Kconfig.socs" -source "arch/riscv/Kconfig.erratas" +source "arch/riscv/Kconfig.errata" menu "Platform type" diff --git a/arch/riscv/Kconfig.erratas b/arch/riscv/Kconfig.errata similarity index 100% rename from arch/riscv/Kconfig.erratas rename to arch/riscv/Kconfig.errata -- 2.39.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 1/5] riscv: Rename Kconfig.erratas to Kconfig.errata 2023-02-21 18:55 ` [PATCH 1/5] riscv: Rename Kconfig.erratas to Kconfig.errata Andrew Jones @ 2023-02-23 23:11 ` Conor Dooley 2023-02-24 12:37 ` Heiko Stübner 1 sibling, 0 replies; 18+ messages in thread From: Conor Dooley @ 2023-02-23 23:11 UTC (permalink / raw) To: Andrew Jones Cc: linux-riscv, 'Jisheng Zhang ', 'Heiko Stuebner ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' [-- Attachment #1.1: Type: text/plain, Size: 1406 bytes --] On Tue, Feb 21, 2023 at 07:55:59PM +0100, Andrew Jones wrote: > Errata is already plural for erratum. Rename it to make the > grammar gooder. I've been wanting to do that for a while, but didn't have an excuse to do it. Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> > --- > arch/riscv/Kconfig | 2 +- > arch/riscv/{Kconfig.erratas => Kconfig.errata} | 0 > 2 files changed, 1 insertion(+), 1 deletion(-) > rename arch/riscv/{Kconfig.erratas => Kconfig.errata} (100%) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 6f52d3ec93c3..736f42f572aa 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -244,7 +244,7 @@ config AS_HAS_INSN > def_bool $(as-instr,.insn r 51$(comma) 0$(comma) 0$(comma) t0$(comma) t0$(comma) zero) > > source "arch/riscv/Kconfig.socs" > -source "arch/riscv/Kconfig.erratas" > +source "arch/riscv/Kconfig.errata" > > menu "Platform type" > > diff --git a/arch/riscv/Kconfig.erratas b/arch/riscv/Kconfig.errata > similarity index 100% > rename from arch/riscv/Kconfig.erratas > rename to arch/riscv/Kconfig.errata > -- > 2.39.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] [-- Attachment #2: Type: text/plain, Size: 161 bytes --] _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 1/5] riscv: Rename Kconfig.erratas to Kconfig.errata 2023-02-21 18:55 ` [PATCH 1/5] riscv: Rename Kconfig.erratas to Kconfig.errata Andrew Jones 2023-02-23 23:11 ` Conor Dooley @ 2023-02-24 12:37 ` Heiko Stübner 1 sibling, 0 replies; 18+ messages in thread From: Heiko Stübner @ 2023-02-24 12:37 UTC (permalink / raw) To: linux-riscv, Andrew Jones Cc: 'Jisheng Zhang ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' Am Dienstag, 21. Februar 2023, 19:55:59 CET schrieb Andrew Jones: > Errata is already plural for erratum. Rename it to make the > grammar gooder. > > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Heiko Stuebner <heiko.stuebner@vrull.eu> _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 2/5] riscv: alternatives: Remove unnecessary define and unused struct 2023-02-21 18:55 [PATCH 0/5] riscv: alternative/cpufeature related cleanups Andrew Jones 2023-02-21 18:55 ` [PATCH 1/5] riscv: Rename Kconfig.erratas to Kconfig.errata Andrew Jones @ 2023-02-21 18:56 ` Andrew Jones 2023-02-23 23:14 ` Conor Dooley 2023-02-24 12:44 ` Heiko Stübner 2023-02-21 18:56 ` [PATCH 3/5] riscv: alternatives: Rename errata_id to patch_id Andrew Jones ` (2 subsequent siblings) 4 siblings, 2 replies; 18+ messages in thread From: Andrew Jones @ 2023-02-21 18:56 UTC (permalink / raw) To: linux-riscv Cc: 'Jisheng Zhang ', 'Heiko Stuebner ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' A define and a struct were introduced with commit 6f4eea90465a ("riscv: Introduce alternative mechanism to apply errata solution"), which introduced alternatives to RISC-V. The define is used for an arbitrary string length, specific to sifive errata, so just use the number directly there instead. The struct has never been used, so remove it. Signed-off-by: Andrew Jones <ajones@ventanamicro.com> --- arch/riscv/errata/sifive/errata.c | 2 +- arch/riscv/include/asm/alternative.h | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/riscv/errata/sifive/errata.c b/arch/riscv/errata/sifive/errata.c index ef9a4eec0dba..9e7dffa800f2 100644 --- a/arch/riscv/errata/sifive/errata.c +++ b/arch/riscv/errata/sifive/errata.c @@ -13,7 +13,7 @@ #include <asm/errata_list.h> struct errata_info_t { - char name[ERRATA_STRING_LENGTH_MAX]; + char name[32]; bool (*check_func)(unsigned long arch_id, unsigned long impid); }; diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h index b8648d4f2ac1..3beef400a971 100644 --- a/arch/riscv/include/asm/alternative.h +++ b/arch/riscv/include/asm/alternative.h @@ -6,8 +6,6 @@ #ifndef __ASM_ALTERNATIVE_H #define __ASM_ALTERNATIVE_H -#define ERRATA_STRING_LENGTH_MAX 32 - #include <asm/alternative-macros.h> #ifndef __ASSEMBLY__ @@ -43,11 +41,6 @@ struct alt_entry { u32 errata_id; /* The errata id */ }; -struct errata_checkfunc_id { - unsigned long vendor_id; - bool (*func)(struct alt_entry *alt); -}; - void sifive_errata_patch_func(struct alt_entry *begin, struct alt_entry *end, unsigned long archid, unsigned long impid, unsigned int stage); -- 2.39.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 2/5] riscv: alternatives: Remove unnecessary define and unused struct 2023-02-21 18:56 ` [PATCH 2/5] riscv: alternatives: Remove unnecessary define and unused struct Andrew Jones @ 2023-02-23 23:14 ` Conor Dooley 2023-02-24 12:44 ` Heiko Stübner 1 sibling, 0 replies; 18+ messages in thread From: Conor Dooley @ 2023-02-23 23:14 UTC (permalink / raw) To: Andrew Jones Cc: linux-riscv, 'Jisheng Zhang ', 'Heiko Stuebner ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' [-- Attachment #1.1: Type: text/plain, Size: 2289 bytes --] On Tue, Feb 21, 2023 at 07:56:00PM +0100, Andrew Jones wrote: > A define and a struct were introduced with commit 6f4eea90465a > ("riscv: Introduce alternative mechanism to apply errata solution"), > which introduced alternatives to RISC-V. The define is used for > an arbitrary string length, specific to sifive errata, so just use > the number directly there instead. The struct has never been used, > so remove it. > > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> > --- > arch/riscv/errata/sifive/errata.c | 2 +- > arch/riscv/include/asm/alternative.h | 7 ------- > 2 files changed, 1 insertion(+), 8 deletions(-) > > diff --git a/arch/riscv/errata/sifive/errata.c b/arch/riscv/errata/sifive/errata.c > index ef9a4eec0dba..9e7dffa800f2 100644 > --- a/arch/riscv/errata/sifive/errata.c > +++ b/arch/riscv/errata/sifive/errata.c > @@ -13,7 +13,7 @@ > #include <asm/errata_list.h> > > struct errata_info_t { > - char name[ERRATA_STRING_LENGTH_MAX]; > + char name[32]; If it were me, I'd probably have moved the define - but hardly matters, it's a one time use, arbitrary number I suppose. Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > bool (*check_func)(unsigned long arch_id, unsigned long impid); > }; > > diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h > index b8648d4f2ac1..3beef400a971 100644 > --- a/arch/riscv/include/asm/alternative.h > +++ b/arch/riscv/include/asm/alternative.h > @@ -6,8 +6,6 @@ > #ifndef __ASM_ALTERNATIVE_H > #define __ASM_ALTERNATIVE_H > > -#define ERRATA_STRING_LENGTH_MAX 32 > - > #include <asm/alternative-macros.h> > > #ifndef __ASSEMBLY__ > @@ -43,11 +41,6 @@ struct alt_entry { > u32 errata_id; /* The errata id */ > }; > > -struct errata_checkfunc_id { > - unsigned long vendor_id; > - bool (*func)(struct alt_entry *alt); > -}; > - > void sifive_errata_patch_func(struct alt_entry *begin, struct alt_entry *end, > unsigned long archid, unsigned long impid, > unsigned int stage); > -- > 2.39.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] [-- Attachment #2: Type: text/plain, Size: 161 bytes --] _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/5] riscv: alternatives: Remove unnecessary define and unused struct 2023-02-21 18:56 ` [PATCH 2/5] riscv: alternatives: Remove unnecessary define and unused struct Andrew Jones 2023-02-23 23:14 ` Conor Dooley @ 2023-02-24 12:44 ` Heiko Stübner 1 sibling, 0 replies; 18+ messages in thread From: Heiko Stübner @ 2023-02-24 12:44 UTC (permalink / raw) To: linux-riscv, Andrew Jones Cc: 'Jisheng Zhang ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' Am Dienstag, 21. Februar 2023, 19:56:00 CET schrieb Andrew Jones: > A define and a struct were introduced with commit 6f4eea90465a > ("riscv: Introduce alternative mechanism to apply errata solution"), > which introduced alternatives to RISC-V. The define is used for > an arbitrary string length, specific to sifive errata, so just use > the number directly there instead. The struct has never been used, > so remove it. > > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Heiko Stuebner <heiko.stuebner@vrull.eu> _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/5] riscv: alternatives: Rename errata_id to patch_id 2023-02-21 18:55 [PATCH 0/5] riscv: alternative/cpufeature related cleanups Andrew Jones 2023-02-21 18:55 ` [PATCH 1/5] riscv: Rename Kconfig.erratas to Kconfig.errata Andrew Jones 2023-02-21 18:56 ` [PATCH 2/5] riscv: alternatives: Remove unnecessary define and unused struct Andrew Jones @ 2023-02-21 18:56 ` Andrew Jones 2023-02-23 23:24 ` Conor Dooley 2023-02-24 12:46 ` Heiko Stübner 2023-02-21 18:56 ` [PATCH 4/5] riscv: lib: Include hwcap.h directly Andrew Jones 2023-02-21 18:56 ` [PATCH 5/5] riscv: cpufeature: Drop unused includes Andrew Jones 4 siblings, 2 replies; 18+ messages in thread From: Andrew Jones @ 2023-02-21 18:56 UTC (permalink / raw) To: linux-riscv Cc: 'Jisheng Zhang ', 'Heiko Stuebner ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' Alternatives are used for both errata and cpufeatures. Use a more generic name, 'patch_id', as in "ID of code patching site", to avoid confusion when alternatives are used for cpufeatures. Signed-off-by: Andrew Jones <ajones@ventanamicro.com> --- arch/riscv/Kconfig | 6 +- arch/riscv/errata/sifive/errata.c | 6 +- arch/riscv/errata/thead/errata.c | 4 +- arch/riscv/include/asm/alternative-macros.h | 72 ++++++++++----------- arch/riscv/include/asm/alternative.h | 2 +- arch/riscv/kernel/cpufeature.c | 6 +- 6 files changed, 48 insertions(+), 48 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 736f42f572aa..0c494c36e911 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -377,9 +377,9 @@ config RISCV_ALTERNATIVE depends on !XIP_KERNEL help This Kconfig allows the kernel to automatically patch the - errata required by the execution platform at run time. The - code patching is performed once in the boot stages. It means - that the overhead from this mechanism is just taken once. + erratum or cpufeature required by the execution platform at run + time. The code patching is performed once in the boot stages. It + means that the overhead from this mechanism is just taken once. config RISCV_ALTERNATIVE_EARLY bool diff --git a/arch/riscv/errata/sifive/errata.c b/arch/riscv/errata/sifive/errata.c index 9e7dffa800f2..3fe8bab5bb9e 100644 --- a/arch/riscv/errata/sifive/errata.c +++ b/arch/riscv/errata/sifive/errata.c @@ -100,12 +100,12 @@ void __init_or_module sifive_errata_patch_func(struct alt_entry *begin, for (alt = begin; alt < end; alt++) { if (alt->vendor_id != SIFIVE_VENDOR_ID) continue; - if (alt->errata_id >= ERRATA_SIFIVE_NUMBER) { - WARN(1, "This errata id:%d is not in kernel errata list", alt->errata_id); + if (alt->patch_id >= ERRATA_SIFIVE_NUMBER) { + WARN(1, "This errata id:%d is not in kernel errata list", alt->patch_id); continue; } - tmp = (1U << alt->errata_id); + tmp = (1U << alt->patch_id); if (cpu_req_errata & tmp) { patch_text_nosync(ALT_OLD_PTR(alt), ALT_ALT_PTR(alt), alt->alt_len); diff --git a/arch/riscv/errata/thead/errata.c b/arch/riscv/errata/thead/errata.c index 1dd90a5f86f0..39fc144f1b1f 100644 --- a/arch/riscv/errata/thead/errata.c +++ b/arch/riscv/errata/thead/errata.c @@ -92,10 +92,10 @@ void __init_or_module thead_errata_patch_func(struct alt_entry *begin, struct al for (alt = begin; alt < end; alt++) { if (alt->vendor_id != THEAD_VENDOR_ID) continue; - if (alt->errata_id >= ERRATA_THEAD_NUMBER) + if (alt->patch_id >= ERRATA_THEAD_NUMBER) continue; - tmp = (1U << alt->errata_id); + tmp = (1U << alt->patch_id); if (cpu_req_errata & tmp) { oldptr = ALT_OLD_PTR(alt); altptr = ALT_ALT_PTR(alt); diff --git a/arch/riscv/include/asm/alternative-macros.h b/arch/riscv/include/asm/alternative-macros.h index 51c6867e02f3..993a44a8fdac 100644 --- a/arch/riscv/include/asm/alternative-macros.h +++ b/arch/riscv/include/asm/alternative-macros.h @@ -6,18 +6,18 @@ #ifdef __ASSEMBLY__ -.macro ALT_ENTRY oldptr newptr vendor_id errata_id new_len +.macro ALT_ENTRY oldptr newptr vendor_id patch_id new_len .4byte \oldptr - . .4byte \newptr - . .2byte \vendor_id .2byte \new_len - .4byte \errata_id + .4byte \patch_id .endm -.macro ALT_NEW_CONTENT vendor_id, errata_id, enable = 1, new_c : vararg +.macro ALT_NEW_CONTENT vendor_id, patch_id, enable = 1, new_c : vararg .if \enable .pushsection .alternative, "a" - ALT_ENTRY 886b, 888f, \vendor_id, \errata_id, 889f - 888f + ALT_ENTRY 886b, 888f, \vendor_id, \patch_id, 889f - 888f .popsection .subsection 1 888 : @@ -33,7 +33,7 @@ .endif .endm -.macro ALTERNATIVE_CFG old_c, new_c, vendor_id, errata_id, enable +.macro ALTERNATIVE_CFG old_c, new_c, vendor_id, patch_id, enable 886 : .option push .option norvc @@ -41,13 +41,13 @@ \old_c .option pop 887 : - ALT_NEW_CONTENT \vendor_id, \errata_id, \enable, \new_c + ALT_NEW_CONTENT \vendor_id, \patch_id, \enable, \new_c .endm -.macro ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, errata_id_1, enable_1, \ - new_c_2, vendor_id_2, errata_id_2, enable_2 - ALTERNATIVE_CFG "\old_c", "\new_c_1", \vendor_id_1, \errata_id_1, \enable_1 - ALT_NEW_CONTENT \vendor_id_2, \errata_id_2, \enable_2, \new_c_2 +.macro ALTERNATIVE_CFG_2 old_c, new_c_1, vendor_id_1, patch_id_1, enable_1, \ + new_c_2, vendor_id_2, patch_id_2, enable_2 + ALTERNATIVE_CFG "\old_c", "\new_c_1", \vendor_id_1, \patch_id_1, \enable_1 + ALT_NEW_CONTENT \vendor_id_2, \patch_id_2, \enable_2, \new_c_2 .endm #define __ALTERNATIVE_CFG(...) ALTERNATIVE_CFG __VA_ARGS__ @@ -58,17 +58,17 @@ #include <asm/asm.h> #include <linux/stringify.h> -#define ALT_ENTRY(oldptr, newptr, vendor_id, errata_id, newlen) \ +#define ALT_ENTRY(oldptr, newptr, vendor_id, patch_id, newlen) \ ".4byte ((" oldptr ") - .) \n" \ ".4byte ((" newptr ") - .) \n" \ ".2byte " vendor_id "\n" \ ".2byte " newlen "\n" \ - ".4byte " errata_id "\n" + ".4byte " patch_id "\n" -#define ALT_NEW_CONTENT(vendor_id, errata_id, enable, new_c) \ +#define ALT_NEW_CONTENT(vendor_id, patch_id, enable, new_c) \ ".if " __stringify(enable) " == 1\n" \ ".pushsection .alternative, \"a\"\n" \ - ALT_ENTRY("886b", "888f", __stringify(vendor_id), __stringify(errata_id), "889f - 888f") \ + ALT_ENTRY("886b", "888f", __stringify(vendor_id), __stringify(patch_id), "889f - 888f") \ ".popsection\n" \ ".subsection 1\n" \ "888 :\n" \ @@ -83,7 +83,7 @@ ".previous\n" \ ".endif\n" -#define __ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, enable) \ +#define __ALTERNATIVE_CFG(old_c, new_c, vendor_id, patch_id, enable) \ "886 :\n" \ ".option push\n" \ ".option norvc\n" \ @@ -91,22 +91,22 @@ old_c "\n" \ ".option pop\n" \ "887 :\n" \ - ALT_NEW_CONTENT(vendor_id, errata_id, enable, new_c) + ALT_NEW_CONTENT(vendor_id, patch_id, enable, new_c) -#define __ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, enable_1, \ - new_c_2, vendor_id_2, errata_id_2, enable_2) \ - __ALTERNATIVE_CFG(old_c, new_c_1, vendor_id_1, errata_id_1, enable_1) \ - ALT_NEW_CONTENT(vendor_id_2, errata_id_2, enable_2, new_c_2) +#define __ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, patch_id_1, enable_1, \ + new_c_2, vendor_id_2, patch_id_2, enable_2) \ + __ALTERNATIVE_CFG(old_c, new_c_1, vendor_id_1, patch_id_1, enable_1) \ + ALT_NEW_CONTENT(vendor_id_2, patch_id_2, enable_2, new_c_2) #endif /* __ASSEMBLY__ */ -#define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, CONFIG_k) \ - __ALTERNATIVE_CFG(old_c, new_c, vendor_id, errata_id, IS_ENABLED(CONFIG_k)) +#define _ALTERNATIVE_CFG(old_c, new_c, vendor_id, patch_id, CONFIG_k) \ + __ALTERNATIVE_CFG(old_c, new_c, vendor_id, patch_id, IS_ENABLED(CONFIG_k)) -#define _ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, CONFIG_k_1, \ - new_c_2, vendor_id_2, errata_id_2, CONFIG_k_2) \ - __ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, errata_id_1, IS_ENABLED(CONFIG_k_1), \ - new_c_2, vendor_id_2, errata_id_2, IS_ENABLED(CONFIG_k_2)) +#define _ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, patch_id_1, CONFIG_k_1, \ + new_c_2, vendor_id_2, patch_id_2, CONFIG_k_2) \ + __ALTERNATIVE_CFG_2(old_c, new_c_1, vendor_id_1, patch_id_1, IS_ENABLED(CONFIG_k_1), \ + new_c_2, vendor_id_2, patch_id_2, IS_ENABLED(CONFIG_k_2)) #else /* CONFIG_RISCV_ALTERNATIVE */ #ifdef __ASSEMBLY__ @@ -137,19 +137,19 @@ /* * Usage: - * ALTERNATIVE(old_content, new_content, vendor_id, errata_id, CONFIG_k) + * ALTERNATIVE(old_content, new_content, vendor_id, patch_id, CONFIG_k) * in the assembly code. Otherwise, - * asm(ALTERNATIVE(old_content, new_content, vendor_id, errata_id, CONFIG_k)); + * asm(ALTERNATIVE(old_content, new_content, vendor_id, patch_id, CONFIG_k)); * * old_content: The old content which is probably replaced with new content. * new_content: The new content. * vendor_id: The CPU vendor ID. - * errata_id: The errata ID. - * CONFIG_k: The Kconfig of this errata. When Kconfig is disabled, the old + * patch_id: The patch ID (erratum ID or cpufeature ID). + * CONFIG_k: The Kconfig of this patch ID. When Kconfig is disabled, the old * content will alwyas be executed. */ -#define ALTERNATIVE(old_content, new_content, vendor_id, errata_id, CONFIG_k) \ - _ALTERNATIVE_CFG(old_content, new_content, vendor_id, errata_id, CONFIG_k) +#define ALTERNATIVE(old_content, new_content, vendor_id, patch_id, CONFIG_k) \ + _ALTERNATIVE_CFG(old_content, new_content, vendor_id, patch_id, CONFIG_k) /* * A vendor wants to replace an old_content, but another vendor has used @@ -158,9 +158,9 @@ * on the following sample code and then replace ALTERNATIVE() with * ALTERNATIVE_2() to append its customized content. */ -#define ALTERNATIVE_2(old_content, new_content_1, vendor_id_1, errata_id_1, CONFIG_k_1, \ - new_content_2, vendor_id_2, errata_id_2, CONFIG_k_2) \ - _ALTERNATIVE_CFG_2(old_content, new_content_1, vendor_id_1, errata_id_1, CONFIG_k_1, \ - new_content_2, vendor_id_2, errata_id_2, CONFIG_k_2) +#define ALTERNATIVE_2(old_content, new_content_1, vendor_id_1, patch_id_1, CONFIG_k_1, \ + new_content_2, vendor_id_2, patch_id_2, CONFIG_k_2) \ + _ALTERNATIVE_CFG_2(old_content, new_content_1, vendor_id_1, patch_id_1, CONFIG_k_1, \ + new_content_2, vendor_id_2, patch_id_2, CONFIG_k_2) #endif diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h index 3beef400a971..8f39d4e8598d 100644 --- a/arch/riscv/include/asm/alternative.h +++ b/arch/riscv/include/asm/alternative.h @@ -38,7 +38,7 @@ struct alt_entry { s32 alt_offset; /* offset relative to replacement instruction or data */ u16 vendor_id; /* cpu vendor id */ u16 alt_len; /* The replacement size */ - u32 errata_id; /* The errata id */ + u32 patch_id; /* The patch ID (erratum ID or cpufeature ID) */ }; void sifive_errata_patch_func(struct alt_entry *begin, struct alt_entry *end, diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 21fb567e1b22..85c99ae64017 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -281,13 +281,13 @@ void __init_or_module riscv_cpufeature_patch_func(struct alt_entry *begin, for (alt = begin; alt < end; alt++) { if (alt->vendor_id != 0) continue; - if (alt->errata_id >= RISCV_ISA_EXT_MAX) { + if (alt->patch_id >= RISCV_ISA_EXT_MAX) { WARN(1, "This extension id:%d is not in ISA extension list", - alt->errata_id); + alt->patch_id); continue; } - if (!__riscv_isa_extension_available(NULL, alt->errata_id)) + if (!__riscv_isa_extension_available(NULL, alt->patch_id)) continue; oldptr = ALT_OLD_PTR(alt); -- 2.39.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 3/5] riscv: alternatives: Rename errata_id to patch_id 2023-02-21 18:56 ` [PATCH 3/5] riscv: alternatives: Rename errata_id to patch_id Andrew Jones @ 2023-02-23 23:24 ` Conor Dooley 2023-02-24 8:06 ` Andrew Jones 2023-02-24 12:46 ` Heiko Stübner 1 sibling, 1 reply; 18+ messages in thread From: Conor Dooley @ 2023-02-23 23:24 UTC (permalink / raw) To: Andrew Jones Cc: linux-riscv, 'Jisheng Zhang ', 'Heiko Stuebner ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' [-- Attachment #1.1: Type: text/plain, Size: 2509 bytes --] On Tue, Feb 21, 2023 at 07:56:01PM +0100, Andrew Jones wrote: > Alternatives are used for both errata and cpufeatures. Use a more > generic name, 'patch_id', as in "ID of code patching site", to > avoid confusion when alternatives are used for cpufeatures. > > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> > --- > arch/riscv/Kconfig | 6 +- > arch/riscv/errata/sifive/errata.c | 6 +- > arch/riscv/errata/thead/errata.c | 4 +- > arch/riscv/include/asm/alternative-macros.h | 72 ++++++++++----------- > arch/riscv/include/asm/alternative.h | 2 +- > arch/riscv/kernel/cpufeature.c | 6 +- > 6 files changed, 48 insertions(+), 48 deletions(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 736f42f572aa..0c494c36e911 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -377,9 +377,9 @@ config RISCV_ALTERNATIVE > depends on !XIP_KERNEL > help > This Kconfig allows the kernel to automatically patch the > - errata required by the execution platform at run time. The > - code patching is performed once in the boot stages. It means > - that the overhead from this mechanism is just taken once. > + erratum or cpufeature required by the execution platform at run > + time. The code patching is performed once in the boot stages. It > + means that the overhead from this mechanism is just taken once. A line in this comment doesn't really make much sense to an unfamiliar reader. "Once in the boot stages"? That's just not true, is it? Code patching for alternatives happens more than once and not just during boot? Not this patch's doing though! > diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h > index 3beef400a971..8f39d4e8598d 100644 > --- a/arch/riscv/include/asm/alternative.h > +++ b/arch/riscv/include/asm/alternative.h > @@ -38,7 +38,7 @@ struct alt_entry { > s32 alt_offset; /* offset relative to replacement instruction or data */ > u16 vendor_id; /* cpu vendor id */ > u16 alt_len; /* The replacement size */ > - u32 errata_id; /* The errata id */ > + u32 patch_id; /* The patch ID (erratum ID or cpufeature ID) */ The inconsistent use of ID versus id in these comments bothers my OCD! Either way, "patch" is a more accurate description of the usage than errata, so I am on board. Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Thanks, Conor. [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] [-- Attachment #2: Type: text/plain, Size: 161 bytes --] _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 3/5] riscv: alternatives: Rename errata_id to patch_id 2023-02-23 23:24 ` Conor Dooley @ 2023-02-24 8:06 ` Andrew Jones 0 siblings, 0 replies; 18+ messages in thread From: Andrew Jones @ 2023-02-24 8:06 UTC (permalink / raw) To: Conor Dooley Cc: linux-riscv, 'Jisheng Zhang ', 'Heiko Stuebner ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' On Thu, Feb 23, 2023 at 11:24:41PM +0000, Conor Dooley wrote: > On Tue, Feb 21, 2023 at 07:56:01PM +0100, Andrew Jones wrote: > > Alternatives are used for both errata and cpufeatures. Use a more > > generic name, 'patch_id', as in "ID of code patching site", to > > avoid confusion when alternatives are used for cpufeatures. > > > > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> > > --- > > arch/riscv/Kconfig | 6 +- > > arch/riscv/errata/sifive/errata.c | 6 +- > > arch/riscv/errata/thead/errata.c | 4 +- > > arch/riscv/include/asm/alternative-macros.h | 72 ++++++++++----------- > > arch/riscv/include/asm/alternative.h | 2 +- > > arch/riscv/kernel/cpufeature.c | 6 +- > > 6 files changed, 48 insertions(+), 48 deletions(-) > > > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > > index 736f42f572aa..0c494c36e911 100644 > > --- a/arch/riscv/Kconfig > > +++ b/arch/riscv/Kconfig > > @@ -377,9 +377,9 @@ config RISCV_ALTERNATIVE > > depends on !XIP_KERNEL > > help > > This Kconfig allows the kernel to automatically patch the > > - errata required by the execution platform at run time. The > > - code patching is performed once in the boot stages. It means > > - that the overhead from this mechanism is just taken once. > > + erratum or cpufeature required by the execution platform at run > > + time. The code patching is performed once in the boot stages. It > > + means that the overhead from this mechanism is just taken once. > > A line in this comment doesn't really make much sense to an unfamiliar > reader. "Once in the boot stages"? That's just not true, is it? > Code patching for alternatives happens more than once and not just > during boot? Not this patch's doing though! Right, code patching also happens at module load time. Reworking this paragraph would be another nice cleanup. I can respin this series with another patch doing that, along with picking up other suggestions you have. > > > diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h > > index 3beef400a971..8f39d4e8598d 100644 > > --- a/arch/riscv/include/asm/alternative.h > > +++ b/arch/riscv/include/asm/alternative.h > > @@ -38,7 +38,7 @@ struct alt_entry { > > s32 alt_offset; /* offset relative to replacement instruction or data */ > > u16 vendor_id; /* cpu vendor id */ > > u16 alt_len; /* The replacement size */ > > - u32 errata_id; /* The errata id */ > > + u32 patch_id; /* The patch ID (erratum ID or cpufeature ID) */ > > The inconsistent use of ID versus id in these comments bothers my OCD! I'll sneak a change in of vendor_id's comment to 'CPU vendor ID' for v2. > > Either way, "patch" is a more accurate description of the usage than > errata, so I am on board. > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Thanks, drew _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 3/5] riscv: alternatives: Rename errata_id to patch_id 2023-02-21 18:56 ` [PATCH 3/5] riscv: alternatives: Rename errata_id to patch_id Andrew Jones 2023-02-23 23:24 ` Conor Dooley @ 2023-02-24 12:46 ` Heiko Stübner 1 sibling, 0 replies; 18+ messages in thread From: Heiko Stübner @ 2023-02-24 12:46 UTC (permalink / raw) To: linux-riscv, Andrew Jones Cc: 'Jisheng Zhang ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' Am Dienstag, 21. Februar 2023, 19:56:01 CET schrieb Andrew Jones: > Alternatives are used for both errata and cpufeatures. Use a more > generic name, 'patch_id', as in "ID of code patching site", to > avoid confusion when alternatives are used for cpufeatures. > > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> We moved away from alternatives only being used for erratas, so it makes a lot of sense to name this sensible Reviewed-by: Heiko Stuebner <heiko.stuebner@vrull.eu> _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 4/5] riscv: lib: Include hwcap.h directly 2023-02-21 18:55 [PATCH 0/5] riscv: alternative/cpufeature related cleanups Andrew Jones ` (2 preceding siblings ...) 2023-02-21 18:56 ` [PATCH 3/5] riscv: alternatives: Rename errata_id to patch_id Andrew Jones @ 2023-02-21 18:56 ` Andrew Jones 2023-02-23 23:25 ` Conor Dooley 2023-02-24 12:46 ` Heiko Stübner 2023-02-21 18:56 ` [PATCH 5/5] riscv: cpufeature: Drop unused includes Andrew Jones 4 siblings, 2 replies; 18+ messages in thread From: Andrew Jones @ 2023-02-21 18:56 UTC (permalink / raw) To: linux-riscv Cc: 'Jisheng Zhang ', 'Heiko Stuebner ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' When using alternatives for cpufeatures we should include hwcap.h directly, rather than through errata_list.h. Opportunistically drop an unused include too. Signed-off-by: Andrew Jones <ajones@ventanamicro.com> --- arch/riscv/lib/strcmp.S | 3 +-- arch/riscv/lib/strlen.S | 3 +-- arch/riscv/lib/strncmp.S | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/riscv/lib/strcmp.S b/arch/riscv/lib/strcmp.S index 986ab23fe787..4f9b80dfb5db 100644 --- a/arch/riscv/lib/strcmp.S +++ b/arch/riscv/lib/strcmp.S @@ -2,9 +2,8 @@ #include <linux/linkage.h> #include <asm/asm.h> -#include <asm-generic/export.h> #include <asm/alternative-macros.h> -#include <asm/errata_list.h> +#include <asm/hwcap.h> /* int strcmp(const char *cs, const char *ct) */ SYM_FUNC_START(strcmp) diff --git a/arch/riscv/lib/strlen.S b/arch/riscv/lib/strlen.S index 8345ceeee3f6..ed78449f2e05 100644 --- a/arch/riscv/lib/strlen.S +++ b/arch/riscv/lib/strlen.S @@ -2,9 +2,8 @@ #include <linux/linkage.h> #include <asm/asm.h> -#include <asm-generic/export.h> #include <asm/alternative-macros.h> -#include <asm/errata_list.h> +#include <asm/hwcap.h> /* int strlen(const char *s) */ SYM_FUNC_START(strlen) diff --git a/arch/riscv/lib/strncmp.S b/arch/riscv/lib/strncmp.S index ee49595075be..e4e97d9b4e4e 100644 --- a/arch/riscv/lib/strncmp.S +++ b/arch/riscv/lib/strncmp.S @@ -2,9 +2,8 @@ #include <linux/linkage.h> #include <asm/asm.h> -#include <asm-generic/export.h> #include <asm/alternative-macros.h> -#include <asm/errata_list.h> +#include <asm/hwcap.h> /* int strncmp(const char *cs, const char *ct, size_t count) */ SYM_FUNC_START(strncmp) -- 2.39.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 4/5] riscv: lib: Include hwcap.h directly 2023-02-21 18:56 ` [PATCH 4/5] riscv: lib: Include hwcap.h directly Andrew Jones @ 2023-02-23 23:25 ` Conor Dooley 2023-02-24 12:46 ` Heiko Stübner 1 sibling, 0 replies; 18+ messages in thread From: Conor Dooley @ 2023-02-23 23:25 UTC (permalink / raw) To: Andrew Jones Cc: linux-riscv, 'Jisheng Zhang ', 'Heiko Stuebner ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' [-- Attachment #1.1: Type: text/plain, Size: 350 bytes --] On Tue, Feb 21, 2023 at 07:56:02PM +0100, Andrew Jones wrote: > When using alternatives for cpufeatures we should include hwcap.h > directly, rather than through errata_list.h. Opportunistically drop > an unused include too. > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] [-- Attachment #2: Type: text/plain, Size: 161 bytes --] _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/5] riscv: lib: Include hwcap.h directly 2023-02-21 18:56 ` [PATCH 4/5] riscv: lib: Include hwcap.h directly Andrew Jones 2023-02-23 23:25 ` Conor Dooley @ 2023-02-24 12:46 ` Heiko Stübner 1 sibling, 0 replies; 18+ messages in thread From: Heiko Stübner @ 2023-02-24 12:46 UTC (permalink / raw) To: linux-riscv, Andrew Jones Cc: 'Jisheng Zhang ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' Am Dienstag, 21. Februar 2023, 19:56:02 CET schrieb Andrew Jones: > When using alternatives for cpufeatures we should include hwcap.h > directly, rather than through errata_list.h. Opportunistically drop > an unused include too. > > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Heiko Stuebner <heiko.stuebner@vrull.eu> _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 5/5] riscv: cpufeature: Drop unused includes 2023-02-21 18:55 [PATCH 0/5] riscv: alternative/cpufeature related cleanups Andrew Jones ` (3 preceding siblings ...) 2023-02-21 18:56 ` [PATCH 4/5] riscv: lib: Include hwcap.h directly Andrew Jones @ 2023-02-21 18:56 ` Andrew Jones 2023-02-23 23:29 ` Conor Dooley 2023-02-24 12:48 ` Heiko Stübner 4 siblings, 2 replies; 18+ messages in thread From: Andrew Jones @ 2023-02-21 18:56 UTC (permalink / raw) To: linux-riscv Cc: 'Jisheng Zhang ', 'Heiko Stuebner ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' Do some additional include pruning while dropping errata_list.h, which is getting dropped, since cpufeature.c includes hwcap.h directly to get cpufeature IDs. Signed-off-by: Andrew Jones <ajones@ventanamicro.com> --- arch/riscv/kernel/cpufeature.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 85c99ae64017..151e1a715db9 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -8,19 +8,14 @@ #include <linux/bitmap.h> #include <linux/ctype.h> -#include <linux/libfdt.h> #include <linux/log2.h> #include <linux/module.h> #include <linux/of.h> #include <asm/alternative.h> #include <asm/cacheflush.h> -#include <asm/errata_list.h> #include <asm/hwcap.h> #include <asm/patch.h> -#include <asm/pgtable.h> #include <asm/processor.h> -#include <asm/smp.h> -#include <asm/switch_to.h> #define NUM_ALPHA_EXTS ('z' - 'a' + 1) -- 2.39.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 5/5] riscv: cpufeature: Drop unused includes 2023-02-21 18:56 ` [PATCH 5/5] riscv: cpufeature: Drop unused includes Andrew Jones @ 2023-02-23 23:29 ` Conor Dooley 2023-02-24 8:06 ` Andrew Jones 2023-02-24 12:48 ` Heiko Stübner 1 sibling, 1 reply; 18+ messages in thread From: Conor Dooley @ 2023-02-23 23:29 UTC (permalink / raw) To: Andrew Jones Cc: linux-riscv, 'Jisheng Zhang ', 'Heiko Stuebner ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' [-- Attachment #1.1: Type: text/plain, Size: 1585 bytes --] On Tue, Feb 21, 2023 at 07:56:03PM +0100, Andrew Jones wrote: > Do some additional include pruning while dropping errata_list.h, > which is getting dropped, since cpufeature.c includes hwcap.h > directly to get cpufeature IDs. This commit message is a wee bit confusingly written. Not advocating for a respin by any means, but putting the thing that motivated the change before the opportunistic cleanups would have made more sense to me. /shrug Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> > --- > arch/riscv/kernel/cpufeature.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c > index 85c99ae64017..151e1a715db9 100644 > --- a/arch/riscv/kernel/cpufeature.c > +++ b/arch/riscv/kernel/cpufeature.c > @@ -8,19 +8,14 @@ > > #include <linux/bitmap.h> > #include <linux/ctype.h> > -#include <linux/libfdt.h> > #include <linux/log2.h> > #include <linux/module.h> > #include <linux/of.h> > #include <asm/alternative.h> > #include <asm/cacheflush.h> > -#include <asm/errata_list.h> > #include <asm/hwcap.h> > #include <asm/patch.h> > -#include <asm/pgtable.h> > #include <asm/processor.h> > -#include <asm/smp.h> > -#include <asm/switch_to.h> > > #define NUM_ALPHA_EXTS ('z' - 'a' + 1) > > -- > 2.39.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] [-- Attachment #2: Type: text/plain, Size: 161 bytes --] _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 5/5] riscv: cpufeature: Drop unused includes 2023-02-23 23:29 ` Conor Dooley @ 2023-02-24 8:06 ` Andrew Jones 0 siblings, 0 replies; 18+ messages in thread From: Andrew Jones @ 2023-02-24 8:06 UTC (permalink / raw) To: Conor Dooley Cc: linux-riscv, 'Jisheng Zhang ', 'Heiko Stuebner ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' On Thu, Feb 23, 2023 at 11:29:43PM +0000, Conor Dooley wrote: > On Tue, Feb 21, 2023 at 07:56:03PM +0100, Andrew Jones wrote: > > Do some additional include pruning while dropping errata_list.h, > > which is getting dropped, since cpufeature.c includes hwcap.h > > directly to get cpufeature IDs. > > This commit message is a wee bit confusingly written. Not advocating > for a respin by any means, but putting the thing that motivated the > change before the opportunistic cleanups would have made more sense to I'll rearrange the text for v2. > me. /shrug > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Thanks, drew > > > > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> > > --- > > arch/riscv/kernel/cpufeature.c | 5 ----- > > 1 file changed, 5 deletions(-) > > > > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c > > index 85c99ae64017..151e1a715db9 100644 > > --- a/arch/riscv/kernel/cpufeature.c > > +++ b/arch/riscv/kernel/cpufeature.c > > @@ -8,19 +8,14 @@ > > > > #include <linux/bitmap.h> > > #include <linux/ctype.h> > > -#include <linux/libfdt.h> > > #include <linux/log2.h> > > #include <linux/module.h> > > #include <linux/of.h> > > #include <asm/alternative.h> > > #include <asm/cacheflush.h> > > -#include <asm/errata_list.h> > > #include <asm/hwcap.h> > > #include <asm/patch.h> > > -#include <asm/pgtable.h> > > #include <asm/processor.h> > > -#include <asm/smp.h> > > -#include <asm/switch_to.h> > > > > #define NUM_ALPHA_EXTS ('z' - 'a' + 1) > > > > -- > > 2.39.1 > > > > > > _______________________________________________ > > linux-riscv mailing list > > linux-riscv@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-riscv _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 5/5] riscv: cpufeature: Drop unused includes 2023-02-21 18:56 ` [PATCH 5/5] riscv: cpufeature: Drop unused includes Andrew Jones 2023-02-23 23:29 ` Conor Dooley @ 2023-02-24 12:48 ` Heiko Stübner 1 sibling, 0 replies; 18+ messages in thread From: Heiko Stübner @ 2023-02-24 12:48 UTC (permalink / raw) To: linux-riscv, Andrew Jones Cc: 'Jisheng Zhang ', 'Paul Walmsley ', 'Palmer Dabbelt ', 'Conor Dooley ', 'Albert Ou ' Am Dienstag, 21. Februar 2023, 19:56:03 CET schrieb Andrew Jones: > Do some additional include pruning while dropping errata_list.h, > which is getting dropped, since cpufeature.c includes hwcap.h > directly to get cpufeature IDs. > > Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Heiko Stuebner <heiko.stuebner@vrull.eu> _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2023-02-24 12:48 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-02-21 18:55 [PATCH 0/5] riscv: alternative/cpufeature related cleanups Andrew Jones 2023-02-21 18:55 ` [PATCH 1/5] riscv: Rename Kconfig.erratas to Kconfig.errata Andrew Jones 2023-02-23 23:11 ` Conor Dooley 2023-02-24 12:37 ` Heiko Stübner 2023-02-21 18:56 ` [PATCH 2/5] riscv: alternatives: Remove unnecessary define and unused struct Andrew Jones 2023-02-23 23:14 ` Conor Dooley 2023-02-24 12:44 ` Heiko Stübner 2023-02-21 18:56 ` [PATCH 3/5] riscv: alternatives: Rename errata_id to patch_id Andrew Jones 2023-02-23 23:24 ` Conor Dooley 2023-02-24 8:06 ` Andrew Jones 2023-02-24 12:46 ` Heiko Stübner 2023-02-21 18:56 ` [PATCH 4/5] riscv: lib: Include hwcap.h directly Andrew Jones 2023-02-23 23:25 ` Conor Dooley 2023-02-24 12:46 ` Heiko Stübner 2023-02-21 18:56 ` [PATCH 5/5] riscv: cpufeature: Drop unused includes Andrew Jones 2023-02-23 23:29 ` Conor Dooley 2023-02-24 8:06 ` Andrew Jones 2023-02-24 12:48 ` 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