Message ID | 20230605110724.21391-1-andy.chiu@sifive.com (mailing list archive) |
---|---|
Headers | show |
Series | riscv: Add vector ISA support | expand |
Hi Andy, On Mon, Jun 05, 2023 at 11:07:20AM +0000, Andy Chiu wrote: > Some extensions use .option arch directive to selectively enable certain > extensions in parts of its assembly code. For example, Zbb uses it to > inform assmebler to emit bit manipulation instructions. However, > supporting of this directive only exist on GNU assembler and has not > landed on clang at the moment, making TOOLCHAIN_HAS_ZBB depend on > AS_IS_GNU. > > While it is still under review at https://reviews.llvm.org/D123515, the > upcoming Vector patch also requires this feature in assembler. Thus, > provide Kconfig AS_HAS_OPTION_ARCH to detect such feature. Then > TOOLCHAIN_HAS_XXX will be turned on automatically when the feature land. Just an FYI, this change has landed in LLVM main, so it should be in LLVM 17 in a few months: https://github.com/llvm/llvm-project/commit/9e8ed3403c191ab9c4903e8eeb8f732ff8a43cb4 If you have to spin another revision for some reason, consider updating the Phabricator link to that one, as I expect that link to remain more stable in the long run over the Phabricator one, as LLVM is planning to eventually move away from Phabricator to GitHub pull requests. I don't think this is worth respinning on its own (obviously, heh). The rest of the change still looks good to me, thanks again for taking this up. > Suggested-by: Nathan Chancellor <nathan@kernel.org> > Signed-off-by: Andy Chiu <andy.chiu@sifive.com> > Reviewed-by: Conor Dooley <conor.dooley@microchip.com> > Reviewed-by: Nathan Chancellor <nathan@kernel.org> > Reviewed-by: Heiko Stuebner <heiko.stuebner@vrull.eu> > Tested-by: Heiko Stuebner <heiko.stuebner@vrull.eu> > --- > arch/riscv/Kconfig | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index 348c0fa1fc8c..1019b519d590 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -262,6 +262,12 @@ config RISCV_DMA_NONCOHERENT > config AS_HAS_INSN > def_bool $(as-instr,.insn r 51$(comma) 0$(comma) 0$(comma) t0$(comma) t0$(comma) zero) > > +config AS_HAS_OPTION_ARCH > + # https://reviews.llvm.org/D123515 > + def_bool y > + depends on $(as-instr, .option arch$(comma) +m) > + depends on !$(as-instr, .option arch$(comma) -i) > + > source "arch/riscv/Kconfig.socs" > source "arch/riscv/Kconfig.errata" > > @@ -466,7 +472,7 @@ config TOOLCHAIN_HAS_ZBB > depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbb) > depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbb) > depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900 > - depends on AS_IS_GNU > + depends on AS_HAS_OPTION_ARCH > > config RISCV_ISA_ZBB > bool "Zbb extension support for bit manipulation instructions" > -- > 2.17.1 >
On Mon, Jun 05, 2023 at 08:48:32AM -0700, Nathan Chancellor wrote: > Just an FYI, this change has landed in LLVM main, so it should be in > LLVM 17 in a few months: Great! :)
On Mon, 05 Jun 2023 11:06:57 +0000, Andy Chiu wrote: > This is the v21 patch series for adding Vector extension support in > Linux. Please refer to [1] for the introduction of the patchset. The > v21 patch series was aimed to solve build issues from v19, provide usage > guideline for the prctl interface, and address review comments on v20. > > Thank every one who has been reviewing, suggesting on the topic. Hope > this get a step closer to the final merge. > > [...] Applied, thanks! [01/27] riscv: Rename __switch_to_aux() -> fpu https://git.kernel.org/palmer/c/419d5d38ac5d [02/27] riscv: Extending cpufeature.c to detect V-extension https://git.kernel.org/palmer/c/dc6667a4e7e3 [03/27] riscv: hwprobe: Add support for probing V in RISCV_HWPROBE_KEY_IMA_EXT_0 https://git.kernel.org/palmer/c/162e4df137c1 [04/27] riscv: Add new csr defines related to vector extension https://git.kernel.org/palmer/c/b5665d2a9432 [05/27] riscv: Clear vector regfile on bootup https://git.kernel.org/palmer/c/6b533828726a [06/27] riscv: Disable Vector Instructions for kernel itself https://git.kernel.org/palmer/c/74abe5a39d3a [07/27] riscv: Introduce Vector enable/disable helpers https://git.kernel.org/palmer/c/0a3381a01dcc [08/27] riscv: Introduce riscv_v_vsize to record size of Vector context https://git.kernel.org/palmer/c/7017858eb2d7 [09/27] riscv: Introduce struct/helpers to save/restore per-task Vector state https://git.kernel.org/palmer/c/03c3fcd9941a [10/27] riscv: Add task switch support for vector https://git.kernel.org/palmer/c/3a2df6323def [11/27] riscv: Allocate user's vector context in the first-use trap https://git.kernel.org/palmer/c/cd054837243b [12/27] riscv: Add ptrace vector support https://git.kernel.org/palmer/c/0c59922c769a [13/27] riscv: signal: check fp-reserved words unconditionally https://git.kernel.org/palmer/c/a45cedaa1ac0 [14/27] riscv: signal: Add sigcontext save/restore for vector https://git.kernel.org/palmer/c/8ee0b41898fa [15/27] riscv: signal: Report signal frame size to userspace via auxv https://git.kernel.org/palmer/c/e92f469b0771 [16/27] riscv: signal: validate altstack to reflect Vector https://git.kernel.org/palmer/c/76e22fdc2c26 [17/27] riscv: prevent stack corruption by reserving task_pt_regs(p) early https://git.kernel.org/palmer/c/c7cdd96eca28 [18/27] riscv: kvm: Add V extension to KVM ISA https://git.kernel.org/palmer/c/bf78f1ea6e51 [19/27] riscv: KVM: Add vector lazy save/restore support https://git.kernel.org/palmer/c/0f4b82579716 [20/27] riscv: hwcap: change ELF_HWCAP to a function https://git.kernel.org/palmer/c/50724efcb370 [21/27] riscv: Add prctl controls for userspace vector management https://git.kernel.org/palmer/c/1fd96a3e9d5d [22/27] riscv: Add sysctl to set the default vector rule for new processes https://git.kernel.org/palmer/c/7ca7a7b9b635 [23/27] riscv: detect assembler support for .option arch https://git.kernel.org/palmer/c/e4bb020f3dbb [24/27] riscv: Enable Vector code to be built https://git.kernel.org/palmer/c/fa8e7cce55da [25/27] riscv: Add documentation for Vector https://git.kernel.org/palmer/c/04a4722eeede [26/27] selftests: Test RISC-V Vector prctl interface https://git.kernel.org/palmer/c/7cf6198ce22d [27/27] selftests: add .gitignore file for RISC-V hwprobe https://git.kernel.org/palmer/c/1e72695137ef Best regards,
Hello: This series was applied to riscv/linux.git (for-next) by Palmer Dabbelt <palmer@rivosinc.com>: On Mon, 5 Jun 2023 11:06:57 +0000 you wrote: > This is the v21 patch series for adding Vector extension support in > Linux. Please refer to [1] for the introduction of the patchset. The > v21 patch series was aimed to solve build issues from v19, provide usage > guideline for the prctl interface, and address review comments on v20. > > Thank every one who has been reviewing, suggesting on the topic. Hope > this get a step closer to the final merge. > > [...] Here is the summary with links: - [-next,v21,01/27] riscv: Rename __switch_to_aux() -> fpu https://git.kernel.org/riscv/c/419d5d38ac5d - [-next,v21,02/27] riscv: Extending cpufeature.c to detect V-extension https://git.kernel.org/riscv/c/dc6667a4e7e3 - [-next,v21,03/27] riscv: hwprobe: Add support for probing V in RISCV_HWPROBE_KEY_IMA_EXT_0 https://git.kernel.org/riscv/c/162e4df137c1 - [-next,v21,04/27] riscv: Add new csr defines related to vector extension https://git.kernel.org/riscv/c/b5665d2a9432 - [-next,v21,05/27] riscv: Clear vector regfile on bootup https://git.kernel.org/riscv/c/6b533828726a - [-next,v21,06/27] riscv: Disable Vector Instructions for kernel itself https://git.kernel.org/riscv/c/74abe5a39d3a - [-next,v21,07/27] riscv: Introduce Vector enable/disable helpers https://git.kernel.org/riscv/c/0a3381a01dcc - [-next,v21,08/27] riscv: Introduce riscv_v_vsize to record size of Vector context https://git.kernel.org/riscv/c/7017858eb2d7 - [-next,v21,09/27] riscv: Introduce struct/helpers to save/restore per-task Vector state https://git.kernel.org/riscv/c/03c3fcd9941a - [-next,v21,10/27] riscv: Add task switch support for vector https://git.kernel.org/riscv/c/3a2df6323def - [-next,v21,11/27] riscv: Allocate user's vector context in the first-use trap https://git.kernel.org/riscv/c/cd054837243b - [-next,v21,12/27] riscv: Add ptrace vector support https://git.kernel.org/riscv/c/0c59922c769a - [-next,v21,13/27] riscv: signal: check fp-reserved words unconditionally https://git.kernel.org/riscv/c/a45cedaa1ac0 - [-next,v21,14/27] riscv: signal: Add sigcontext save/restore for vector https://git.kernel.org/riscv/c/8ee0b41898fa - [-next,v21,15/27] riscv: signal: Report signal frame size to userspace via auxv https://git.kernel.org/riscv/c/e92f469b0771 - [-next,v21,16/27] riscv: signal: validate altstack to reflect Vector https://git.kernel.org/riscv/c/76e22fdc2c26 - [-next,v21,17/27] riscv: prevent stack corruption by reserving task_pt_regs(p) early https://git.kernel.org/riscv/c/c7cdd96eca28 - [-next,v21,18/27] riscv: kvm: Add V extension to KVM ISA https://git.kernel.org/riscv/c/bf78f1ea6e51 - [-next,v21,19/27] riscv: KVM: Add vector lazy save/restore support https://git.kernel.org/riscv/c/0f4b82579716 - [-next,v21,20/27] riscv: hwcap: change ELF_HWCAP to a function https://git.kernel.org/riscv/c/50724efcb370 - [-next,v21,21/27] riscv: Add prctl controls for userspace vector management https://git.kernel.org/riscv/c/1fd96a3e9d5d - [-next,v21,22/27] riscv: Add sysctl to set the default vector rule for new processes https://git.kernel.org/riscv/c/7ca7a7b9b635 - [-next,v21,23/27] riscv: detect assembler support for .option arch https://git.kernel.org/riscv/c/e4bb020f3dbb - [-next,v21,24/27] riscv: Enable Vector code to be built https://git.kernel.org/riscv/c/fa8e7cce55da - [-next,v21,25/27] riscv: Add documentation for Vector https://git.kernel.org/riscv/c/04a4722eeede - [-next,v21,26/27] selftests: Test RISC-V Vector prctl interface https://git.kernel.org/riscv/c/7cf6198ce22d - [-next,v21,27/27] selftests: add .gitignore file for RISC-V hwprobe https://git.kernel.org/riscv/c/1e72695137ef You are awesome, thank you!