Skip to content

Commit b970afc

Browse files
committed
Merge tag 'powerpc-5.2-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc updates from Michael Ellerman: "Slightly delayed due to the issue with printk() calling probe_kernel_read() interacting with our new user access prevention stuff, but all fixed now. The only out-of-area changes are the addition of a cpuhp_state, small additions to Documentation and MAINTAINERS updates. Highlights: - Support for Kernel Userspace Access/Execution Prevention (like SMAP/SMEP/PAN/PXN) on some 64-bit and 32-bit CPUs. This prevents the kernel from accidentally accessing userspace outside copy_to/from_user(), or ever executing userspace. - KASAN support on 32-bit. - Rework of where we map the kernel, vmalloc, etc. on 64-bit hash to use the same address ranges we use with the Radix MMU. - A rewrite into C of large parts of our idle handling code for 64-bit Book3S (ie. power8 & power9). - A fast path entry for syscalls on 32-bit CPUs, for a 12-17% speedup in the null_syscall benchmark. - On 64-bit bare metal we have support for recovering from errors with the time base (our clocksource), however if that fails currently we hang in __delay() and never crash. We now have support for detecting that case and short circuiting __delay() so we at least panic() and reboot. - Add support for optionally enabling the DAWR on Power9, which had to be disabled by default due to a hardware erratum. This has the effect of enabling hardware breakpoints for GDB, the downside is a badly behaved program could crash the machine by pointing the DAWR at cache inhibited memory. This is opt-in obviously. - xmon, our crash handler, gets support for a read only mode where operations that could change memory or otherwise disturb the system are disabled. Plus many clean-ups, reworks and minor fixes etc. Thanks to: Christophe Leroy, Akshay Adiga, Alastair D'Silva, Alexey Kardashevskiy, Andrew Donnellan, Aneesh Kumar K.V, Anju T Sudhakar, Anton Blanchard, Ben Hutchings, Bo YU, Breno Leitao, Cédric Le Goater, Christopher M. Riedl, Christoph Hellwig, Colin Ian King, David Gibson, Ganesh Goudar, Gautham R. Shenoy, George Spelvin, Greg Kroah-Hartman, Greg Kurz, Horia Geantă, Jagadeesh Pagadala, Joel Stanley, Joe Perches, Julia Lawall, Laurentiu Tudor, Laurent Vivier, Lukas Bulwahn, Madhavan Srinivasan, Mahesh Salgaonkar, Mathieu Malaterre, Michael Neuling, Mukesh Ojha, Nathan Fontenot, Nathan Lynch, Nicholas Piggin, Nick Desaulniers, Oliver O'Halloran, Peng Hao, Qian Cai, Ravi Bangoria, Rick Lindsley, Russell Currey, Sachin Sant, Stewart Smith, Sukadev Bhattiprolu, Thomas Huth, Tobin C. Harding, Tyrel Datwyler, Valentin Schneider, Wei Yongjun, Wen Yang, YueHaibing" * tag 'powerpc-5.2-1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (205 commits) powerpc/64s: Use early_mmu_has_feature() in set_kuap() powerpc/book3s/64: check for NULL pointer in pgd_alloc() powerpc/mm: Fix hugetlb page initialization ocxl: Fix return value check in afu_ioctl() powerpc/mm: fix section mismatch for setup_kup() powerpc/mm: fix redundant inclusion of pgtable-frag.o in Makefile powerpc/mm: Fix makefile for KASAN powerpc/kasan: add missing/lost Makefile selftests/powerpc: Add a signal fuzzer selftest powerpc/booke64: set RI in default MSR ocxl: Provide global MMIO accessors for external drivers ocxl: move event_fd handling to frontend ocxl: afu_irq only deals with IRQ IDs, not offsets ocxl: Allow external drivers to use OpenCAPI contexts ocxl: Create a clear delineation between ocxl backend & frontend ocxl: Don't pass pci_dev around ocxl: Split pci.c ocxl: Remove some unused exported symbols ocxl: Remove superfluous 'extern' from headers ocxl: read_pasid never returns an error, so make it void ...
2 parents 8ea5b2a + 8150a15 commit b970afc

247 files changed

Lines changed: 7819 additions & 4558 deletions

File tree

Some content is hidden

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

‎Documentation/admin-guide/kernel-parameters.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,11 +2875,11 @@
28752875
noexec=on: enable non-executable mappings (default)
28762876
noexec=off: disable non-executable mappings
28772877

2878-
nosmap [X86]
2878+
nosmap [X86,PPC]
28792879
Disable SMAP (Supervisor Mode Access Prevention)
28802880
even if it is supported by processor.
28812881

2882-
nosmep [X86]
2882+
nosmep [X86,PPC]
28832883
Disable SMEP (Supervisor Mode Execution Prevention)
28842884
even if it is supported by processor.
28852885

‎Documentation/powerpc/DAWR-POWER9.txt‎

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
DAWR issues on POWER9
22
============================
33

4-
On POWER9 the DAWR can cause a checkstop if it points to cache
5-
inhibited (CI) memory. Currently Linux has no way to disinguish CI
6-
memory when configuring the DAWR, so (for now) the DAWR is disabled by
7-
this commit:
4+
On POWER9 the Data Address Watchpoint Register (DAWR) can cause a checkstop
5+
if it points to cache inhibited (CI) memory. Currently Linux has no way to
6+
disinguish CI memory when configuring the DAWR, so (for now) the DAWR is
7+
disabled by this commit:
88

99
commit 9654153158d3e0684a1bdb76dbababdb7111d5a0
1010
Author: Michael Neuling <mikey@neuling.org>
@@ -56,3 +56,35 @@ POWER9. Loads and stores to the watchpoint locations will not be
5656
trapped in GDB. The watchpoint is remembered, so if the guest is
5757
migrated back to the POWER8 host, it will start working again.
5858

59+
Force enabling the DAWR
60+
=============================
61+
Kernels (since ~v5.2) have an option to force enable the DAWR via:
62+
63+
echo Y > /sys/kernel/debug/powerpc/dawr_enable_dangerous
64+
65+
This enables the DAWR even on POWER9.
66+
67+
This is a dangerous setting, USE AT YOUR OWN RISK.
68+
69+
Some users may not care about a bad user crashing their box
70+
(ie. single user/desktop systems) and really want the DAWR. This
71+
allows them to force enable DAWR.
72+
73+
This flag can also be used to disable DAWR access. Once this is
74+
cleared, all DAWR access should be cleared immediately and your
75+
machine once again safe from crashing.
76+
77+
Userspace may get confused by toggling this. If DAWR is force
78+
enabled/disabled between getting the number of breakpoints (via
79+
PTRACE_GETHWDBGINFO) and setting the breakpoint, userspace will get an
80+
inconsistent view of what's available. Similarly for guests.
81+
82+
For the DAWR to be enabled in a KVM guest, the DAWR needs to be force
83+
enabled in the host AND the guest. For this reason, this won't work on
84+
POWERVM as it doesn't allow the HCALL to work. Writes of 'Y' to the
85+
dawr_enable_dangerous file will fail if the hypervisor doesn't support
86+
writing the DAWR.
87+
88+
To double check the DAWR is working, run this kernel selftest:
89+
tools/testing/selftests/powerpc/ptrace/ptrace-hwbreak.c
90+
Any errors/failures/skips mean something is wrong.

‎MAINTAINERS‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4347,7 +4347,7 @@ F: drivers/net/ethernet/chelsio/cxgb4vf/
43474347

43484348
CXL (IBM Coherent Accelerator Processor Interface CAPI) DRIVER
43494349
M: Frederic Barrat <fbarrat@linux.ibm.com>
4350-
M: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
4350+
M: Andrew Donnellan <ajd@linux.ibm.com>
43514351
L: linuxppc-dev@lists.ozlabs.org
43524352
S: Supported
43534353
F: arch/powerpc/platforms/powernv/pci-cxl.c
@@ -7483,13 +7483,12 @@ S: Supported
74837483
F: drivers/net/ethernet/ibm/ibmvnic.*
74847484

74857485
IBM Power Virtual Accelerator Switchboard
7486-
M: Sukadev Bhattiprolu
7486+
M: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
74877487
L: linuxppc-dev@lists.ozlabs.org
74887488
S: Supported
74897489
F: arch/powerpc/platforms/powernv/vas*
74907490
F: arch/powerpc/platforms/powernv/copy-paste.h
74917491
F: arch/powerpc/include/asm/vas.h
7492-
F: arch/powerpc/include/uapi/asm/vas.h
74937492

74947493
IBM Power Virtual Ethernet Device Driver
74957494
M: Thomas Falcon <tlfalcon@linux.ibm.com>
@@ -7536,14 +7535,14 @@ F: drivers/crypto/vmx/ghash*
75367535
F: drivers/crypto/vmx/ppc-xlate.pl
75377536

