aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorUlrich Weigand <Ulrich.Weigand@de.ibm.com>2013-11-20 15:38:05 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-11-20 17:19:23 -0500
commit280270828f108be56f0c486def58acabb070244f (patch)
tree60e3a4b2fdc31af724e0fdc5cc111cda7f8e2bcb /arch/powerpc/kernel
parentf53e462e907cbaed29c49c0f10f5b8f614e1bf1d (diff)
powerpc: Wrong DWARF CFI in the kernel vdso for little-endian / ELFv2
I've finally tracked down why my CR signal-unwind test case still fails on little-endian. The problem turned to be that the kernel installs a signal trampoline in the vDSO, and provides a DWARF CFI record for that trampoline. This CFI describes the save location for CR: rsave (70, 38*RSIZE + (RSIZE - CRSIZE)) which is correct for big-endian, but points to the wrong word on little-endian. This is wrong no matter which ABI. In addition, for the ELFv2 ABI, we should not only provide a CFI record for register 70 (cr2), but for all CR fields separately. Strictly speaking, I guess this would mean providing two separate vDSO images, one for ELFv1 processes and one for ELFv2 processes (or maybe playing some tricks with conditional DWARF expressions). However, having CFI records for the other CR fields in ELFv1 is not actually wrong, they just will be ignored. So it seems the simplest fix would be just to always provide CFI for all the fields. Signed-off-by: Ulrich Weigand <Ulrich.Weigand@de.ibm.com> Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/vdso64/sigtramp.S16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/vdso64/sigtramp.S b/arch/powerpc/kernel/vdso64/sigtramp.S
index 45ea281e9a21..542c6f422e4d 100644
--- a/arch/powerpc/kernel/vdso64/sigtramp.S
+++ b/arch/powerpc/kernel/vdso64/sigtramp.S
@@ -142,6 +142,13 @@ V_FUNCTION_END(__kernel_sigtramp_rt64)
142/* Size of CR reg in DWARF unwind info. */ 142/* Size of CR reg in DWARF unwind info. */
143#define CRSIZE 4 143#define CRSIZE 4
144 144
145/* Offset of CR reg within a full word. */
146#ifdef __LITTLE_ENDIAN__
147#define CROFF 0
148#else
149#define CROFF (RSIZE - CRSIZE)
150#endif
151
145/* This is the offset of the VMX reg pointer. */ 152/* This is the offset of the VMX reg pointer. */
146#define VREGS 48*RSIZE+33*8 153#define VREGS 48*RSIZE+33*8
147 154
@@ -181,7 +188,14 @@ V_FUNCTION_END(__kernel_sigtramp_rt64)
181 rsave (31, 31*RSIZE); \ 188 rsave (31, 31*RSIZE); \
182 rsave (67, 32*RSIZE); /* ap, used as temp for nip */ \ 189 rsave (67, 32*RSIZE); /* ap, used as temp for nip */ \
183 rsave (65, 36*RSIZE); /* lr */ \ 190 rsave (65, 36*RSIZE); /* lr */ \
184 rsave (70, 38*RSIZE + (RSIZE - CRSIZE)) /* cr */ 191 rsave (68, 38*RSIZE + CROFF); /* cr fields */ \
192 rsave (69, 38*RSIZE + CROFF); \
193 rsave (70, 38*RSIZE + CROFF); \
194 rsave (71, 38*RSIZE + CROFF); \
195 rsave (72, 38*RSIZE + CROFF); \
196 rsave (73, 38*RSIZE + CROFF); \
197 rsave (74, 38*RSIZE + CROFF); \
198 rsave (75, 38*RSIZE + CROFF)
185 199
186/* Describe where the FP regs are saved. */ 200/* Describe where the FP regs are saved. */
187#define EH_FRAME_FP \ 201#define EH_FRAME_FP \