]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
vdso: replace current_thread_info when building vDSO rather than diking it out
authorNick Alcock <nick.alcock@oracle.com>
Thu, 30 Jul 2015 17:06:29 +0000 (12:06 -0500)
committerAllen Pais <allen.pais@oracle.com>
Tue, 15 Sep 2015 12:09:19 +0000 (17:39 +0530)
Orabug: 20861959

When building the userspace parts of the vDSO code, we have to dike out things
from the various kernel headers we use that generate register relocations,
since we cannot handle relocations in the vDSO.  The principal such thing is
current_thread_info(), which we used to dike out entirely -- but in the -rt
patchset, a lot of things in the headers reference this.  So, instead,
simply have current_thread_info() generate nonsense code that doesn't emit
a relocation, so that its users still compile (though they would never
work -- but that's not important, since they are never used).

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
(cherry picked from commit 4f9b3c6e7fe105ea04f89794007f97b43a63c897)

arch/sparc/include/asm/thread_info_32.h
arch/sparc/include/asm/thread_info_64.h

index b2be7dcf9450f20cad4047d00a550d94fdaa6c49..bec9d5a7ae8dadc1d75315935b16e94d94b881cf 100644 (file)
@@ -68,9 +68,17 @@ struct thread_info {
 #ifndef BUILD_VDSO
 /* how to get the thread information struct from C */
 register struct thread_info *current_thread_info_reg asm("g6");
-#define current_thread_info()   (current_thread_info_reg)
+#else
+/*
+ * It doesn't matter if we genreate nonsense code, since the vDSO
+ * will never use anything that references this macro: but we must
+ * not do anything that produces a register relocation.
+ */
+static struct thread_info *current_thread_info_reg = 0;
 #endif
 
+#define current_thread_info()   (current_thread_info_reg)
+
 /*
  * thread information allocation
  */
index 440f881929f2328146f730ea5d742f7cda1d98df..4331972d8f0481870da9a838559fabbe19ea3724 100644 (file)
@@ -125,9 +125,17 @@ struct thread_info {
 #ifndef BUILD_VDSO
 /* how to get the thread information struct from C */
 register struct thread_info *current_thread_info_reg asm("g6");
-#define current_thread_info()  (current_thread_info_reg)
+#else
+/*
+ * It doesn't matter if we genreate nonsense code, since the vDSO
+ * will never use anything that references this macro: but we must
+ * not do anything that produces a register relocation.
+ */
+static struct thread_info *current_thread_info_reg = 0;
 #endif
 
+#define current_thread_info()  (current_thread_info_reg)
+
 /* thread information allocation */
 #if PAGE_SHIFT == 13
 #define THREAD_SIZE_ORDER      1
@@ -227,7 +235,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
  */
 #define TS_RESTORE_SIGMASK     0x0001  /* restore signal mask in do_signal() */
 
-#if !defined(__ASSEMBLY__) && !defined(BUILD_VDSO)
+#if !defined(__ASSEMBLY__)
 #define HAVE_SET_RESTORE_SIGMASK       1
 static inline void set_restore_sigmask(void)
 {