This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 13/23] arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)
- From: "Zhangjian (Bamvor)" <bamvor dot zhangjian at huawei dot com>
- To: Yury Norov <ynorov at caviumnetworks dot com>, <arnd at arndb dot de>, <catalin dot marinas at arm dot com>, <linux-arm-kernel at lists dot infradead dot org>, <linux-kernel at vger dot kernel dot org>, <linux-doc at vger dot kernel dot org>, <linux-arch at vger dot kernel dot org>, <linux-s390 at vger dot kernel dot org>, <libc-alpha at sourceware dot org>
- Cc: <schwidefsky at de dot ibm dot com>, <heiko dot carstens at de dot ibm dot com>, <pinskia at gmail dot com>, <broonie at kernel dot org>, <joseph at codesourcery dot com>, <christoph dot muellner at theobroma-systems dot com>, <szabolcs dot nagy at arm dot com>, <klimov dot linux at gmail dot com>, <Nathan_Lynch at mentor dot com>, <agraf at suse dot de>, <Prasun dot Kapoor at caviumnetworks dot com>, <kilobyte at angband dot pl>, <geert at linux-m68k dot org>, <philipp dot tomsich at theobroma-systems dot com>, "Andrew Pinski" <Andrew dot Pinski at caviumnetworks dot com>, Hanjun Guo <guohanjun at huawei dot com>, "Zhangjian (Bamvor)" <bamvor dot zhangjian at huawei dot com>
- Date: Sun, 12 Jun 2016 20:21:04 +0800
- Subject: Re: [PATCH 13/23] arm64: introduce is_a32_task and is_a32_thread (for AArch32 compat)
- Authentication-results: sourceware.org; auth=none
- References: <1464048292-30136-1-git-send-email-ynorov at caviumnetworks dot com> <1464048292-30136-14-git-send-email-ynorov at caviumnetworks dot com>
Hi, Yury
On 2016/5/24 8:04, Yury Norov wrote:
Based on patch of Andrew Pinski.
This patch introduces is_a32_compat_task and is_a32_thread so it is
easier to say this is a a32 specific thread or a generic compat thread/task.
Corresponding functions are located in <asm/is_compat.h> to avoid mess in
headers.
Some files include both <linux/compat.h> and <asm/compat.h>,
and this is wrong because <linux/compat.h> has <asm/compat.h> already
included. It was fixed too.
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Andrew Pinski <Andrew.Pinski@caviumnetworks.com>
Reviewed-by: David Daney <ddaney@caviumnetworks.com>
---
arch/arm64/include/asm/compat.h | 19 ++----------
arch/arm64/include/asm/elf.h | 10 +++----
arch/arm64/include/asm/ftrace.h | 2 +-
arch/arm64/include/asm/is_compat.h | 58 ++++++++++++++++++++++++++++++++++++
arch/arm64/include/asm/memory.h | 3 +-
arch/arm64/include/asm/processor.h | 5 ++--
arch/arm64/include/asm/syscall.h | 2 +-
arch/arm64/include/asm/thread_info.h | 2 +-
arch/arm64/kernel/hw_breakpoint.c | 10 +++----
arch/arm64/kernel/perf_regs.c | 2 +-
arch/arm64/kernel/process.c | 7 ++---
arch/arm64/kernel/ptrace.c | 11 ++++---
arch/arm64/kernel/signal.c | 4 +--
arch/arm64/kernel/traps.c | 3 +-
14 files changed, 91 insertions(+), 47 deletions(-)
create mode 100644 arch/arm64/include/asm/is_compat.h
[...]
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
index 12f8a00..a66a0f7 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -26,6 +26,7 @@
#include <linux/types.h>
#include <asm/bug.h>
#include <asm/sizes.h>
+#include <asm/is_compat.h>
/*
* Allow for constants defined here to be used from assembly code
@@ -61,7 +62,7 @@
#ifdef CONFIG_COMPAT
#define TASK_SIZE_32 UL(0x100000000)
-#define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \
+#define TASK_SIZE (is_compat_task() ? \
TASK_SIZE_32 : TASK_SIZE_64)
#define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT) ? \
TASK_SIZE_32 : TASK_SIZE_64)
Should we update or delete this macro?
#define TASK_SIZE_OF(tsk) (is_compat_task() ? \
TASK_SIZE_32 : TASK_SIZE_64)
x86, sparc, mips, ppc, parisc, s390 define its own version. But
"include/linux/sched.h" will define it if
TASK_SIZE_OF does not exist:
#ifndef TASK_SIZE_OF
#define TASK_SIZE_OF(tsk) TASK_SIZE
#endif
Regards
Bamvor