linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: restore current_thread_info()
@ 2019-05-07 22:51 Yury Norov
  2019-05-07 22:58 ` Al Viro
  0 siblings, 1 reply; 4+ messages in thread
From: Yury Norov @ 2019-05-07 22:51 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy, Breno Leitao, linuxppc-dev,
	linux-kernel
  Cc: Yury Norov, Yury Norov

Commit ed1cd6deb013 ("powerpc: Activate CONFIG_THREAD_INFO_IN_TASK")
removes the function current_thread_info(). It's wrong because the
function is used in non-arch code and is part of API.

For my series of arm64/ilp32, after applying the patch
https://github.com/norov/linux/commit/b269e51eee66ffec3008a3effb12363b91754e49
it causes build break.

This patch restores current_thread_info().

Signed-off-by: Yury Norov <ynorov@marvell.com>
---
 arch/powerpc/include/asm/thread_info.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 8e1d0195ac36..f700bc80a607 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -19,6 +19,7 @@
 
 #ifndef __ASSEMBLY__
 #include <linux/cache.h>
+#include <asm/current.h>
 #include <asm/processor.h>
 #include <asm/page.h>
 #include <asm/accounting.h>
@@ -57,6 +58,11 @@ struct thread_info {
 #define THREAD_SIZE_ORDER	(THREAD_SHIFT - PAGE_SHIFT)
 
 /* how to get the thread information struct from C */
+static inline struct thread_info *current_thread_info(void)
+{
+	return (struct thread_info *)current;
+}
+
 extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
 
 #ifdef CONFIG_PPC_BOOK3S_64
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: restore current_thread_info()
  2019-05-07 22:51 [PATCH] powerpc: restore current_thread_info() Yury Norov
@ 2019-05-07 22:58 ` Al Viro
  2019-05-07 23:07   ` Yury Norov
  0 siblings, 1 reply; 4+ messages in thread
From: Al Viro @ 2019-05-07 22:58 UTC (permalink / raw)
  To: Yury Norov
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy, Breno Leitao, linuxppc-dev,
	linux-kernel, Yury Norov

On Tue, May 07, 2019 at 03:51:21PM -0700, Yury Norov wrote:
> Commit ed1cd6deb013 ("powerpc: Activate CONFIG_THREAD_INFO_IN_TASK")
> removes the function current_thread_info(). It's wrong because the
> function is used in non-arch code and is part of API.

In include/linux/thread_info.h:

#ifdef CONFIG_THREAD_INFO_IN_TASK
/*
 * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
 * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
 * including <asm/current.h> can cause a circular dependency on some platforms.
 */
#include <asm/current.h>
#define current_thread_info() ((struct thread_info *)current)
#endif


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: restore current_thread_info()
  2019-05-07 22:58 ` Al Viro
@ 2019-05-07 23:07   ` Yury Norov
  2019-05-08  0:42     ` Michael Ellerman
  0 siblings, 1 reply; 4+ messages in thread
From: Yury Norov @ 2019-05-07 23:07 UTC (permalink / raw)
  To: Al Viro
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy, Breno Leitao, linuxppc-dev,
	linux-kernel, Yury Norov

On Tue, May 07, 2019 at 11:58:56PM +0100, Al Viro wrote:
> On Tue, May 07, 2019 at 03:51:21PM -0700, Yury Norov wrote:
> > Commit ed1cd6deb013 ("powerpc: Activate CONFIG_THREAD_INFO_IN_TASK")
> > removes the function current_thread_info(). It's wrong because the
> > function is used in non-arch code and is part of API.
> 
> In include/linux/thread_info.h:
> 
> #ifdef CONFIG_THREAD_INFO_IN_TASK
> /*
>  * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
>  * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
>  * including <asm/current.h> can cause a circular dependency on some platforms.
>  */
> #include <asm/current.h>
> #define current_thread_info() ((struct thread_info *)current)
> #endif

Ah, sorry. Then it might be my rebase issue. I was confused because Christophe
didn't remove the comment to current_thread_info(), so I decided he
removed it erroneously.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: restore current_thread_info()
  2019-05-07 23:07   ` Yury Norov
@ 2019-05-08  0:42     ` Michael Ellerman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2019-05-08  0:42 UTC (permalink / raw)
  To: Yury Norov, Al Viro
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Nicholas Piggin,
	Christophe Leroy, Breno Leitao, linuxppc-dev, linux-kernel,
	Yury Norov

Yury Norov <yury.norov@gmail.com> writes:
> On Tue, May 07, 2019 at 11:58:56PM +0100, Al Viro wrote:
>> On Tue, May 07, 2019 at 03:51:21PM -0700, Yury Norov wrote:
>> > Commit ed1cd6deb013 ("powerpc: Activate CONFIG_THREAD_INFO_IN_TASK")
>> > removes the function current_thread_info(). It's wrong because the
>> > function is used in non-arch code and is part of API.
>> 
>> In include/linux/thread_info.h:
>> 
>> #ifdef CONFIG_THREAD_INFO_IN_TASK
>> /*
>>  * For CONFIG_THREAD_INFO_IN_TASK kernels we need <asm/current.h> for the
>>  * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels,
>>  * including <asm/current.h> can cause a circular dependency on some platforms.
>>  */
>> #include <asm/current.h>
>> #define current_thread_info() ((struct thread_info *)current)
>> #endif
>
> Ah, sorry. Then it might be my rebase issue. I was confused because Christophe
> didn't remove the comment to current_thread_info(), so I decided he
> removed it erroneously.

Yeah you're right, that comment should have been removed too.

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-08  0:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-07 22:51 [PATCH] powerpc: restore current_thread_info() Yury Norov
2019-05-07 22:58 ` Al Viro
2019-05-07 23:07   ` Yury Norov
2019-05-08  0:42     ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).