Skip to content

Commit f32c9e0

Browse files
committed
Merge branch 'parisc-4.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc updates from Helge Deller: "Major changes include: - Full support of the firmware Page Deallocation Table with MADV_HWPOISON and MADV_SOFT_OFFLINE. A kernel thread scans regularily for new bad memory pages. - Full support for self-extracting kernel. - Added UBSAN support. - Lots of section mismatch fixes across all parisc drivers. - Added examples for %pF and %pS usage in printk-formats.txt" * 'parisc-4.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: (28 commits) printk-formats.txt: Add examples for %pF and %pS usage parisc: Fix up devices below a PCI-PCI MegaRAID controller bridge parisc/core: Fix section mismatches parisc/ipmi_si_intf: Fix section mismatches on parisc platform parisc/input/hilkbd: Fix section mismatches parisc/net/lasi_82596: Fix section mismatches parisc/serio: Fix section mismatches in gscps2 and hp_sdc drivers parisc: Fix section mismatches in parisc core drivers parisc/parport_gsc: Fix section mismatches parisc/scsi/lasi700: Fix section mismatches parisc/scsi/zalon: Fix section mismatches parisc/8250_gsc: Fix section mismatches parisc/mux: Fix section mismatches parisc/sticore: Fix section mismatches parisc/harmony: Fix section mismatches parisc: Wire up support for self-extracting kernel parisc: Make existing core files reuseable for bootloader parisc: Add core code for self-extracting kernel parisc: Enable UBSAN support parisc/random: Add machine specific randomness ...
2 parents d1ce495 + fd46cd5 commit f32c9e0

49 files changed

Lines changed: 1182 additions & 157 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/printk-formats.txt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ used when printing stack backtraces. The specifier takes into
7575
consideration the effect of compiler optimisations which may occur
7676
when tail-call``s are used and marked with the noreturn GCC attribute.
7777

78+
Examples::
79+
80+
printk("Going to call: %pF\n", gettimeofday);
81+
printk("Going to call: %pF\n", p->func);
82+
printk("%s: called from %pS\n", __func__, (void *)_RET_IP_);
83+
printk("%s: called from %pS\n", __func__,
84+
(void *)__builtin_return_address(0));
85+
printk("Faulted at %pS\n", (void *)regs->ip);
86+
printk(" %s%pB\n", (reliable ? "" : "? "), (void *)*stack);
87+
7888

7989
Kernel Pointers
8090
===============

‎arch/parisc/Kconfig‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ config PARISC
99
select ARCH_WANT_FRAME_POINTERS
1010
select ARCH_HAS_ELF_RANDOMIZE
1111
select ARCH_HAS_STRICT_KERNEL_RWX
12+
select ARCH_HAS_UBSAN_SANITIZE_ALL
13+
select ARCH_WANTS_UBSAN_NO_NULL
14+
select ARCH_SUPPORTS_MEMORY_FAILURE
1215
select RTC_CLASS
1316
select RTC_DRV_GENERIC
1417
select INIT_ALL_POSSIBLE
@@ -17,6 +20,12 @@ config PARISC
1720
select BUG
1821
select BUILDTIME_EXTABLE_SORT
1922
select HAVE_PERF_EVENTS
23+
select HAVE_KERNEL_BZIP2
24+
select HAVE_KERNEL_GZIP
25+
select HAVE_KERNEL_LZ4
26+
select HAVE_KERNEL_LZMA
27+
select HAVE_KERNEL_LZO
28+
select HAVE_KERNEL_XZ
2029
select GENERIC_ATOMIC64 if !64BIT
2130
select GENERIC_IRQ_PROBE
2231
select GENERIC_PCI_IOMAP

‎arch/parisc/Makefile‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,20 @@ KBUILD_DEFCONFIG := default_defconfig
2424
NM = sh $(srctree)/arch/parisc/nm
2525
CHECKFLAGS += -D__hppa__=1
2626
LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
27+
export LIBGCC
2728

2829
ifdef CONFIG_64BIT
2930
UTS_MACHINE := parisc64
3031
CHECKFLAGS += -D__LP64__=1 -m64
3132
CC_ARCHES = hppa64
33+
LD_BFD := elf64-hppa-linux
3234
else # 32-bit
3335
CC_ARCHES = hppa hppa2.0 hppa1.1
36+
LD_BFD := elf32-hppa-linux
3437
endif
3538

