Skip to content

Commit 07021b4

Browse files
committed
Merge tag 'powerpc-4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc updates from Michael Ellerman: "Highlights: - Major rework of Book3S 64-bit exception vectors (Nicholas Piggin) - Use gas sections for arranging exception vectors et. al. - Large set of TM cleanups and selftests (Cyril Bur) - Enable transactional memory (TM) lazily for userspace (Cyril Bur) - Support for XZ compression in the zImage wrapper (Oliver O'Halloran) - Add support for bpf constant blinding (Naveen N. Rao) - Beginnings of upstream support for PA Semi Nemo motherboards (Darren Stevens) Fixes: - Ensure .mem(init|exit).text are within _stext/_etext (Michael Ellerman) - xmon: Don't use ld on 32-bit (Michael Ellerman) - vdso64: Use double word compare on pointers (Anton Blanchard) - powerpc/nvram: Fix an incorrect partition merge (Pan Xinhui) - powerpc: Fix usage of _PAGE_RO in hugepage (Christophe Leroy) - powerpc/mm: Update FORCE_MAX_ZONEORDER range to allow hugetlb w/4K (Aneesh Kumar K.V) - Fix memory leak in queue_hotplug_event() error path (Andrew Donnellan) - Replay hypervisor maintenance interrupt first (Nicholas Piggin) Various performance optimisations (Anton Blanchard): - Align hot loops of memset() and backwards_memcpy() - During context switch, check before setting mm_cpumask - Remove static branch prediction in atomic{, 64}_add_unless - Only disable HAVE_EFFICIENT_UNALIGNED_ACCESS on POWER7 little endian - Set default CPU type to POWER8 for little endian builds Cleanups & features: - Sparse fixes/cleanups (Daniel Axtens) - Preserve CFAR value on SLB miss caused by access to bogus address (Paul Mackerras) - Radix MMU fixups for POWER9 (Aneesh Kumar K.V) - Support for setting used_(vsr|vr|spe) in sigreturn path (for CRIU) (Simon Guo) - Optimise syscall entry for virtual, relocatable case (Nicholas Piggin) - Optimise MSR handling in exception handling (Nicholas Piggin) - Support for kexec with Radix MMU (Benjamin Herrenschmidt) - powernv EEH fixes (Russell Currey) - Suprise PCI hotplug support for powernv (Gavin Shan) - Endian/sparse fixes for powernv PCI (Gavin Shan) - Defconfig updates (Anton Blanchard) - KVM: PPC: Book3S HV: Migrate pinned pages out of CMA (Balbir Singh) - cxl: Flush PSL cache before resetting the adapter (Frederic Barrat) - cxl: replace loop with for_each_child_of_node(), remove unneeded of_node_put() (Andrew Donnellan) - Fix HV facility unavailable to use correct handler (Nicholas Piggin) - Remove unnecessary syscall trampoline (Nicholas Piggin) - fadump: Fix build break when CONFIG_PROC_VMCORE=n (Michael Ellerman) - Quieten EEH message when no adapters are found (Anton Blanchard) - powernv: Add PHB register dump debugfs handle (Russell Currey) - Use kprobe blacklist for exception handlers & asm functions (Nicholas Piggin) - Document the syscall ABI (Nicholas Piggin) - MAINTAINERS: Update cxl maintainers (Michael Neuling) - powerpc: Remove all usages of NO_IRQ (Michael Ellerman) Minor cleanups: - Andrew Donnellan, Christophe Leroy, Colin Ian King, Cyril Bur, Frederic Barrat, Pan Xinhui, PrasannaKumar Muralidharan, Rui Teng, Simon Guo" * tag 'powerpc-4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (156 commits) powerpc/bpf: Add support for bpf constant blinding powerpc/bpf: Implement support for tail calls powerpc/bpf: Introduce accessors for using the tmp local stack space powerpc/fadump: Fix build break when CONFIG_PROC_VMCORE=n powerpc: tm: Enable transactional memory (TM) lazily for userspace powerpc/tm: Add TM Unavailable Exception powerpc: Remove do_load_up_transact_{fpu,altivec} powerpc: tm: Rename transct_(*) to ck(\1)_state powerpc: tm: Always use fp_state and vr_state to store live registers selftests/powerpc: Add checks for transactional VSXs in signal contexts selftests/powerpc: Add checks for transactional VMXs in signal contexts selftests/powerpc: Add checks for transactional FPUs in signal contexts selftests/powerpc: Add checks for transactional GPRs in signal contexts selftests/powerpc: Check that signals always get delivered selftests/powerpc: Add TM tcheck helpers in C selftests/powerpc: Allow tests to extend their kill timeout selftests/powerpc: Introduce GPR asm helper header file selftests/powerpc: Move VMX stack frame macros to header file selftests/powerpc: Rework FPU stack placement macros and move to header file selftests/powerpc: Check for VSX preservation across userspace preemption ...
2 parents d1f5323 + b7b7013 commit 07021b4

