riscv: Introduce compat-mode helpers & improve arch_get_mmap_end()
From: | Leonardo Bras <leobras-AT-redhat.com> | |
To: | Paul Walmsley <paul.walmsley-AT-sifive.com>, Palmer Dabbelt <palmer-AT-dabbelt.com>, Albert Ou <aou-AT-eecs.berkeley.edu>, Eric Biederman <ebiederm-AT-xmission.com>, Kees Cook <keescook-AT-chromium.org>, Oleg Nesterov <oleg-AT-redhat.com>, Leonardo Bras <leobras-AT-redhat.com>, Guo Ren <guoren-AT-kernel.org>, Andy Chiu <andy.chiu-AT-sifive.com>, Conor Dooley <conor.dooley-AT-microchip.com>, Xiao Wang <xiao.w.wang-AT-intel.com>, Vincent Chen <vincent.chen-AT-sifive.com>, Charlie Jenkins <charlie-AT-rivosinc.com>, Greg Ungerer <gerg-AT-kernel.org>, Andrew Morton <akpm-AT-linux-foundation.org>, Kemeng Shi <shikemeng-AT-huaweicloud.com>, Alexandre Ghiti <alexghiti-AT-rivosinc.com>, David Hildenbrand <david-AT-redhat.com>, "Matthew Wilcox (Oracle)" <willy-AT-infradead.org>, Qinglin Pan <panqinglin2020-AT-iscas.ac.cn>, Greentime Hu <greentime.hu-AT-sifive.com>, Baoquan He <bhe-AT-redhat.com>, Clément Léger <cleger-AT-rivosinc.com> | |
Subject: | [PATCH v1 0/5] riscv: Introduce compat-mode helpers & improve arch_get_mmap_end() | |
Date: | Wed, 03 Jan 2024 13:00:18 -0300 | |
Message-ID: | <20240103160024.70305-2-leobras@redhat.com> | |
Cc: | linux-riscv-AT-lists.infradead.org, linux-kernel-AT-vger.kernel.org, linux-mm-AT-kvack.org | |
Archive-link: | Article |
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