39+
export LD_BFD
40+
3641
ifneq ($(SUBARCH),$(UTS_MACHINE))
3742
ifeq ($(CROSS_COMPILE),)
3843
CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
@@ -88,6 +93,8 @@ libs-y += arch/parisc/lib/ $(LIBGCC)
8893

8994
drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/
9095

96+
boot := arch/parisc/boot
97+
9198
PALO := $(shell if (which palo 2>&1); then : ; \
9299
elif [ -x /sbin/palo ]; then echo /sbin/palo; \
93100
fi)
@@ -116,11 +123,14 @@ INSTALL_TARGETS = zinstall install
116123

117124
PHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS)
118125

119-
bzImage zImage: vmlinuz
126+
zImage: vmlinuz
120127
Image: vmlinux
121128

122-
vmlinuz: vmlinux
123-
@gzip -cf -9 $< > $@
129+
bzImage: vmlinux
130+
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
131+
132+
vmlinuz: bzImage
133+
$(OBJCOPY) $(boot)/bzImage $@
124134

125135
install:
126136
$(CONFIG_SHELL) $(src)/arch/parisc/install.sh \

‎arch/parisc/boot/.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
image
2+
bzImage

‎arch/parisc/boot/Makefile‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#
2+
# Makefile for the linux parisc-specific parts of the boot image creator.
3+
#
4+
5+
COMPILE_VERSION := __linux_compile_version_id__`hostname | \
6+
tr -c '[0-9A-Za-z]' '_'`__`date | \
7+
tr -c '[0-9A-Za-z]' '_'`_t
8+
9+
ccflags-y := -DCOMPILE_VERSION=$(COMPILE_VERSION) -gstabs -I.
10+
11+
targets := image
12+
targets += bzImage
13+
subdir- := compressed
14+
15+
$(obj)/image: vmlinux FORCE
16+
$(call if_changed,objcopy)
17+
18+
$(obj)/bzImage: $(obj)/compressed/vmlinux FORCE
19+
$(call if_changed,objcopy)
20+
21+
$(obj)/compressed/vmlinux: FORCE
22+
$(Q)$(MAKE) $(build)=$(obj)/compressed $@
23+
24+
install: $(CONFIGURE) $(obj)/bzImage
25+
sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
26+
System.map "$(INSTALL_PATH)"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sizes.h
2+
vmlinux
3+
vmlinux.lds
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#
2+
# linux/arch/parisc/boot/compressed/Makefile
3+
#
4+
# create a compressed self-extracting vmlinux image from the original vmlinux
5+
#
6+
7+
KCOV_INSTRUMENT := n
8+
GCOV_PROFILE := n
9+
UBSAN_SANITIZE := n
10+
11+
targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
12+
targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
13+
targets += misc.o piggy.o sizes.h head.o real2.o firmware.o
14+
15+
KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER
16+
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
17+
KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks
18+
KBUILD_CFLAGS += -fno-PIE -mno-space-regs -mdisable-fpregs
19+
ifndef CONFIG_64BIT
20+
KBUILD_CFLAGS += -mfast-indirect-calls
21+
endif
22+
23+
OBJECTS += $(obj)/head.o $(obj)/real2.o $(obj)/firmware.o $(obj)/misc.o $(obj)/piggy.o
24+
25+
# LDFLAGS_vmlinux := -X --whole-archive -e startup -T
26+
LDFLAGS_vmlinux := -X -e startup --as-needed -T
27+
$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(LIBGCC)
28+
$(call if_changed,ld)
29+
30+
sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\|parisc_kernel_start\)$$/\#define SZ\2 0x\1/p'
31+
32+
quiet_cmd_sizes = GEN $@
33+
cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@
34+
35+
$(obj)/sizes.h: vmlinux
36+
$(call if_changed,sizes)
37+
38+
AFLAGS_head.o += -I$(objtree)/$(obj) -DBOOTLOADER
39+
$(obj)/head.o: $(obj)/sizes.h
40+
41+
CFLAGS_misc.o += -I$(objtree)/$(obj)
42+
$(obj)/misc.o: $(obj)/sizes.h
43+
44+
$(obj)/firmware.o: $(obj)/firmware.c
45+
$(obj)/firmware.c: $(srctree)/arch/$(SRCARCH)/kernel/firmware.c
46+
$(call cmd,shipped)
47+
48+
AFLAGS_real2.o += -DBOOTLOADER
49+
$(obj)/real2.o: $(obj)/real2.S
50+
$(obj)/real2.S: $(srctree)/arch/$(SRCARCH)/kernel/real2.S
51+
$(call cmd,shipped)
52+
53+
$(obj)/misc.o: $(obj)/sizes.h
54+
55+
CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER
56+
$(obj)/vmlinux.lds: $(obj)/sizes.h
57+
58+
OBJCOPYFLAGS_vmlinux.bin := -O binary -R .comment -S
59+
$(obj)/vmlinux.bin: vmlinux
60+
$(call if_changed,objcopy)
61+
62+
vmlinux.bin.all-y := $(obj)/vmlinux.bin
63+
64+
suffix-$(CONFIG_KERNEL_GZIP) := gz
65+
suffix-$(CONFIG_KERNEL_BZIP2) := bz2
66+
suffix-$(CONFIG_KERNEL_LZ4) := lz4
67+
suffix-$(CONFIG_KERNEL_LZMA) := lzma
68+
suffix-$(CONFIG_KERNEL_LZO) := lzo
69+
suffix-$(CONFIG_KERNEL_XZ) := xz
70+
71+
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y)
72+
$(call if_changed,gzip)
73+
$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y)
74+
$(call if_changed,bzip2)
75+
$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y)
76+
$(call if_changed,lz4)
77+
$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y)
78+
$(call if_changed,lzma)
79+
$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y)
80+
$(call if_changed,lzo)
81+
$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y)
82+
$(call if_changed,xzkern)
83+
84+
LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T
85+
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y)
86+
$(call if_changed,ld)