File tree

227 files changed

+5466
-2926
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+5466
-2926
lines changed
+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
===============================================
2+
Power Architecture 64-bit Linux system call ABI
3+
===============================================
4+
5+
syscall
6+
=======
7+
8+
syscall calling sequence[*] matches the Power Architecture 64-bit ELF ABI
9+
specification C function calling sequence, including register preservation
10+
rules, with the following differences.
11+
12+
[*] Some syscalls (typically low-level management functions) may have
13+
different calling sequences (e.g., rt_sigreturn).
14+
15+
Parameters and return value
16+
---------------------------
17+
The system call number is specified in r0.
18+
19+
There is a maximum of 6 integer parameters to a syscall, passed in r3-r8.
20+
21+
Both a return value and a return error code are returned. cr0.SO is the return
22+
error code, and r3 is the return value or error code. When cr0.SO is clear,
23+
the syscall succeeded and r3 is the return value. When cr0.SO is set, the
24+
syscall failed and r3 is the error code that generally corresponds to errno.
25+
26+
Stack
27+
-----
28+
System calls do not modify the caller's stack frame. For example, the caller's
29+
stack frame LR and CR save fields are not used.
30+
31+
Register preservation rules
32+
---------------------------
33+
Register preservation rules match the ELF ABI calling sequence with the
34+
following differences:
35+
36+
r0: Volatile. (System call number.)
37+
r3: Volatile. (Parameter 1, and return value.)
38+
r4-r8: Volatile. (Parameters 2-6.)
39+
cr0: Volatile (cr0.SO is the return error condition)
40+
cr1, cr5-7: Nonvolatile.
41+
lr: Nonvolatile.
42+
43+
All floating point and vector data registers as well as control and status
44+
registers are nonvolatile.
45+
46+
Invocation
47+
----------
48+
The syscall is performed with the sc instruction, and returns with execution
49+
continuing at the instruction following the sc instruction.
50+
51+
Transactional Memory
52+
--------------------
53+
Syscall behavior can change if the processor is in transactional or suspended
54+
transaction state, and the syscall can affect the behavior of the transaction.
55+
56+
If the processor is in suspended state when a syscall is made, the syscall
57+
will be performed as normal, and will return as normal. The syscall will be
58+
performed in suspended state, so its side effects will be persistent according
59+
to the usual transactional memory semantics. A syscall may or may not result
60+
in the transaction being doomed by hardware.
61+
62+
If the processor is in transactional state when a syscall is made, then the
63+
behavior depends on the presence of PPC_FEATURE2_HTM_NOSC in the AT_HWCAP2 ELF
64+
auxiliary vector.
65+
66+
- If present, which is the case for newer kernels, then the syscall will not
67+
be performed and the transaction will be doomed by the kernel with the
68+
failure code TM_CAUSE_SYSCALL | TM_CAUSE_PERSISTENT in the TEXASR SPR.
69+
70+
- If not present (older kernels), then the kernel will suspend the
71+
transactional state and the syscall will proceed as in the case of a
72+
suspended state syscall, and will resume the transactional state before
73+
returning to the caller. This case is not well defined or supported, so this
74+
behavior should not be relied upon.
75+
76+
77+
vsyscall
78+
========
79+
80+
vsyscall calling sequence matches the syscall calling sequence, with the
81+
following differences. Some vsyscalls may have different calling sequences.
82+
83+
Parameters and return value
84+
---------------------------
85+
r0 is not used as an input. The vsyscall is selected by its address.
86+
87+
Stack
88+
-----
89+
The vsyscall may or may not use the caller's stack frame save areas.
90+
91+
Register preservation rules
92+
---------------------------
93+
r0: Volatile.
94+
cr1, cr5-7: Volatile.
95+
lr: Volatile.
96+
97+
Invocation
98+
----------
99+
The vsyscall is performed with a branch-with-link instruction to the vsyscall
100+
function address.
101+
102+
Transactional Memory
103+
--------------------
104+
vsyscalls will run in the same transactional state as the caller. A vsyscall
105+
may or may not result in the transaction being doomed by hardware.

