Commit 9b3f7f1b authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'powerpc-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

 - Four commits fixing various things in the new C VDSO code

 - One fix for a 32-bit VMAP stack bug

 - Two minor build fixes

Thanks to Cédric Le Goater, Christophe Leroy, and Will Springer.

* tag 'powerpc-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/32: Fix vmap stack - Properly set r1 before activating MMU on syscall too
  powerpc/vdso: Fix DOTSYM for 32-bit LE VDSO
  powerpc/vdso: Don't pass 64-bit ABI cflags to 32-bit VDSO
  powerpc/vdso: Block R_PPC_REL24 relocations
  powerpc/smp: Add __init to init_big_cores()
  powerpc/time: Force inlining of get_tb()
  powerpc/boot: Fix build of dts/fsl
parents 3913d00a d5c24398
...@@ -373,6 +373,8 @@ initrd-y := $(filter-out $(image-y), $(initrd-y)) ...@@ -373,6 +373,8 @@ initrd-y := $(filter-out $(image-y), $(initrd-y))
targets += $(image-y) $(initrd-y) targets += $(image-y) $(initrd-y)
targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \ targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
$(patsubst $(x).%, dts/%.dtb, $(filter $(x).%, $(image-y)))) $(patsubst $(x).%, dts/%.dtb, $(filter $(x).%, $(image-y))))
targets += $(foreach x, dtbImage uImage cuImage simpleImage treeImage, \
$(patsubst $(x).%, dts/fsl/%.dtb, $(filter $(x).%, $(image-y))))
$(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
......
...@@ -180,7 +180,12 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) ...@@ -180,7 +180,12 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
#define VCPU_GPR(n) __VCPU_GPR(__REG_##n) #define VCPU_GPR(n) __VCPU_GPR(__REG_##n)
#ifdef __KERNEL__ #ifdef __KERNEL__
#ifdef CONFIG_PPC64
/*
* We use __powerpc64__ here because we want the compat VDSO to use the 32-bit
* version below in the else case of the ifdef.
*/
#ifdef __powerpc64__
#define STACKFRAMESIZE 256 #define STACKFRAMESIZE 256
#define __STK_REG(i) (112 + ((i)-14)*8) #define __STK_REG(i) (112 + ((i)-14)*8)
......
...@@ -49,7 +49,7 @@ static inline unsigned long get_tbl(void) ...@@ -49,7 +49,7 @@ static inline unsigned long get_tbl(void)
return mftb(); return mftb();
} }
static inline u64 get_tb(void) static __always_inline u64 get_tb(void)
{ {
unsigned int tbhi, tblo, tbhi2; unsigned int tbhi, tblo, tbhi2;
......
...@@ -121,18 +121,28 @@ ...@@ -121,18 +121,28 @@
#ifdef CONFIG_VMAP_STACK #ifdef CONFIG_VMAP_STACK
mfspr r11, SPRN_SRR0 mfspr r11, SPRN_SRR0
mtctr r11 mtctr r11
#endif
andi. r11, r9, MSR_PR andi. r11, r9, MSR_PR
lwz r11,TASK_STACK-THREAD(r12) mr r11, r1
lwz r1,TASK_STACK-THREAD(r12)
beq- 99f beq- 99f
addi r11, r11, THREAD_SIZE - INT_FRAME_SIZE addi r1, r1, THREAD_SIZE - INT_FRAME_SIZE
#ifdef CONFIG_VMAP_STACK
li r10, MSR_KERNEL & ~(MSR_IR | MSR_RI) /* can take DTLB miss */ li r10, MSR_KERNEL & ~(MSR_IR | MSR_RI) /* can take DTLB miss */
mtmsr r10 mtmsr r10
isync isync
tovirt(r12, r12)
stw r11,GPR1(r1)
stw r11,0(r1)
mr r11, r1
#else
andi. r11, r9, MSR_PR
lwz r11,TASK_STACK-THREAD(r12)
beq- 99f
addi r11, r11, THREAD_SIZE - INT_FRAME_SIZE
tophys(r11, r11)
stw r1,GPR1(r11)
stw r1,0(r11)
tovirt(r1, r11) /* set new kernel sp */
#endif #endif
tovirt_vmstack r12, r12
tophys_novmstack r11, r11
mflr r10 mflr r10
stw r10, _LINK(r11) stw r10, _LINK(r11)
#ifdef CONFIG_VMAP_STACK #ifdef CONFIG_VMAP_STACK
...@@ -140,9 +150,6 @@ ...@@ -140,9 +150,6 @@
#else #else
mfspr r10,SPRN_SRR0 mfspr r10,SPRN_SRR0
#endif #endif
stw r1,GPR1(r11)
stw r1,0(r11)
tovirt_novmstack r1, r11 /* set new kernel sp */
stw r10,_NIP(r11) stw r10,_NIP(r11)
mfcr r10 mfcr r10
rlwinm r10,r10,0,4,2 /* Clear SO bit in CR */ rlwinm r10,r10,0,4,2 /* Clear SO bit in CR */
......
...@@ -990,7 +990,7 @@ static struct sched_domain_topology_level powerpc_topology[] = { ...@@ -990,7 +990,7 @@ static struct sched_domain_topology_level powerpc_topology[] = {
{ NULL, }, { NULL, },
}; };
static int init_big_cores(void) static int __init init_big_cores(void)
{ {
int cpu; int cpu;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# List of files in the vdso, has to be asm only for now # List of files in the vdso, has to be asm only for now
ARCH_REL_TYPE_ABS := R_PPC_JUMP_SLOT|R_PPC_GLOB_DAT|R_PPC_ADDR32|R_PPC_ADDR24|R_PPC_ADDR16|R_PPC_ADDR16_LO|R_PPC_ADDR16_HI|R_PPC_ADDR16_HA|R_PPC_ADDR14|R_PPC_ADDR14_BRTAKEN|R_PPC_ADDR14_BRNTAKEN ARCH_REL_TYPE_ABS := R_PPC_JUMP_SLOT|R_PPC_GLOB_DAT|R_PPC_ADDR32|R_PPC_ADDR24|R_PPC_ADDR16|R_PPC_ADDR16_LO|R_PPC_ADDR16_HI|R_PPC_ADDR16_HA|R_PPC_ADDR14|R_PPC_ADDR14_BRTAKEN|R_PPC_ADDR14_BRNTAKEN|R_PPC_REL24
include $(srctree)/lib/vdso/Makefile include $(srctree)/lib/vdso/Makefile
obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o
...@@ -27,7 +27,7 @@ endif ...@@ -27,7 +27,7 @@ endif
CC32FLAGS := CC32FLAGS :=
ifdef CONFIG_PPC64 ifdef CONFIG_PPC64
CC32FLAGS += -m32 CC32FLAGS += -m32
KBUILD_CFLAGS := $(filter-out -mcmodel=medium,$(KBUILD_CFLAGS)) KBUILD_CFLAGS := $(filter-out -mcmodel=medium -mabi=elfv1 -mabi=elfv2 -mcall-aixdesc,$(KBUILD_CFLAGS))
endif endif
targets := $(obj-vdso32) vdso32.so.dbg targets := $(obj-vdso32) vdso32.so.dbg
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# List of files in the vdso, has to be asm only for now # List of files in the vdso, has to be asm only for now
ARCH_REL_TYPE_ABS := R_PPC_JUMP_SLOT|R_PPC_GLOB_DAT|R_PPC_ADDR32|R_PPC_ADDR24|R_PPC_ADDR16|R_PPC_ADDR16_LO|R_PPC_ADDR16_HI|R_PPC_ADDR16_HA|R_PPC_ADDR14|R_PPC_ADDR14_BRTAKEN|R_PPC_ADDR14_BRNTAKEN ARCH_REL_TYPE_ABS := R_PPC_JUMP_SLOT|R_PPC_GLOB_DAT|R_PPC_ADDR32|R_PPC_ADDR24|R_PPC_ADDR16|R_PPC_ADDR16_LO|R_PPC_ADDR16_HI|R_PPC_ADDR16_HA|R_PPC_ADDR14|R_PPC_ADDR14_BRTAKEN|R_PPC_ADDR14_BRNTAKEN|R_PPC_REL24
include $(srctree)/lib/vdso/Makefile include $(srctree)/lib/vdso/Makefile
obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment