RISC-V: Don't include Zicsr or Zifencei in I from ACPI
PATCH 1/1 RISC-V: Don't include Zicsr or Zifencei in I from ACPI
ACPI ISA strings are based on a specification after Zicsr and Zifencei were split out of I, so we shouldn't be treating them as part of I. We haven't release an ACPI-based kernel yet, so we don't need to worry about compatibility with the old ISA strings.
--- arch/riscv/kernel/cpufeature.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
arch/riscv/kernel/cpufeature.c +2 -7
@@ -317,19 +317,14 @@ void __init riscv_fill_hwcap(void)#undef SET_ISA_EXT_MAP } -/* -* Linux requires the following extensions, so we may as well -* always set them. -*/ -set_bit (RISCV_ISA_EXT_ZICSR , isainfo->isa); -set_bit (RISCV_ISA_EXT_ZIFENCEI , isainfo->isa); -/* * These ones were as they were part of the base ISA when the * port & dt-bindings were upstreamed, and so can be set * unconditionally where `i` is in riscv,isa on DT systems. */ if (acpi_disabled) { +set_bit (RISCV_ISA_EXT_ZICSR , isainfo->isa); +set_bit (RISCV_ISA_EXT_ZIFENCEI , isainfo->isa);set_bit (RISCV_ISA_EXT_ZICNTR , isainfo->isa);set_bit (RISCV_ISA_EXT_ZIHPM , isainfo->isa); }
Signature · 1 line
2.40.1
Quoted 6 lines · Palmer Dabbelt
ACPI ISA strings are based on a specification after Zicsr and Zifencei were split out of I, so we shouldn't be treating them as part of I. We haven't release an ACPI-based kernel yet, so we don't need to worry about compatibility with the old ISA strings.
Fixes 396c018332a1 ("RISC-V: cpufeature: Add ACPI support in riscv_fill_hwcap()")
I think, if anything, this is actually:
Although my rationale was that if we get as far as here, then Zicsr and Zifencei are going to be enabled anyway so there is no harm in setting it for both. I probably should have been less of a cute hoor though.
Cheers,
Conor.
Quoted 39 lines
Signed-off-by Palmer Dabbelt <[email protected]>--- arch/riscv/kernel/cpufeature.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)arch/riscv/kernel/cpufeature.c +2
-7@@ -317,19 +317,14 @@ void __init riscv_fill_hwcap(void)#undef SET_ISA_EXT_MAP } -/* -* Linux requires the following extensions, so we may as well -* always set them. -*/ -set_bit (RISCV_ISA_EXT_ZICSR , isainfo->isa); -set_bit (RISCV_ISA_EXT_ZIFENCEI , isainfo->isa); -/* * These ones were as they were part of the base ISA when the * port & dt-bindings were upstreamed, and so can be set * unconditionally where `i` is in riscv,isa on DT systems. */ if (acpi_disabled) { +set_bit (RISCV_ISA_EXT_ZICSR , isainfo->isa); +set_bit (RISCV_ISA_EXT_ZIFENCEI , isainfo->isa);set_bit (RISCV_ISA_EXT_ZICNTR , isainfo->isa);set_bit (RISCV_ISA_EXT_ZIHPM , isainfo->isa); }Signature · 7 lines
2.40.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 8 lines · Conor Dooley
Quoted 6 lines · Palmer Dabbelt
ACPI ISA strings are based on a specification after Zicsr and Zifencei were split out of I, so we shouldn't be treating them as part of I. We haven't release an ACPI-based kernel yet, so we don't need to worry about compatibility with the old ISA strings.
Fixes 396c018332a1 ("RISC-V: cpufeature: Add ACPI support in riscv_fill_hwcap()")
Quoted 7 lines
I think, if anything, this is actually:
Fixes 07edc32779e3 ("RISC-V: always report presence of extensions formerly part of the base ISA")Although my rationale was that if we get as far as here, then Zicsr and Zifencei are going to be enabled anyway so there is no harm in setting it for both. I probably should have been less of a cute hoor though.
Reviewed-by Conor Dooley <[email protected]>
I think there's no way to get here without the extensions, not 100% sure though. I'm mainly trying to avoid going down the same rabbit hole of ISA string compatibility hacks in ACPI that we have for DT, though -- I'm sure we'll end up with a mess as soon as we release, but might as well catch as much as we can.
Quoted 43 lines
Cheers,
Conor.Quoted 39 lines
Signed-off-by Palmer Dabbelt <[email protected]>--- arch/riscv/kernel/cpufeature.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)arch/riscv/kernel/cpufeature.c +2
-7@@ -317,19 +317,14 @@ void __init riscv_fill_hwcap(void)#undef SET_ISA_EXT_MAP } -/* -* Linux requires the following extensions, so we may as well -* always set them. -*/ -set_bit (RISCV_ISA_EXT_ZICSR , isainfo->isa); -set_bit (RISCV_ISA_EXT_ZIFENCEI , isainfo->isa); -/* * These ones were as they were part of the base ISA when the * port & dt-bindings were upstreamed, and so can be set * unconditionally where `i` is in riscv,isa on DT systems. */ if (acpi_disabled) { +set_bit (RISCV_ISA_EXT_ZICSR , isainfo->isa); +set_bit (RISCV_ISA_EXT_ZIFENCEI , isainfo->isa);set_bit (RISCV_ISA_EXT_ZICNTR , isainfo->isa);set_bit (RISCV_ISA_EXT_ZIHPM , isainfo->isa); }Signature · 7 lines
2.40.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 7 lines · Palmer Dabbelt
Quoted 4 lines · Conor Dooley
Although my rationale was that if we get as far as here, then Zicsr and Zifencei are going to be enabled anyway so there is no harm in setting it for both. I probably should have been less of a cute hoor though.
Reviewed-by Conor Dooley <[email protected]>
Quoted 5 lines
I think there's no way to get here without the extensions, not 100% sure though. I'm mainly trying to avoid going down the same rabbit hole of ISA string compatibility hacks in ACPI that we have for DT, though -- I'm sure we'll end up with a mess as soon as we release, but might as well catch as much as we can.
Seems reasonable to me chief :+1:
Quoted 8 lines · Palmer Dabbelt
ACPI ISA strings are based on a specification after Zicsr and Zifencei were split out of I, so we shouldn't be treating them as part of I. We haven't release an ACPI-based kernel yet, so we don't need to worry about compatibility with the old ISA strings.
Fixes 396c018332a1 ("RISC-V: cpufeature: Add ACPI support in riscv_fill_hwcap()")Signed-off-by Palmer Dabbelt <[email protected]>---
LGTM. I agree with Conor that Fixes tag should point to 07edc32779e3.
Thanks,
Sunil
Quoted 32 lines
arch/riscv/kernel/cpufeature.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)arch/riscv/kernel/cpufeature.c +2
-7@@ -317,19 +317,14 @@ void __init riscv_fill_hwcap(void)#undef SET_ISA_EXT_MAP } -/* -* Linux requires the following extensions, so we may as well -* always set them. -*/ -set_bit (RISCV_ISA_EXT_ZICSR , isainfo->isa); -set_bit (RISCV_ISA_EXT_ZIFENCEI , isainfo->isa); -/* * These ones were as they were part of the base ISA when the * port & dt-bindings were upstreamed, and so can be set * unconditionally where `i` is in riscv,isa on DT systems. */ if (acpi_disabled) { +set_bit (RISCV_ISA_EXT_ZICSR , isainfo->isa); +set_bit (RISCV_ISA_EXT_ZIFENCEI , isainfo->isa);set_bit (RISCV_ISA_EXT_ZICNTR , isainfo->isa);set_bit (RISCV_ISA_EXT_ZIHPM , isainfo->isa); }Signature · 1 line
2.40.1
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
This patch was applied to riscv/linux.git (fixes) by Palmer Dabbelt <[email protected]>:
Hello:
This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <[email protected]>:
Quoted 9 lines · On Tue, 11 Jul 2023 15:46:00 -0700 you wrote:
ACPI ISA strings are based on a specification after Zicsr and Zifencei were split out of I, so we shouldn't be treating them as part of I. We haven't release an ACPI-based kernel yet, so we don't need to worry about compatibility with the old ISA strings.
Fixes 396c018332a1 ("RISC-V: cpufeature: Add ACPI support in riscv_fill_hwcap()")Signed-off-by Palmer Dabbelt <[email protected]>[...]
Here is the summary with links:
- RISC-V: Don't include Zicsr or Zifencei in I from ACPI
https://git.kernel.org/riscv/c/ab2dbc7acced
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html