Thread (4 messages) flat view 4 messages, 2 authors, 2018-01-17

Re: [PATCH 1/2] powerpc: export thread-tidr interfaces

From: Frederic Barrat <hidden>
Date: 2018-01-17 06:45:50
Also in: lkml

Hi,

quoted hunk ↗ jump to hunk
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.

quoted hunk ↗ jump to hunk
  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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help