‎arch/parisc/boot/compressed/head.S‎

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Startup glue code to uncompress the kernel
3+
*
4+
* (C) 2017 Helge Deller <deller@gmx.de>
5+
*/
6+
7+
#include <linux/init.h>
8+
#include <linux/linkage.h>
9+
#include <asm/asm-offsets.h>
10+
#include <asm/page.h>
11+
#include <asm/psw.h>
12+
#include <asm/pdc.h>
13+
#include <asm/assembly.h>
14+
#include "sizes.h"
15+
16+
#define BOOTADDR(x) (x)
17+
18+
#ifndef CONFIG_64BIT
19+
.import $global$ /* forward declaration */
20+
#endif /*!CONFIG_64BIT*/
21+
22+
__HEAD
23+
24+
ENTRY(startup)
25+
.level LEVEL
26+
27+
#define PSW_W_SM 0x200
28+
#define PSW_W_BIT 36
29+
30+
;! nuke the W bit, saving original value
31+
.level 2.0
32+
rsm PSW_W_SM, %r1
33+
34+
.level 1.1
35+
extrw,u %r1, PSW_W_BIT-32, 1, %r1
36+
copy %r1, %arg0
37+
38+
/* Make sure sr4-sr7 are set to zero for the kernel address space */
39+
mtsp %r0,%sr4
40+
mtsp %r0,%sr5
41+
mtsp %r0,%sr6
42+
mtsp %r0,%sr7
43+
44+
/* Clear BSS */
45+
46+
.import _bss,data
47+
.import _ebss,data
48+
49+
load32 BOOTADDR(_bss),%r3
50+
load32 BOOTADDR(_ebss),%r4
51+
ldo FRAME_SIZE(%r4),%sp /* stack at end of bss */
52+
$bss_loop:
53+
cmpb,<<,n %r3,%r4,$bss_loop
54+
stw,ma %r0,4(%r3)
55+
56+
/* Initialize the global data pointer */
57+
loadgp
58+
59+
/* arg0..arg4 were set by palo. */
60+
copy %arg1, %r6 /* command line */
61+
copy %arg2, %r7 /* rd-start */
62+
copy %arg3, %r8 /* rd-end */
63+
load32 BOOTADDR(decompress_kernel),%r3
64+
65+
#ifdef CONFIG_64BIT
66+
.level LEVEL
67+
ssm PSW_W_SM, %r0 /* set W-bit */
68+
depdi 0, 31, 32, %r3
69+
#endif
70+
load32 BOOTADDR(startup_continue), %r2
71+
bv,n 0(%r3)
72+
73+
startup_continue:
74+
#ifdef CONFIG_64BIT
75+
.level LEVEL
76+
rsm PSW_W_SM, %r0 /* clear W-bit */
77+
#endif
78+
79+
load32 KERNEL_BINARY_TEXT_START, %arg0 /* free mem */
80+
copy %r6, %arg1 /* command line */
81+
copy %r7, %arg2 /* rd-start */
82+
copy %r8, %arg3 /* rd-end */
83+
84+
bv,n 0(%ret0)
85+
END(startup)

0 commit comments

Comments
 (0)