75387537
IBM Power PCI Hotplug Driver for RPA-compliant PPC64 platform
7539-
M: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
7538+
M: Tyrel Datwyler <tyreld@linux.ibm.com>
75407539
L: linux-pci@vger.kernel.org
75417540
L: linuxppc-dev@lists.ozlabs.org
75427541
S: Supported
75437542
F: drivers/pci/hotplug/rpaphp*
75447543

75457544
IBM Power IO DLPAR Driver for RPA-compliant PPC64 platform
7546-
M: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
7545+
M: Tyrel Datwyler <tyreld@linux.ibm.com>
75477546
L: linux-pci@vger.kernel.org
75487547
L: linuxppc-dev@lists.ozlabs.org
75497548
S: Supported
@@ -10498,7 +10497,7 @@ F: arch/arm/mach-mmp/
1049810497

1049910498
MMU GATHER AND TLB INVALIDATION
1050010499
M: Will Deacon <will.deacon@arm.com>
10501-
M: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
10500+
M: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
1050210501
M: Andrew Morton <akpm@linux-foundation.org>
1050310502
M: Nick Piggin <npiggin@gmail.com>
1050410503
M: Peter Zijlstra <peterz@infradead.org>
@@ -11299,7 +11298,7 @@ F: tools/objtool/
1129911298

1130011299
OCXL (Open Coherent Accelerator Processor Interface OpenCAPI) DRIVER
1130111300
M: Frederic Barrat <fbarrat@linux.ibm.com>
11302-
M: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
11301+
M: Andrew Donnellan <ajd@linux.ibm.com>
1130311302
L: linuxppc-dev@lists.ozlabs.org
1130411303
S: Supported
1130511304
F: arch/powerpc/platforms/powernv/ocxl.c

‎arch/powerpc/Kconfig‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ config PPC
167167
select GENERIC_TIME_VSYSCALL
168168
select HAVE_ARCH_AUDITSYSCALL
169169
select HAVE_ARCH_JUMP_LABEL
170+
select HAVE_ARCH_KASAN if PPC32
170171
select HAVE_ARCH_KGDB
171172
select HAVE_ARCH_MMAP_RND_BITS
172173
select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
@@ -375,7 +376,6 @@ config ZONE_DMA
375376
config PGTABLE_LEVELS
376377
int
377378
default 2 if !PPC64
378-
default 3 if PPC_64K_PAGES && !PPC_BOOK3S_64
379379
default 4
380380

381381
source "arch/powerpc/sysdev/Kconfig"
@@ -391,7 +391,7 @@ source "kernel/Kconfig.hz"
391391

392392
config HUGETLB_PAGE_SIZE_VARIABLE
393393
bool
394-
depends on HUGETLB_PAGE
394+
depends on HUGETLB_PAGE && PPC_BOOK3S_64
395395
default y
396396

397397
config MATH_EMULATION
@@ -832,9 +832,9 @@ config CMDLINE_BOOL
832832
bool "Default bootloader kernel arguments"
833833

834834
config CMDLINE
835-
string "Initial kernel command string"
836-
depends on CMDLINE_BOOL
837-
default "console=ttyS0,9600 console=tty0 root=/dev/sda2"
835+
string "Initial kernel command string" if CMDLINE_BOOL
836+
default "console=ttyS0,9600 console=tty0 root=/dev/sda2" if CMDLINE_BOOL
837+
default ""
838838
help
839839
On some platforms, there is currently no way for the boot loader to
840840
pass arguments to the kernel. For these platforms, you can supply

‎arch/powerpc/Kconfig.debug‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ config XMON_DISASSEMBLY
117117
to say Y here, unless you're building for a memory-constrained
118118
system.
119119

120+
config XMON_DEFAULT_RO_MODE
121+
bool "Restrict xmon to read-only operations by default"
122+
depends on XMON
123+
default y
124+
help
125+
Operate xmon in read-only mode. The cmdline options 'xmon=rw' and
126+
'xmon=ro' override this default.
127+
120128
config DEBUGGER
121129
bool
122130
depends on KGDB || XMON
@@ -361,8 +369,32 @@ config PPC_PTDUMP
361369

362370
If you are unsure, say N.
363371

