linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc: export thread-tidr interfaces
@ 2018-01-17  1:50 Sukadev Bhattiprolu
  2018-01-17  1:50 ` [PATCH 2/2] powerpc: export set_thread_uses_vas() Sukadev Bhattiprolu
  2018-01-17  6:45 ` [PATCH 1/2] powerpc: export thread-tidr interfaces Frederic Barrat
  0 siblings, 2 replies; 4+ messages in thread
From: Sukadev Bhattiprolu @ 2018-01-17  1:50 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, mikey, hbabu, linuxppc-dev, linux-kernel

Export set_thread_tidr() and clear_thread_tidr() interfaces so they
can be used by external modules.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/process.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 2010e4c..f20c1ad 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1560,6 +1560,7 @@ void clear_thread_tidr(struct task_struct *t)
 	free_thread_tidr(t->thread.tidr);
 	t->thread.tidr = 0;
 }
+EXPORT_SYMBOL_GPL(clear_thread_tidr);
 
 void arch_release_task_struct(struct task_struct *t)
 {
@@ -1592,6 +1593,7 @@ int set_thread_tidr(struct task_struct *t)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(set_thread_tidr);
 
 #endif /* CONFIG_PPC64 */
 
-- 
2.7.4

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

* [PATCH 2/2] powerpc: export set_thread_uses_vas()
  2018-01-17  1:50 [PATCH 1/2] powerpc: export thread-tidr interfaces Sukadev Bhattiprolu
@ 2018-01-17  1:50 ` Sukadev Bhattiprolu
  2018-01-17  6:45 ` [PATCH 1/2] powerpc: export thread-tidr interfaces Frederic Barrat
  1 sibling, 0 replies; 4+ messages in thread
From: Sukadev Bhattiprolu @ 2018-01-17  1:50 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, mikey, hbabu, linuxppc-dev, linux-kernel

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/process.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index f20c1ad..d22055b 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1475,6 +1475,7 @@ int set_thread_uses_vas(void)
 #endif /* CONFIG_PPC_BOOK3S_64 */
 	return 0;
 }
+EXPORT_SYMBOL_GPL(set_thread_uses_vas);
 
 #ifdef CONFIG_PPC64
 static DEFINE_SPINLOCK(vas_thread_id_lock);
-- 
2.7.4

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

* Re: [PATCH 1/2] powerpc: export thread-tidr interfaces
  2018-01-17  1:50 [PATCH 1/2] powerpc: export thread-tidr interfaces Sukadev Bhattiprolu
  2018-01-17  1:50 ` [PATCH 2/2] powerpc: export set_thread_uses_vas() Sukadev Bhattiprolu
@ 2018-01-17  6:45 ` Frederic Barrat
  2018-01-17 17:07   ` Sukadev Bhattiprolu
  1 sibling, 1 reply; 4+ messages in thread
From: Frederic Barrat @ 2018-01-17  6:45 UTC (permalink / raw)
  To: Sukadev Bhattiprolu, Michael Ellerman
  Cc: linuxppc-dev, Christophe Lombard, linux-kernel,
	Philippe Bergheaud

Hi,


> diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
> index 2010e4c..f20c1ad 100644
> --- a/arch/powerpc/kernel/process.c
> +++ b/arch/powerpc/kernel/process.c
> @@ -1560,6 +1560,7 @@ void clear_thread_tidr(struct task_struct *t)
>   	free_thread_tidr(t->thread.tidr);
>   	t->thread.tidr = 0;
>   }
> +EXPORT_SYMBOL_GPL(clear_thread_tidr);

Isn't it dangerous to export clear_thread_tidr()? Other modules may also 
have assigned the TIDR by calling set_thread_tidr(), so clearing it 
could potentially break those other modules. My understanding is that 
once the TIDR is assigned, there's no safe way to reclaim it other than 
the thread exiting. Or we would need some kind of reference counter.


>   void arch_release_task_struct(struct task_struct *t)
>   {
> @@ -1592,6 +1593,7 @@ int set_thread_tidr(struct task_struct *t)
> 
>   	return 0;
>   }
> +EXPORT_SYMBOL_GPL(set_thread_tidr);


FYI, there's a capi patch we hope to merge soon which is also doing this:
http://patchwork.ozlabs.org/patch/858935/

   Fred

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

* Re: [PATCH 1/2] powerpc: export thread-tidr interfaces
  2018-01-17  6:45 ` [PATCH 1/2] powerpc: export thread-tidr interfaces Frederic Barrat
@ 2018-01-17 17:07   ` Sukadev Bhattiprolu
  0 siblings, 0 replies; 4+ messages in thread
From: Sukadev Bhattiprolu @ 2018-01-17 17:07 UTC (permalink / raw)
  To: Frederic Barrat
  Cc: Michael Ellerman, linuxppc-dev, Christophe Lombard, linux-kernel,
	Philippe Bergheaud

Frederic Barrat [fbarrat@linux.vnet.ibm.com] wrote:
> Hi,
> 
> 
> > diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
> > index 2010e4c..f20c1ad 100644
> > --- a/arch/powerpc/kernel/process.c
> > +++ b/arch/powerpc/kernel/process.c
> > @@ -1560,6 +1560,7 @@ void clear_thread_tidr(struct task_struct *t)
> >   	free_thread_tidr(t->thread.tidr);
> >   	t->thread.tidr = 0;
> >   }
> > +EXPORT_SYMBOL_GPL(clear_thread_tidr);
> 
> Isn't it dangerous to export clear_thread_tidr()? Other modules may also
> have assigned the TIDR by calling set_thread_tidr(), so clearing it could
> potentially break those other modules. My understanding is that once the
> TIDR is assigned, there's no safe way to reclaim it other than the thread
> exiting. Or we would need some kind of reference counter.

Yes the FTW driver avoids calling clear_thread_tidr() for the same reasons.
I don't have a strong case for exporting clear_thread_tidr(). Here is the
updated patch, exporting just the set_thread_tidr().

Thanks,

Sukadev
---
>From 204ee3c918f8dad46c1e40d2d3730b07c10a87a3 Mon Sep 17 00:00:00 2001
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Date: Mon, 15 Jan 2018 13:43:18 -0600
Subject: [PATCH 1/2] powerpc: export set_thread_tidr()

Export set_thread_tidr() so it can be used by external modules.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
Changelog  [Frederic Barrat] Don't export clear_thread_tidr()

---
 arch/powerpc/kernel/process.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 2010e4c..20df2cb2 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1592,6 +1592,7 @@ int set_thread_tidr(struct task_struct *t)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(set_thread_tidr);
 
 #endif /* CONFIG_PPC64 */
 
-- 
1.8.3.1

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

end of thread, other threads:[~2018-01-17 17:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-17  1:50 [PATCH 1/2] powerpc: export thread-tidr interfaces Sukadev Bhattiprolu
2018-01-17  1:50 ` [PATCH 2/2] powerpc: export set_thread_uses_vas() Sukadev Bhattiprolu
2018-01-17  6:45 ` [PATCH 1/2] powerpc: export thread-tidr interfaces Frederic Barrat
2018-01-17 17:07   ` Sukadev Bhattiprolu

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).