diff mbox

[v6,10/19] arm64:ilp32 use the native LP64 'start_thread' for ILP32 threads

Message ID 1447795019-30176-11-git-send-email-ynorov@caviumnetworks.com
State New
Headers show

Commit Message

Yury Norov Nov. 17, 2015, 9:16 p.m. UTC
From: Andrew Pinski <apinski@cavium.com>


If we have both ILP32 and AARCH32 compiled in, we need use the non compat start
thread for ILP32.

Reviewed-by: David Daney <ddaney@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: Yury Norov <ynorov@caviumnetworks.com>

Signed-off-by: Andrew Pinski <Andrew.Pinski@caviumnetworks.com>

---
 arch/arm64/include/asm/processor.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Comments

Catalin Marinas Dec. 3, 2015, 12:20 p.m. UTC | #1
On Wed, Nov 18, 2015 at 12:16:50AM +0300, Yury Norov wrote:
> --- a/arch/arm64/include/asm/processor.h

> +++ b/arch/arm64/include/asm/processor.h

> @@ -28,6 +28,7 @@

>  #ifdef __KERNEL__

>  

>  #include <linux/string.h>

> +#include <linux/thread_info.h>

>  

>  #include <asm/fpsimd.h>

>  #include <asm/hw_breakpoint.h>

> @@ -123,6 +124,15 @@ static inline void start_thread(struct pt_regs *regs, unsigned long pc,

>  static inline void compat_start_thread(struct pt_regs *regs, unsigned long pc,

>  				       unsigned long sp)

>  {

> +#ifdef CONFIG_ARM64_ILP32

> +	/* ILP32 thread are started the same way as LP64 threads.

> +	   Note we cannot use is_ilp32_compat_task here as that

> +	   would introduce a header depency issue.  */

> +	if (test_thread_flag(TIF_32BIT_AARCH64)) {

> +		start_thread(regs, pc, sp);

> +		return;

> +	}


Nitpicks: use IS_ENABLED(CONFIG_ARM64_ILP32) instead of #ifdef. Also
follow the coding style for multi-line comments:

	/*
	 * .....
	 * .....
	 */

-- 
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
diff mbox

Patch

diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index a415dd0..e244cb4 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -28,6 +28,7 @@ 
 #ifdef __KERNEL__
 
 #include <linux/string.h>
+#include <linux/thread_info.h>
 
 #include <asm/fpsimd.h>
 #include <asm/hw_breakpoint.h>
@@ -123,6 +124,15 @@  static inline void start_thread(struct pt_regs *regs, unsigned long pc,
 static inline void compat_start_thread(struct pt_regs *regs, unsigned long pc,
 				       unsigned long sp)
 {
+#ifdef CONFIG_ARM64_ILP32
+	/* ILP32 thread are started the same way as LP64 threads.
+	   Note we cannot use is_ilp32_compat_task here as that
+	   would introduce a header depency issue.  */
+	if (test_thread_flag(TIF_32BIT_AARCH64)) {
+		start_thread(regs, pc, sp);
+		return;
+	}
+#endif
 	start_thread_common(regs, pc);
 	regs->pstate = COMPAT_PSR_MODE_USR;
 	if (pc & 1)