Skip to content

Commit f06279e

Browse files
committed
Merge tag 'powerpc-5.11-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: - A fix for a change we made to __kernel_sigtramp_rt64() which confused glibc's backtrace logic, and also changed the semantics of that symbol, which was arguably an ABI break. - A fix for a stack overwrite in our VSX instruction emulation. - A couple of fixes for the Makefile logic in the new C VDSO. Thanks to Masahiro Yamada, Naveen N. Rao, Raoni Fassina Firmino, and Ravi Bangoria. * tag 'powerpc-5.11-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/64/signal: Fix regression in __kernel_sigtramp_rt64() semantics powerpc/vdso64: remove meaningless vgettimeofday.o build rule powerpc/vdso: fix unnecessary rebuilds of vgettimeofday.o powerpc/sstep: Fix array out of bound warning
2 parents 4a7859e + 24321ac commit f06279e

File tree

8 files changed

+23
-21
lines changed

8 files changed

+23
-21
lines changed

arch/powerpc/kernel/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ obj-y += ptrace/
5151
obj-$(CONFIG_PPC64) += setup_64.o \
5252
paca.o nvram_64.o note.o syscall_64.o
5353
obj-$(CONFIG_COMPAT) += sys_ppc32.o signal_32.o
54-
obj-$(CONFIG_VDSO32) += vdso32/
54+
obj-$(CONFIG_VDSO32) += vdso32_wrapper.o
5555
obj-$(CONFIG_PPC_WATCHDOG) += watchdog.o
5656
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
5757
obj-$(CONFIG_PPC_DAWR) += dawr.o
@@ -60,7 +60,7 @@ obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power.o
6060
obj-$(CONFIG_PPC_BOOK3S_64) += mce.o mce_power.o
6161
obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o
6262
obj-$(CONFIG_PPC_BARRIER_NOSPEC) += security.o
63-
obj-$(CONFIG_PPC64) += vdso64/
63+
obj-$(CONFIG_PPC64) += vdso64_wrapper.o
6464
obj-$(CONFIG_ALTIVEC) += vecemu.o
6565
obj-$(CONFIG_PPC_BOOK3S_IDLE) += idle_book3s.o
6666
procfs-y := proc_powerpc.o

arch/powerpc/kernel/vdso32/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ CC32FLAGS += -m32
3030
KBUILD_CFLAGS := $(filter-out -mcmodel=medium -mabi=elfv1 -mabi=elfv2 -mcall-aixdesc,$(KBUILD_CFLAGS))
3131
endif
3232

33-
targets := $(obj-vdso32) vdso32.so.dbg
33+
targets := $(obj-vdso32) vdso32.so.dbg vgettimeofday.o
3434
obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
3535

3636
GCOV_PROFILE := n
@@ -46,9 +46,6 @@ obj-y += vdso32_wrapper.o
4646
targets += vdso32.lds
4747
CPPFLAGS_vdso32.lds += -P -C -Upowerpc
4848

49-
# Force dependency (incbin is bad)
50-
$(obj)/vdso32_wrapper.o : $(obj)/vdso32.so.dbg
51-
5249
# link rule for the .so file, .lds has to be first
5350
$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32) $(obj)/vgettimeofday.o FORCE
5451
$(call if_changed,vdso32ld_and_check)

arch/powerpc/kernel/vdso64/Makefile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ endif
1717

1818
# Build rules
1919

20-
targets := $(obj-vdso64) vdso64.so.dbg
20+
targets := $(obj-vdso64) vdso64.so.dbg vgettimeofday.o
2121
obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
2222

2323
GCOV_PROFILE := n
@@ -29,15 +29,9 @@ ccflags-y := -shared -fno-common -fno-builtin -nostdlib \
2929
-Wl,-soname=linux-vdso64.so.1 -Wl,--hash-style=both
3030
asflags-y := -D__VDSO64__ -s
3131

32-
obj-y += vdso64_wrapper.o
3332
targets += vdso64.lds
3433
CPPFLAGS_vdso64.lds += -P -C -U$(ARCH)
3534

36-
$(obj)/vgettimeofday.o: %.o: %.c FORCE
37-
38-
# Force dependency (incbin is bad)
39-
$(obj)/vdso64_wrapper.o : $(obj)/vdso64.so.dbg
40-
4135
# link rule for the .so file, .lds has to be first
4236
$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64) $(obj)/vgettimeofday.o FORCE
4337
$(call if_changed,vdso64ld_and_check)

arch/powerpc/kernel/vdso64/sigtramp.S

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,20 @@
1515

1616
.text
1717

18+
/*
19+
* __kernel_start_sigtramp_rt64 and __kernel_sigtramp_rt64 together
20+
* are one function split in two parts. The kernel jumps to the former
21+
* and the signal handler indirectly (by blr) returns to the latter.
22+
* __kernel_sigtramp_rt64 needs to point to the return address so
23+
* glibc can correctly identify the trampoline stack frame.
24+
*/
1825
.balign 8
1926
.balign IFETCH_ALIGN_BYTES
20-
V_FUNCTION_BEGIN(__kernel_sigtramp_rt64)
27+
V_FUNCTION_BEGIN(__kernel_start_sigtramp_rt64)
2128
.Lsigrt_start:
2229
bctrl /* call the handler */
30+
V_FUNCTION_END(__kernel_start_sigtramp_rt64)
31+
V_FUNCTION_BEGIN(__kernel_sigtramp_rt64)
2332
addi r1, r1, __SIGNAL_FRAMESIZE
2433
li r0,__NR_rt_sigreturn
2534
sc

arch/powerpc/kernel/vdso64/vdso64.lds.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,4 @@ VERSION
131131
/*
132132
* Make the sigreturn code visible to the kernel.
133133
*/
134-
VDSO_sigtramp_rt64 = __kernel_sigtramp_rt64;
134+
VDSO_sigtramp_rt64 = __kernel_start_sigtramp_rt64;

arch/powerpc/lib/sstep.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -818,13 +818,15 @@ void emulate_vsx_store(struct instruction_op *op, const union vsx_reg *reg,
818818
break;
819819
if (rev) {
820820
/* reverse 32 bytes */
821-
buf.d[0] = byterev_8(reg->d[3]);
822-
buf.d[1] = byterev_8(reg->d[2]);
823-
buf.d[2] = byterev_8(reg->d[1]);
824-
buf.d[3] = byterev_8(reg->d[0]);
825-
reg = &buf;
821+
union vsx_reg buf32[2];
822+
buf32[0].d[0] = byterev_8(reg[1].d[1]);
823+
buf32[0].d[1] = byterev_8(reg[1].d[0]);
824+
buf32[1].d[0] = byterev_8(reg[0].d[1]);
825+
buf32[1].d[1] = byterev_8(reg[0].d[0]);
826+
memcpy(mem, buf32, size);
827+
} else {
828+
memcpy(mem, reg, size);
826829
}
827-
memcpy(mem, reg, size);
828830
break;
829831
case 16:
830832
/* stxv, stxvx, stxvl, stxvll */

0 commit comments

Comments
 (0)