[PATCH v1 0/5] riscv: Introduce compat-mode helpers & improve arch_get_mmap_end()

Leonardo Bras leobras at redhat.com
Wed Jan 3 08:00:18 PST 2024


I just saw the opportunity of optimizing the helper is_compat_task() by
introducing a compile-time test, and it made possible to remove some
#ifdef's without any loss of performance.

I also saw the possibility of removing the direct check of task flags from
general code, and concentrated it in asm/compat.h by creating a few more
helpers, which in the end helped optimize code.

arch_get_mmap_end() just got a simple improvement and some extra docs.

Changes since RFC:
- Fused with other patchset:  Improve arch_get_mmap_end() macro
- Renamed from "Introduce & Optimize compat-mode helpers"

Leonardo Bras (5):
  riscv: Improve arch_get_mmap_end() macro
  riscv: Replace direct thread flag check with is_compat_task()
  riscv: add compile-time test into is_compat_task()
  riscv: Introduce is_compat_thread() into compat.h
  riscv: Introduce set_compat_task() in asm/compat.h

 arch/riscv/include/asm/compat.h    | 19 +++++++++++++++++++
 arch/riscv/include/asm/elf.h       | 11 ++---------
 arch/riscv/include/asm/pgtable.h   |  8 +-------
 arch/riscv/include/asm/processor.h | 16 +++++++++++-----
 arch/riscv/kernel/ptrace.c         |  6 +++---
 5 files changed, 36 insertions(+), 24 deletions(-)


base-commit: 610a9b8f49fbcf1100716370d3b5f6f884a2835a
-- 
2.43.0




More information about the linux-riscv mailing list