Skip to content

Commit e4da01d

Browse files
committed
Merge tag 'powerpc-5.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull more powerpc updates from Michael Ellerman: "The bulk of this is the series to make CONFIG_COMPAT user-selectable, it's been around for a long time but was blocked behind the syscall-in-C series. Plus there's also a few fixes and other minor things. Summary: - A fix for a crash in machine check handling on pseries (ie. guests) - A small series to make it possible to disable CONFIG_COMPAT, and turn it off by default for ppc64le where it's not used. - A few other miscellaneous fixes and small improvements. Thanks to: Alexey Kardashevskiy, Anju T Sudhakar, Arnd Bergmann, Christophe Leroy, Dan Carpenter, Ganesh Goudar, Geert Uytterhoeven, Geoff Levand, Mahesh Salgaonkar, Markus Elfring, Michal Suchanek, Nicholas Piggin, Stephen Boyd, Wen Xiong" * tag 'powerpc-5.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: selftests/powerpc: Always build the tm-poison test 64-bit powerpc: Improve ppc_save_regs() Revert "powerpc/64: irq_work avoid interrupt when called with hardware irqs enabled" powerpc/time: Replace <linux/clk-provider.h> by <linux/of_clk.h> powerpc/pseries/ddw: Extend upper limit for huge DMA window for persistent memory powerpc/perf: split callchain.c by bitness powerpc/64: Make COMPAT user-selectable disabled on littleendian by default. powerpc/64: make buildable without CONFIG_COMPAT powerpc/perf: consolidate valid_user_sp -> invalid_user_sp powerpc/perf: consolidate read_user_stack_32 powerpc: move common register copy functions from signal_32.c to signal.c powerpc: Add back __ARCH_WANT_SYS_LLSEEK macro powerpc/ps3: Set CONFIG_UEVENT_HELPER=y in ps3_defconfig powerpc/ps3: Remove an unneeded NULL check powerpc/ps3: Remove duplicate error message powerpc/powernv: Re-enable imc trace-mode in kernel powerpc/perf: Implement a global lock to avoid races between trace, core and thread imc events. powerpc/pseries: Fix MCE handling on pseries selftests/eeh: Skip ahci adapters powerpc/64s: Fix doorbell wakeup msgclr optimisation
2 parents 6cff482 + 6ba4a2d commit e4da01d

File tree

29 files changed

+766
-601
lines changed

29 files changed

+766
-601
lines changed

arch/powerpc/Kconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,9 @@ config PANIC_TIMEOUT
266266
default 180
267267

268268
config COMPAT
269-
bool
270-
default y if PPC64
269+
bool "Enable support for 32bit binaries"
270+
depends on PPC64
271+
default y if !CPU_LITTLE_ENDIAN
271272
select COMPAT_BINFMT_ELF
272273
select ARCH_WANT_OLD_COMPAT_IPC
273274
select COMPAT_OLD_SIGACTION

arch/powerpc/configs/ps3_defconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ CONFIG_CFG80211=m
6060
CONFIG_CFG80211_WEXT=y
6161
CONFIG_MAC80211=m
6262
# CONFIG_MAC80211_RC_MINSTREL is not set
63+
CONFIG_UEVENT_HELPER=y
64+
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
6365
CONFIG_BLK_DEV_LOOP=y
6466
CONFIG_BLK_DEV_RAM=y
6567
CONFIG_BLK_DEV_RAM_SIZE=65535

arch/powerpc/include/asm/thread_info.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ static inline bool test_thread_local_flags(unsigned int flags)
162162
return (ti->local_flags & flags) != 0;
163163
}
164164

165-
#ifdef CONFIG_PPC64
165+
#ifdef CONFIG_COMPAT
166166
#define is_32bit_task() (test_thread_flag(TIF_32BIT))
167167
#else
168-
#define is_32bit_task() (1)
168+
#define is_32bit_task() (IS_ENABLED(CONFIG_PPC32))
169169
#endif
170170

171171
#if defined(CONFIG_PPC64)

arch/powerpc/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#define __ARCH_WANT_SYS_SOCKETCALL
3232
#define __ARCH_WANT_SYS_FADVISE64
3333
#define __ARCH_WANT_SYS_GETPGRP
34+
#define __ARCH_WANT_SYS_LLSEEK
3435
#define __ARCH_WANT_SYS_NICE
3536
#define __ARCH_WANT_SYS_OLD_GETRLIMIT
3637
#define __ARCH_WANT_SYS_OLD_UNAME

arch/powerpc/kernel/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,17 @@ CFLAGS_btext.o += -DDISABLE_BRANCH_PROFILING
4040
endif
4141

