summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorAlexandre Ghiti <alexghiti@rivosinc.com>2024-03-22 12:26:29 +0100
committerPalmer Dabbelt <palmer@rivosinc.com>2024-07-10 13:30:56 -0700
commit16badacd8af48980c546839626d0329bab32b4c3 (patch)
treec659b510a766336e677f667b328f695b4b399ac4 /tools/perf/scripts/python
parent56c1c1a09ab93c7b7c957860f01f8600d6c03143 (diff)
downloadkernel-16badacd8af48980c546839626d0329bab32b4c3.tar.gz
riscv: Improve sbi_ecall() code generation by reordering arguments
The sbi_ecall() function arguments are not in the same order as the ecall arguments, so we end up re-ordering the registers before the ecall which is useless and costly. So simply reorder the arguments in the same way as expected by ecall. Instead of reordering directly the arguments of sbi_ecall(), use a proxy macro since the current ordering is more natural. Before: Dump of assembler code for function sbi_ecall: 0xffffffff800085e0 <+0>: add sp,sp,-32 0xffffffff800085e2 <+2>: sd s0,24(sp) 0xffffffff800085e4 <+4>: mv t1,a0 0xffffffff800085e6 <+6>: add s0,sp,32 0xffffffff800085e8 <+8>: mv t3,a1 0xffffffff800085ea <+10>: mv a0,a2 0xffffffff800085ec <+12>: mv a1,a3 0xffffffff800085ee <+14>: mv a2,a4 0xffffffff800085f0 <+16>: mv a3,a5 0xffffffff800085f2 <+18>: mv a4,a6 0xffffffff800085f4 <+20>: mv a5,a7 0xffffffff800085f6 <+22>: mv a6,t3 0xffffffff800085f8 <+24>: mv a7,t1 0xffffffff800085fa <+26>: ecall 0xffffffff800085fe <+30>: ld s0,24(sp) 0xffffffff80008600 <+32>: add sp,sp,32 0xffffffff80008602 <+34>: ret After: Dump of assembler code for function __sbi_ecall: 0xffffffff8000b6b2 <+0>: add sp,sp,-32 0xffffffff8000b6b4 <+2>: sd s0,24(sp) 0xffffffff8000b6b6 <+4>: add s0,sp,32 0xffffffff8000b6b8 <+6>: ecall 0xffffffff8000b6bc <+10>: ld s0,24(sp) 0xffffffff8000b6be <+12>: add sp,sp,32 0xffffffff8000b6c0 <+14>: ret Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Reviewed-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Yunhui Cui <cuiyunhui@bytedance.com> Link: https://lore.kernel.org/r/20240322112629.68170-1-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
6.y&id=91045f5e5238a6d2ad21d41d7e86e2fa65f90d76'>bpf: Add bpf_verify_program() to the library.David S. Miller 2017-04-01tools/lib/bpf: add support for BPF_PROG_TEST_RUN commandAlexei Starovoitov 2017-03-22bpf: Add tests for map-in-mapMartin KaFai Lau 2017-02-22Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-nextLinus Torvalds 2017-02-20Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kern...Linus Torvalds 2017-02-16Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller 2017-02-12bpf: introduce BPF_F_ALLOW_OVERRIDE flagAlexei Starovoitov 2017-02-10bpf: Use bpf_map_get_next_key() from the libraryMickaël Salaün 2017-02-10bpf: Use bpf_map_delete_elem() from the libraryMickaël Salaün 2017-02-10bpf: Use bpf_map_lookup_elem() from the libraryMickaël Salaün 2017-02-10bpf: Use bpf_map_update_elem() from the libraryMickaël Salaün 2017-02-10bpf: Use bpf_load_program() from the libraryMickaël Salaün 2017-02-08tools lib bpf: Add missing header to the libraryMickaël Salaün 2016-12-20tools lib bpf: Add bpf_prog_{attach,detach}Joe Stringer 2016-12-15tools lib bpf: Add flags to bpf_create_map()Joe Stringer 2016-12-15tools lib bpf: use __u32 from linux/types.hJoe Stringer 2016-11-29tools lib bpf: Add missing BPF functionsWang Nan