diff mbox

[v6,08/20] arm64: ilp32: add is_ilp32_compat_{task, thread} and TIF_32BIT_AARCH64

Message ID 1450215766-14765-9-git-send-email-ynorov@caviumnetworks.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yury Norov Dec. 15, 2015, 9:42 p.m. UTC
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/is_compat.h   | 30 +++++++++++++++++++++++++++---
 arch/arm64/include/asm/thread_info.h |  1 +
 2 files changed, 28 insertions(+), 3 deletions(-)

Comments

Catalin Marinas Dec. 17, 2015, 11:41 a.m. UTC | #1
On Wed, Dec 16, 2015 at 12:42:34AM +0300, Yury Norov wrote:
> 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>

Long description missing.

> diff --git a/arch/arm64/include/asm/is_compat.h b/arch/arm64/include/asm/is_compat.h
> index 476db90..89b1f65 100644
> --- a/arch/arm64/include/asm/is_compat.h
> +++ b/arch/arm64/include/asm/is_compat.h
> @@ -36,7 +36,6 @@ static inline int is_a32_compat_thread(struct thread_info *thread)
>  #else
>  
>  static inline int is_a32_compat_task(void)
> -
>  {
>  	return 0;
>  }

You should move this to the previous patch.

> @@ -45,14 +44,39 @@ static inline int is_a32_compat_thread(struct thread_info *thread)
>  {
>  	return 0;
>  }
> -
>  #endif /* CONFIG_AARCH32_EL0 */

Maybe this one as well, though I like an empty line before the last
#endif (i.e. drop this hunk).
Yury Norov Dec. 18, 2015, 2:11 p.m. UTC | #2
On Thu, Dec 17, 2015 at 11:41:53AM +0000, Catalin Marinas wrote:
> On Wed, Dec 16, 2015 at 12:42:34AM +0300, Yury Norov wrote:
> > 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>
> 
> Long description missing.

Hi, Catalin,

I think this patch (and patch #3 too) is trivial, and
explanation in patch name is clear enougth. So, I just do not
understand what else to explain here. Could you point me, and then I
will do it.

> 
> > diff --git a/arch/arm64/include/asm/is_compat.h b/arch/arm64/include/asm/is_compat.h
> > index 476db90..89b1f65 100644
> > --- a/arch/arm64/include/asm/is_compat.h
> > +++ b/arch/arm64/include/asm/is_compat.h
> > @@ -36,7 +36,6 @@ static inline int is_a32_compat_thread(struct thread_info *thread)
> >  #else
> >  
> >  static inline int is_a32_compat_task(void)
> > -
> >  {
> >  	return 0;
> >  }
> 
> You should move this to the previous patch.
> 
> > @@ -45,14 +44,39 @@ static inline int is_a32_compat_thread(struct thread_info *thread)
> >  {
> >  	return 0;
> >  }
> > -
> >  #endif /* CONFIG_AARCH32_EL0 */
> 
> Maybe this one as well, though I like an empty line before the last
> #endif (i.e. drop this hunk).

It's just dirt, I'll clean it. Thank you.

Yury.
Yury Norov Dec. 18, 2015, 2:44 p.m. UTC | #3
On Fri, Dec 18, 2015 at 05:11:12PM +0300, Yury Norov wrote:
> On Thu, Dec 17, 2015 at 11:41:53AM +0000, Catalin Marinas wrote:
> > On Wed, Dec 16, 2015 at 12:42:34AM +0300, Yury Norov wrote:
> > > 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>
> > 
> > Long description missing.
> 
> Hi, Catalin,
> 
> I think this patch (and patch #3 too) is trivial, and
> explanation in patch name is clear enougth. So, I just do not
> understand what else to explain here. Could you point me, and then I
> will do it.
> 

Is it OK?

arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64

ILP32 tasks are needed to be distinguished from lp64 and aarch32.
This patch adds helper functions is_ilp32_compat_{task,thread} and
thread flag TIF_32BIT_AARCH64 to address this. This patch is
preparation for following patches in ilp32 patchset.
Catalin Marinas Dec. 21, 2015, 5:42 p.m. UTC | #4
On Fri, Dec 18, 2015 at 05:44:37PM +0300, Yury Norov wrote:
> On Fri, Dec 18, 2015 at 05:11:12PM +0300, Yury Norov wrote:
> > On Thu, Dec 17, 2015 at 11:41:53AM +0000, Catalin Marinas wrote:
> > > On Wed, Dec 16, 2015 at 12:42:34AM +0300, Yury Norov wrote:
> > > > 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>
> > > 
> > > Long description missing.
> > 
> > Hi, Catalin,
> > 
> > I think this patch (and patch #3 too) is trivial, and
> > explanation in patch name is clear enougth. So, I just do not
> > understand what else to explain here. Could you point me, and then I
> > will do it.
> > 
> 
> Is it OK?
> 
> arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64
> 
> ILP32 tasks are needed to be distinguished from lp64 and aarch32.
> This patch adds helper functions is_ilp32_compat_{task,thread} and
> thread flag TIF_32BIT_AARCH64 to address this. This patch is
> preparation for following patches in ilp32 patchset.

It looks fine to me.
diff mbox

Patch

diff --git a/arch/arm64/include/asm/is_compat.h b/arch/arm64/include/asm/is_compat.h
index 476db90..89b1f65 100644
--- a/arch/arm64/include/asm/is_compat.h
+++ b/arch/arm64/include/asm/is_compat.h
@@ -36,7 +36,6 @@  static inline int is_a32_compat_thread(struct thread_info *thread)
 #else
 
 static inline int is_a32_compat_task(void)
-
 {
 	return 0;
 }
@@ -45,14 +44,39 @@  static inline int is_a32_compat_thread(struct thread_info *thread)
 {
 	return 0;
 }
-
 #endif /* CONFIG_AARCH32_EL0 */
 
+#ifdef CONFIG_ARM64_ILP32
+
+static inline int is_ilp32_compat_task(void)
+{
+	return test_thread_flag(TIF_32BIT_AARCH64);
+}
+
+static inline int is_ilp32_compat_thread(struct thread_info *thread)
+{
+	return test_ti_thread_flag(thread, TIF_32BIT_AARCH64);
+}
+
+#else
+
+static inline int is_ilp32_compat_task(void)
+{
+	return 0;
+}
+
+static inline int is_ilp32_compat_thread(struct thread_info *thread)
+{
+	return 0;
+}
+
+#endif /* CONFIG_ARM64_ILP32 */
+
 #ifdef CONFIG_COMPAT
 
 static inline int is_compat_task(void)
 {
-	return is_a32_compat_task();
+	return is_a32_compat_task() || is_ilp32_compat_task();
 }
 
 #endif /* CONFIG_COMPAT */
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h
index 7d03565..e72de74 100644
--- a/arch/arm64/include/asm/thread_info.h
+++ b/arch/arm64/include/asm/thread_info.h
@@ -112,6 +112,7 @@  static inline struct thread_info *current_thread_info(void)
 #define TIF_SINGLESTEP		21
 #define TIF_32BIT		22	/* AARCH32 process */
 #define TIF_SWITCH_MM		23	/* deferred switch_mm */
+#define TIF_32BIT_AARCH64	24	/* 32 bit process on AArch64(ILP32) */
 
 #define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
 #define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)