372+
config PPC_DEBUG_WX
373+
bool "Warn on W+X mappings at boot"
374+
depends on PPC_PTDUMP
375+
help
376+
Generate a warning if any W+X mappings are found at boot.
377+
378+
This is useful for discovering cases where the kernel is leaving
379+
W+X mappings after applying NX, as such mappings are a security risk.
380+
381+
Note that even if the check fails, your kernel is possibly
382+
still fine, as W+X mappings are not a security hole in
383+
themselves, what they do is that they make the exploitation
384+
of other unfixed kernel bugs easier.
385+
386+
There is no runtime or memory usage effect of this option
387+
once the kernel has booted up - it's a one time check.
388+
389+
If in doubt, say "Y".
390+
364391
config PPC_FAST_ENDIAN_SWITCH
365392
bool "Deprecated fast endian-switch syscall"
366393
depends on DEBUG_KERNEL && PPC_BOOK3S_64
367394
help
368395
If you're unsure what this is, say N.
396+
397+
config KASAN_SHADOW_OFFSET
398+
hex
399+
depends on KASAN
400+
default 0xe0000000

‎arch/powerpc/Makefile‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ ifdef CONFIG_PPC_BOOK3S_32
3434
KBUILD_CFLAGS += -mcpu=powerpc
3535
endif
3636

37-
ifeq ($(CROSS_COMPILE),)
38-
KBUILD_DEFCONFIG := $(shell uname -m)_defconfig
39-
else
40-
KBUILD_DEFCONFIG := ppc64_defconfig
41-
endif
37+
# If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use
38+
# ppc64_defconfig because we have nothing better to go on.
39+
uname := $(shell uname -m)
40+
KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig
4241

4342
ifdef CONFIG_PPC64
4443
new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
@@ -367,6 +366,10 @@ ppc32_allmodconfig:
367366
$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/book3s_32.config \
368367
-f $(srctree)/Makefile allmodconfig
369368

369+
PHONY += ppc_defconfig
370+
ppc_defconfig:
371+
$(call merge_into_defconfig,book3s_32.config,)
372+
370373
PHONY += ppc64le_allmodconfig
371374
ppc64le_allmodconfig:
372375
$(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/le.config \
@@ -406,7 +409,9 @@ vdso_install:
406409
ifdef CONFIG_PPC64
407410
$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
408411
endif
412+
ifdef CONFIG_VDSO32
409413
$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
414+
endif
410415

411416
archclean:
412417
$(Q)$(MAKE) $(clean)=$(boot)

‎arch/powerpc/boot/addnote.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,11 @@ main(int ac, char **av)
223223
PUT_16(E_PHNUM, np + 2);
224224

225225
/* write back */
226-
lseek(fd, (long) 0, SEEK_SET);
226+
i = lseek(fd, (long) 0, SEEK_SET);
227+
if (i < 0) {
228+
perror("lseek");
229+
exit(1);
230+
}
227231
i = write(fd, buf, n);
228232
if (i < 0) {
229233
perror("write");

‎arch/powerpc/boot/dts/fsl/b4qds.dtsi‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
interrupt-parent = <&mpic>;
4141

4242
aliases {
43+
crypto = &crypto;
4344
phy_sgmii_10 = &phy_sgmii_10;
4445
phy_sgmii_11 = &phy_sgmii_11;
4546
phy_sgmii_1c = &phy_sgmii_1c;

‎arch/powerpc/configs/pseries_defconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ CONFIG_USB_MON=m
217217
CONFIG_USB_EHCI_HCD=y
218218
# CONFIG_USB_EHCI_HCD_PPC_OF is not set
219219
CONFIG_USB_OHCI_HCD=y
220+
CONFIG_USB_XHCI_HCD=y
220221
CONFIG_USB_STORAGE=m
221222
CONFIG_NEW_LEDS=y
222223
CONFIG_LEDS_CLASS=m

‎arch/powerpc/configs/skiroot_defconfig‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ CONFIG_S2IO=m
163163
CONFIG_MLX4_EN=m
164164
# CONFIG_MLX4_CORE_GEN2 is not set
165165
CONFIG_MLX5_CORE=m
166+
CONFIG_MLX5_CORE_EN=y
167+
# CONFIG_MLX5_EN_RXNFC is not set
166168
# CONFIG_NET_VENDOR_MICREL is not set
167169
# CONFIG_NET_VENDOR_MICROSEMI is not set
168170
CONFIG_MYRI10GE=m

0 commit comments

Comments
 (0)