MAINTAINERS

+2-2
Original file line numberDiff line numberDiff line change
@@ -3523,14 +3523,14 @@ F: drivers/net/ethernet/chelsio/cxgb4vf/
35233523

35243524
CXL (IBM Coherent Accelerator Processor Interface CAPI) DRIVER
35253525
M: Ian Munsie <[email protected]>
3526-
M: Michael Neuling <[email protected]>
3526+
M: Frederic Barrat <[email protected]>
35273527
35283528
S: Supported
3529+
F: arch/powerpc/platforms/powernv/pci-cxl.c
35293530
F: drivers/misc/cxl/
35303531
F: include/misc/cxl*
35313532
F: include/uapi/misc/cxl.h
35323533
F: Documentation/powerpc/cxl.txt
3533-
F: Documentation/powerpc/cxl.txt
35343534
F: Documentation/ABI/testing/sysfs-class-cxl
35353535

35363536
CXLFLASH (IBM Coherent Accelerator Processor Interface CAPI Flash) SCSI DRIVER

arch/powerpc/Kconfig

+3-7
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ config 64BIT
1212
bool
1313
default y if PPC64
1414

15-
config WORD_SIZE
16-
int
17-
default 64 if PPC64
18-
default 32 if !PPC64
19-
2015
config ARCH_PHYS_ADDR_T_64BIT
2116
def_bool PPC64 || PHYS_64BIT
2217

@@ -101,7 +96,7 @@ config PPC
10196
select VIRT_TO_BUS if !PPC64
10297
select HAVE_IDE
10398
select HAVE_IOREMAP_PROT
104-
select HAVE_EFFICIENT_UNALIGNED_ACCESS if !CPU_LITTLE_ENDIAN
99+
select HAVE_EFFICIENT_UNALIGNED_ACCESS if !(CPU_LITTLE_ENDIAN && POWER7_CPU)
105100
select HAVE_KPROBES
106101
select HAVE_ARCH_KGDB
107102
select HAVE_KRETPROBES
@@ -167,6 +162,7 @@ config PPC
167162
select GENERIC_CPU_AUTOPROBE
168163
select HAVE_VIRT_CPU_ACCOUNTING
169164
select HAVE_ARCH_HARDENED_USERCOPY
165+
select HAVE_KERNEL_GZIP
170166

