[PW_SID:956712] riscv: add SBI FWFT misaligned exception delegation support#341
[PW_SID:956712] riscv: add SBI FWFT misaligned exception delegation support#341linux-riscv-bot wants to merge 15 commits into
Conversation
The Firmware Features extension (FWFT) was added as part of the SBI 3.0 specification. Add SBI definitions to use this extension. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Samuel Holland <samuel.holland@sifive.com> Tested-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Deepak Gupta <debug@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
A few parenthesis in check for SBI version/extension were useless, remove them. Signed-off-by: Clément Léger <cleger@rivosinc.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
A few new errors have been added with SBI V3.0, maps them as close as possible to errno values. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
This SBI extensions enables supervisor mode to control feature that are under M-mode control (For instance, Svadu menvcfg ADUE bit, Ssdbltrp DTE, etc). Add an interface to set local features for a specific cpu mask as well as for the online cpu mask. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add FWFT extension calls. This will be ratified in SBI V3.0 hence, it is provided as a separate commit that can be left out if needed. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Now that the kernel can handle misaligned accesses in S-mode, request misaligned access exception delegation from SBI. This uses the FWFT SBI extension defined in SBI version 3.0. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
…bing schedule_on_each_cpu() was used without any good reason while documented as very slow. This call was in the boot path, so better use on_each_cpu() for scalar misaligned checking. Vector misaligned check still needs to use schedule_on_each_cpu() since it requires irqs to be enabled but that's less of a problem since this code is ran in a kthread. Add a comment to explicit that. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
misaligned_access_speed is defined under CONFIG_RISCV_SCALAR_MISALIGNED but was used under CONFIG_RISCV_PROBE_UNALIGNED_ACCESS. Fix that by using the correct config option. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Split the code that check for the uniformity of misaligned accesses performance on all cpus from check_unaligned_access_emulated_all_cpus() to its own function which will be used for delegation check. No functional changes intended. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Checking for the delegability of the misaligned access trap is needed for the KVM FWFT extension implementation. Add a function to get the delegability of the misaligned trap exception. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The FWFT SBI extension will need to dynamically allocate memory and do init time specific initialization. Add an init/deinit callbacks that allows to do so. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Currently, only the STA extension needed a reset function but that's going to be the case for FWFT as well. Add a reset callback that can be implemented by SBI extensions. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add basic infrastructure to support the FWFT extension in KVM. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
SBI_FWFT_MISALIGNED_DELEG needs hedeleg to be modified to delegate misaligned load/store exceptions. Save and restore it during CPU load/put. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Deepak Gupta <debug@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v6,01/14] riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions" |
|
Patch 1: "[v6,01/14] riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions" |
6c2725a to
c8da138
Compare
|
Patch 1: "[v6,01/14] riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions" |
|
Patch 1: "[v6,01/14] riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions" |
|
Patch 1: "[v6,01/14] riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions" |
|
Patch 1: "[v6,01/14] riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions" |
|
Patch 1: "[v6,01/14] riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions" |
|
Patch 1: "[v6,01/14] riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions" |
|
Patch 1: "[v6,01/14] riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions" |
|
Patch 1: "[v6,01/14] riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions" |
|
Patch 1: "[v6,01/14] riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions" |
|
Patch 1: "[v6,01/14] riscv: sbi: add Firmware Feature (FWFT) SBI extensions definitions" |
|
Patch 2: "[v6,02/14] riscv: sbi: remove useless parenthesis" |
|
Patch 2: "[v6,02/14] riscv: sbi: remove useless parenthesis" |
|
Patch 12: "[v6,12/14] RISC-V: KVM: add SBI extension reset callback" |
|
Patch 12: "[v6,12/14] RISC-V: KVM: add SBI extension reset callback" |
|
Patch 12: "[v6,12/14] RISC-V: KVM: add SBI extension reset callback" |
|
Patch 13: "[v6,13/14] RISC-V: KVM: add support for FWFT SBI extension" |
|
Patch 13: "[v6,13/14] RISC-V: KVM: add support for FWFT SBI extension" |
|
Patch 13: "[v6,13/14] RISC-V: KVM: add support for FWFT SBI extension" |
|
Patch 13: "[v6,13/14] RISC-V: KVM: add support for FWFT SBI extension" |
|
Patch 13: "[v6,13/14] RISC-V: KVM: add support for FWFT SBI extension" |
|
Patch 13: "[v6,13/14] RISC-V: KVM: add support for FWFT SBI extension" |
|
Patch 13: "[v6,13/14] RISC-V: KVM: add support for FWFT SBI extension" |
|
Patch 13: "[v6,13/14] RISC-V: KVM: add support for FWFT SBI extension" |
|
Patch 13: "[v6,13/14] RISC-V: KVM: add support for FWFT SBI extension" |
|
Patch 13: "[v6,13/14] RISC-V: KVM: add support for FWFT SBI extension" |
|
Patch 13: "[v6,13/14] RISC-V: KVM: add support for FWFT SBI extension" |
|
Patch 13: "[v6,13/14] RISC-V: KVM: add support for FWFT SBI extension" |
|
Patch 14: "[v6,14/14] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG" |
|
Patch 14: "[v6,14/14] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG" |
|
Patch 14: "[v6,14/14] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG" |
|
Patch 14: "[v6,14/14] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG" |
|
Patch 14: "[v6,14/14] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG" |
|
Patch 14: "[v6,14/14] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG" |
|
Patch 14: "[v6,14/14] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG" |
|
Patch 14: "[v6,14/14] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG" |
|
Patch 14: "[v6,14/14] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG" |
|
Patch 14: "[v6,14/14] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG" |
|
Patch 14: "[v6,14/14] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG" |
|
Patch 14: "[v6,14/14] RISC-V: KVM: add support for SBI_FWFT_MISALIGNED_DELEG" |
c8da138 to
4d9ad71
Compare
PR for series 956712 applied to workflow__riscv__fixes
Name: riscv: add SBI FWFT misaligned exception delegation support
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=956712
Version: 6