4242
obj-y := cputable.o syscalls.o \
43-
irq.o align.o signal_32.o pmc.o vdso.o \
43+
irq.o align.o signal_$(BITS).o pmc.o vdso.o \
4444
process.o systbl.o idle.o \
4545
signal.o sysfs.o cacheinfo.o time.o \
4646
prom.o traps.o setup-common.o \
4747
udbg.o misc.o io.o misc_$(BITS).o \
4848
of_platform.o prom_parse.o
4949
obj-y += ptrace/
50-
obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o signal_64.o \
50+
obj-$(CONFIG_PPC64) += setup_64.o \
5151
paca.o nvram_64.o firmware.o note.o \
5252
syscall_64.o
53+
obj-$(CONFIG_COMPAT) += sys_ppc32.o signal_32.o
5354
obj-$(CONFIG_VDSO32) += vdso32/
5455
obj-$(CONFIG_PPC_WATCHDOG) += watchdog.o
5556
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o

arch/powerpc/kernel/entry_64.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@
5252
SYS_CALL_TABLE:
5353
.tc sys_call_table[TC],sys_call_table
5454

55+
#ifdef CONFIG_COMPAT
5556
COMPAT_SYS_CALL_TABLE:
5657
.tc compat_sys_call_table[TC],compat_sys_call_table
58+
#endif
5759

5860
/* This value is used to mark exception frames on the stack. */
5961
exception_marker:

arch/powerpc/kernel/exceptions-64s.S

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,22 +3121,3 @@ handle_dabr_fault:
31213121
li r5,SIGSEGV
31223122
bl bad_page_fault
31233123
b interrupt_return
3124-
3125-
/*
3126-
* When doorbell is triggered from system reset wakeup, the message is
3127-
* not cleared, so it would fire again when EE is enabled.
3128-
*
3129-
* When coming from local_irq_enable, there may be the same problem if
3130-
* we were hard disabled.
3131-
*
3132-
* Execute msgclr to clear pending exceptions before handling it.
3133-
*/
3134-
h_doorbell_common_msgclr:
3135-
LOAD_REG_IMMEDIATE(r3, PPC_DBELL_MSGTYPE << (63-36))
3136-
PPC_MSGCLR(3)
3137-
b h_doorbell_common_virt
3138-
3139-
doorbell_super_common_msgclr:
3140-
LOAD_REG_IMMEDIATE(r3, PPC_DBELL_MSGTYPE << (63-36))
3141-
PPC_MSGCLRP(3)
3142-
b doorbell_super_common_virt

arch/powerpc/kernel/irq.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,19 @@ void irq_set_pending_from_srr1(unsigned long srr1)
527527
return;
528528
}
529529

530+
if (reason == PACA_IRQ_DBELL) {
531+
/*
532+
* When doorbell triggers a system reset wakeup, the message
533+
* is not cleared, so if the doorbell interrupt is replayed
534+
* and the IPI handled, the doorbell interrupt would still
535+
* fire when EE is enabled.
536+
*
537+
* To avoid taking the superfluous doorbell interrupt,
538+
* execute a msgclr here before the interrupt is replayed.
539+
*/
540+
ppc_msgclr(PPC_DBELL_MSGTYPE);
541+
}
542+
530543
/*
531544
* The 0 index (SRR1[42:45]=b0000) must always evaluate to 0,
532545
* so this can be called unconditionally with the SRR1 wake

arch/powerpc/kernel/ppc_save_regs.S

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,17 @@ _GLOBAL(ppc_save_regs)
5555
PPC_STL r29,29*SZL(r3)
5656
PPC_STL r30,30*SZL(r3)
5757
PPC_STL r31,31*SZL(r3)
58+
lbz r0,PACAIRQSOFTMASK(r13)
59+
PPC_STL r0,SOFTE-STACK_FRAME_OVERHEAD(r3)
5860
#endif
5961
/* go up one stack frame for SP */
6062
PPC_LL r4,0(r1)
6163
PPC_STL r4,1*SZL(r3)
6264
/* get caller's LR */
6365
PPC_LL r0,LRSAVE(r4)
64-
PPC_STL r0,_NIP-STACK_FRAME_OVERHEAD(r3)
6566
PPC_STL r0,_LINK-STACK_FRAME_OVERHEAD(r3)
67+
mflr r0
68+
PPC_STL r0,_NIP-STACK_FRAME_OVERHEAD(r3)
6669
mfmsr r0
6770
PPC_STL r0,_MSR-STACK_FRAME_OVERHEAD(r3)
6871
mfctr r0
@@ -73,4 +76,5 @@ _GLOBAL(ppc_save_regs)
7376
PPC_STL r0,_CCR-STACK_FRAME_OVERHEAD(r3)
7477
li r0,0
7578
PPC_STL r0,_TRAP-STACK_FRAME_OVERHEAD(r3)
79+
PPC_STL r0,ORIG_GPR3-STACK_FRAME_OVERHEAD(r3)
7680
blr

arch/powerpc/kernel/ptrace/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
CFLAGS_ptrace-view.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
77

88
obj-y += ptrace.o ptrace-view.o
9-
obj-$(CONFIG_PPC64) += ptrace32.o
9+
obj-$(CONFIG_COMPAT) += ptrace32.o
1010
obj-$(CONFIG_VSX) += ptrace-vsx.o
1111
ifneq ($(CONFIG_VSX),y)
1212
obj-y += ptrace-novsx.o

0 commit comments

Comments
 (0)