171167
config GENERIC_CSUM
172168
def_bool CPU_LITTLE_ENDIAN
@@ -637,7 +633,7 @@ config FORCE_MAX_ZONEORDER
637633
int "Maximum zone order"
638634
range 8 9 if PPC64 && PPC_64K_PAGES
639635
default "9" if PPC64 && PPC_64K_PAGES
640-
range 9 13 if PPC64 && !PPC_64K_PAGES
636+
range 13 13 if PPC64 && !PPC_64K_PAGES
641637
default "13" if PPC64 && !PPC_64K_PAGES
642638
range 9 64 if PPC32 && PPC_16K_PAGES
643639
default "9" if PPC32 && PPC_16K_PAGES

arch/powerpc/Makefile

+18-25
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,24 @@ NM := $(NM) --synthetic
4343
endif
4444
endif
4545

46-
ifeq ($(CONFIG_PPC64),y)
47-
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
48-
OLDARCH := ppc64le
49-
else
50-
OLDARCH := ppc64
51-
endif
52-
else
53-
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
54-
OLDARCH := ppcle
55-
else
56-
OLDARCH := ppc
57-
endif
58-
endif
46+
# BITS is used as extension for files which are available in a 32 bit
47+
# and a 64 bit version to simplify shared Makefiles.
48+
# e.g.: obj-y += foo_$(BITS).o
49+
export BITS
5950

60-
# It seems there are times we use this Makefile without
61-
# including the config file, but this replicates the old behaviour
62-
ifeq ($(CONFIG_WORD_SIZE),)
63-
CONFIG_WORD_SIZE := 32
51+
ifdef CONFIG_PPC64
52+
BITS := 64
53+
else
54+
BITS := 32
6455
endif
6556

66-
UTS_MACHINE := $(OLDARCH)
57+
machine-y = ppc
58+
machine-$(CONFIG_PPC64) += 64
59+
machine-$(CONFIG_CPU_LITTLE_ENDIAN) += le
60+
UTS_MACHINE := $(subst $(space),,$(machine-y))
6761

6862
ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
6963
override LD += -EL
70-
override CROSS32AS += -mlittle-endian
7164
LDEMULATION := lppc
7265
GNUTARGET := powerpcle
7366
MULTIPLEWORD := -mno-multiple
@@ -89,10 +82,10 @@ aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian)
8982
aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian
9083

9184
ifeq ($(HAS_BIARCH),y)
92-
override AS += -a$(CONFIG_WORD_SIZE)
93-
override LD += -m elf$(CONFIG_WORD_SIZE)$(LDEMULATION)
94-
override CC += -m$(CONFIG_WORD_SIZE)
95-
override AR := GNUTARGET=elf$(CONFIG_WORD_SIZE)-$(GNUTARGET) $(AR)
85+
override AS += -a$(BITS)
86+
override LD += -m elf$(BITS)$(LDEMULATION)
87+
override CC += -m$(BITS)
88+
override AR := GNUTARGET=elf$(BITS)-$(GNUTARGET) $(AR)
9689
endif
9790

9891
LDFLAGS_vmlinux-y := -Bstatic
@@ -179,7 +172,7 @@ KBUILD_CFLAGS += $(call cc-option,-msoft-float)
179172
KBUILD_CFLAGS += -pipe -Iarch/$(ARCH) $(CFLAGS-y)
180173
CPP = $(CC) -E $(KBUILD_CFLAGS)
181174

182-
CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
175+
CHECKFLAGS += -m$(BITS) -D__powerpc__ -D__powerpc$(BITS)__
183176
ifdef CONFIG_CPU_BIG_ENDIAN
184177
CHECKFLAGS += -D__BIG_ENDIAN__
185178
else
@@ -234,7 +227,7 @@ KBUILD_CFLAGS += $(cpu-as-y)
234227
KBUILD_AFLAGS += $(aflags-y)
235228
KBUILD_CFLAGS += $(cflags-y)
236229

237-
head-y := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o
230+
head-y := arch/powerpc/kernel/head_$(BITS).o
238231
head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o
239232
head-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o
240233
head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o

0 commit comments

Comments
 (0)