History

Merge tag 'for-5.16/parisc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull parisc updates from Helge Deller: "Lots of new features and fixes: - Added TOC (table of content) support, which is a debugging feature which is either initiated by pressing the TOC button or via command in the BMC. If pressed the Linux built-in KDB/KGDB will be called (Sven Schnelle) - Fix CONFIG_PREEMPT (Sven) - Fix unwinder on 64-bit kernels (Sven) - Various kgdb fixes (Sven) - Added KFENCE support (me) - Switch to ARCH_STACKWALK implementation (me) - Fix ptrace check on syscall return (me) - Fix kernel crash with fixmaps on PA1.x machines (me) - Move thread_info into task struct, aka CONFIG_THREAD_INFO_IN_TASK (me) - Updated defconfigs - Smaller cleanups, including Makefile cleanups (Masahiro Yamada), use kthread_run() macro (Cai Huoqing), use swap() macro (Yihao Han)" * tag 'for-5.16/parisc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: (36 commits) parisc: Fix set_fixmap() on PA1.x CPUs parisc: Use swap() to swap values in setup_bootmem() parisc: Update defconfigs parisc: decompressor: clean up Makefile parisc: decompressor: remove repeated depenency of misc.o parisc: Remove unused constants from asm-offsets.c parisc/ftrace: use static key to enable/disable function graph tracer parisc/ftrace: set function trace function parisc: Make use of the helper macro kthread_run() parisc: mark xchg functions notrace parisc: enhance warning regarding usage of O_NONBLOCK parisc: Drop ifdef __KERNEL__ from non-uapi kernel headers parisc: Use PRIV_USER and PRIV_KERNEL in ptrace.h parisc: Use PRIV_USER in syscall.S parisc/kgdb: add kgdb_roundup() to make kgdb work with idle polling parisc: Move thread_info into task struct parisc: add support for TOC (transfer of control) parisc/firmware: add functions to retrieve TOC data parisc: add PIM TOC data structures parisc: move virt_map macro to assembly.h ...

Linus Torvalds committed 5 years ago

Commit 552ebfe2 parents 46f8763 6e866a444 files · +622 −321Browse files

Unified · Split

44 files
  1. Documentation/features/core/thread-info-in-task/arch-support.txt +1 −1
  2. arch/parisc/Kconfig +20 −2
  3. arch/parisc/boot/compressed/Makefile +3 −6
  4. arch/parisc/configs/generic-32bit_defconfig +2 −7
  5. arch/parisc/configs/generic-64bit_defconfig +12 −9
  6. arch/parisc/include/asm/assembly.h +32 −0
  7. arch/parisc/include/asm/bitops.h +0 −10
  8. arch/parisc/include/asm/current.h +19 −0
  9. arch/parisc/include/asm/futex.h +0 −3
  10. arch/parisc/include/asm/ide.h +0 −4
  11. arch/parisc/include/asm/kfence.h +44 −0
  12. arch/parisc/include/asm/mckinley.h +0 −2
  13. arch/parisc/include/asm/pdc.h +2 −0
  14. arch/parisc/include/asm/processor.h +5 −6
  15. arch/parisc/include/asm/ptrace.h +3 −3
  16. arch/parisc/include/asm/runway.h +0 −2
  17. arch/parisc/include/asm/smp.h +17 −2
  18. arch/parisc/include/asm/thread_info.h +1 −11
  19. arch/parisc/include/asm/traps.h +1 −0
  20. arch/parisc/include/asm/unaligned.h +0 −2
  21. arch/parisc/include/uapi/asm/pdc.h +26 −2
  22. arch/parisc/kernel/Makefile +1 −0
  23. arch/parisc/kernel/asm-offsets.c +9 −25
  24. arch/parisc/kernel/cache.c +36 −51
  25. arch/parisc/kernel/entry.S +30 −60
  26. arch/parisc/kernel/firmware.c +32 −0
  27. arch/parisc/kernel/ftrace.c +11 −10
  28. arch/parisc/kernel/head.S +19 −21
  29. arch/parisc/kernel/irq.c +3 −3
  30. arch/parisc/kernel/pdt.c +1 −3
  31. arch/parisc/kernel/process.c +2 −2
  32. arch/parisc/kernel/smp.c +21 −4
  33. arch/parisc/kernel/stacktrace.c +13 −17
  34. arch/parisc/kernel/sys_parisc.c +6 −4
  35. arch/parisc/kernel/syscall.S +10 −16
  36. arch/parisc/kernel/toc.c +111 −0
  37. arch/parisc/kernel/toc_asm.S +88 −0
  38. arch/parisc/kernel/traps.c +6 −1
  39. arch/parisc/kernel/unwind.c +20 −14
  40. arch/parisc/lib/bitops.c +6 −6
  41. arch/parisc/mm/fault.c +1 −1
  42. arch/parisc/mm/fixmap.c +1 −4
  43. arch/parisc/mm/init.c +3 −7
  44. include/linux/sched/task_stack.h +4 −0
Documentation/features/core/thread-info-in-task/arch-support.txt+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 | nds32: | ok |
2121 | nios2: | TODO |
2222 | openrisc: | TODO |
23− | parisc: | TODO |
23+ | parisc: | ok |
2424 | powerpc: | ok |
2525 | riscv: | ok |
2626 | s390: | ok |
arch/parisc/Kconfig+20−2
@@ -13,6 +13,8 @@ config PARISC · 12 unmodified lines
1313 select ARCH_NO_SG_CHAIN
1414 select ARCH_SUPPORTS_HUGETLBFS if PA20
1515 select ARCH_SUPPORTS_MEMORY_FAILURE
16+ select ARCH_STACKWALK
17+ select HAVE_RELIABLE_STACKTRACE
1618 select DMA_OPS
1719 select RTC_CLASS
1820 select RTC_DRV_GENERIC
@@ -46,6 +48,7 @@ config PARISC · 27 unmodified lines
4648 select HAVE_ARCH_HASH
4749 select HAVE_ARCH_JUMP_LABEL
4850 select HAVE_ARCH_JUMP_LABEL_RELATIVE
51+ select HAVE_ARCH_KFENCE
4952 select HAVE_ARCH_SECCOMP_FILTER
5053 select HAVE_ARCH_TRACEHOOK
5154 select HAVE_REGS_AND_STACK_ACCESS_API
@@ -53,6 +56,7 @@ config PARISC · 1 unmodified line
5356 select HAVE_UNSTABLE_SCHED_CLOCK if SMP
5457 select LEGACY_TIMER_TICK
5558 select CPU_NO_EFFICIENT_FFS
59+ select THREAD_INFO_IN_TASK
5660 select NEED_DMA_MAP_STATE
5761 select NEED_SG_DMA_LENGTH
5862 select HAVE_ARCH_KGDB
@@ -252,11 +256,11 @@ config PARISC_PAGE_SIZE_4KB · 193 unmodified lines
252256
253257 config PARISC_PAGE_SIZE_16KB
254258 bool "16KB"
255− depends on PA8X00 && BROKEN
259+ depends on PA8X00 && BROKEN && !KFENCE
256260
257261 config PARISC_PAGE_SIZE_64KB
258262 bool "64KB"
259− depends on PA8X00 && BROKEN
263+ depends on PA8X00 && BROKEN && !KFENCE
260264
261265 endchoice
262266
@@ -288,6 +292,20 @@ config SMP · 25 unmodified lines
288292
289293 If you don't know what to do here, say N.
290294
295+config TOC
296+ bool "Support TOC switch"
297+ default y if 64BIT || !SMP
298+ help
299+ Most PA-RISC machines have either a switch at the back of the machine
300+ or a command in BMC to trigger a TOC interrupt. If you say Y here a
301+ handler will be installed which will either show a backtrace on all
302+ CPUs, or enter a possible configured debugger like kgdb/kdb.
303+
304+ Note that with this option enabled, the kernel will use an additional 16KB
305+ per possible CPU as a special stack for the TOC handler.
306+
307+ If you don't want to debug the Kernel, say N.
308+
291309 config PARISC_CPU_TOPOLOGY
292310 bool "Support cpu topology definition"
293311 depends on SMP
arch/parisc/boot/compressed/Makefile+3−6
@@ -9,9 +9,10 @@ KCOV_INSTRUMENT := n · 8 unmodified lines
99 GCOV_PROFILE := n
1010 UBSAN_SANITIZE := n
1111
12+OBJECTS := head.o real2.o firmware.o misc.o piggy.o
1213 targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
1314 targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
14−targets += misc.o piggy.o sizes.h head.o real2.o firmware.o
15+targets += $(OBJECTS) sizes.h
1516 targets += real2.S firmware.c
1617
1718 KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER
@@ -23,10 +24,8 @@ ifndef CONFIG_64BIT · 5 unmodified lines
2324 KBUILD_CFLAGS += -mfast-indirect-calls
2425 endif
2526
26−OBJECTS += $(obj)/head.o $(obj)/real2.o $(obj)/firmware.o $(obj)/misc.o $(obj)/piggy.o
27−
2827 LDFLAGS_vmlinux := -X -e startup --as-needed -T
29−$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(LIBGCC) FORCE
28+$(obj)/vmlinux: $(obj)/vmlinux.lds $(addprefix $(obj)/, $(OBJECTS)) $(LIBGCC) FORCE
3029 $(call if_changed,ld)
3130
3231 sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\|parisc_kernel_start\)$$/\#define SZ\2 0x\1/p'
@@ -52,8 +51,6 @@ $(obj)/real2.o: $(obj)/real2.S · 19 unmodified lines
5251 $(obj)/real2.S: $(srctree)/arch/$(SRCARCH)/kernel/real2.S
5352 $(call cmd,shipped)
5453
55−$(obj)/misc.o: $(obj)/sizes.h
56−
5754 CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER
5855 $(obj)/vmlinux.lds: $(obj)/sizes.h
5956
arch/parisc/configs/generic-32bit_defconfig+2−7
@@ -22,7 +22,6 @@ CONFIG_PCI_LBA=y · 21 unmodified lines
2222 CONFIG_MODULES=y
2323 CONFIG_MODULE_UNLOAD=y
2424 CONFIG_MODULE_FORCE_UNLOAD=y
25−# CONFIG_BLK_DEV_BSG is not set
2625 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
2726 CONFIG_BINFMT_MISC=m
2827 CONFIG_NET=y
@@ -55,13 +54,14 @@ CONFIG_BLK_DEV_SD=y · 26 unmodified lines
5554 CONFIG_CHR_DEV_ST=y
5655 CONFIG_BLK_DEV_SR=y
5756 CONFIG_CHR_DEV_SG=y
57+# CONFIG_BLK_DEV_BSG is not set
5858 CONFIG_SCSI_LASI700=y
5959 CONFIG_SCSI_SYM53C8XX_2=y
6060 CONFIG_SCSI_ZALON=y
6161 CONFIG_SCSI_DH=y
6262 CONFIG_ATA=y
63−CONFIG_ATA_GENERIC=y
6463 CONFIG_PATA_NS87415=y
64+CONFIG_ATA_GENERIC=y
6565 CONFIG_MD=y
6666 CONFIG_BLK_DEV_MD=m
6767 CONFIG_MD_LINEAR=m
@@ -212,7 +212,6 @@ CONFIG_NFS_FS=m · 144 unmodified lines
212212 CONFIG_NFSD=m
213213 CONFIG_NFSD_V3=y
214214 CONFIG_CIFS=m
215−CONFIG_CIFS_WEAK_PW_HASH=y
216215 CONFIG_CIFS_XATTR=y
217216 CONFIG_CIFS_POSIX=y
218217 # CONFIG_CIFS_DEBUG is not set
@@ -221,16 +220,12 @@ CONFIG_CRYPTO_HMAC=y · 2 unmodified lines
221220 CONFIG_CRYPTO_MD5=y
222221 CONFIG_CRYPTO_MICHAEL_MIC=m
223222 CONFIG_CRYPTO_SHA1=y
224−CONFIG_CRYPTO_TGR192=m
225223 CONFIG_CRYPTO_WP512=m
226−CONFIG_CRYPTO_ANUBIS=m
227224 CONFIG_CRYPTO_BLOWFISH=m
228225 CONFIG_CRYPTO_CAST5=m
229226 CONFIG_CRYPTO_CAST6=m
230227 CONFIG_CRYPTO_DES=y
231−CONFIG_CRYPTO_KHAZAD=m
232228 CONFIG_CRYPTO_SERPENT=m
233−CONFIG_CRYPTO_TEA=m
234229 CONFIG_CRYPTO_TWOFISH=m
235230 CONFIG_CRYPTO_DEFLATE=y
236231 CONFIG_CRC_CCITT=m
arch/parisc/configs/generic-64bit_defconfig+12−9
@@ -8,9 +8,10 @@ CONFIG_TASKSTATS=y · 7 unmodified lines
88 CONFIG_TASK_DELAY_ACCT=y
99 CONFIG_TASK_XACCT=y
1010 CONFIG_TASK_IO_ACCOUNTING=y
11+CONFIG_IKCONFIG=y
12+CONFIG_IKCONFIG_PROC=y
1113 CONFIG_CGROUPS=y
1214 CONFIG_MEMCG=y
13−CONFIG_MEMCG_SWAP=y
1415 CONFIG_CGROUP_PIDS=y
1516 CONFIG_CPUSETS=y
1617 CONFIG_RELAY=y
@@ -124,14 +125,13 @@ CONFIG_QLCNIC=m · 107 unmodified lines
124125 # CONFIG_NET_VENDOR_TI is not set
125126 # CONFIG_NET_VENDOR_VIA is not set
126127 # CONFIG_NET_VENDOR_WIZNET is not set
127−CONFIG_MDIO_BITBANG=m
128128 CONFIG_PHYLIB=y
129129 CONFIG_BROADCOM_PHY=m
130130 CONFIG_CICADA_PHY=m
131131 CONFIG_DAVICOM_PHY=m
132132 CONFIG_ICPLUS_PHY=m
133−CONFIG_LSI_ET1011C_PHY=m
134133 CONFIG_LXT_PHY=m
134+CONFIG_LSI_ET1011C_PHY=m
135135 CONFIG_MARVELL_PHY=m
136136 CONFIG_NATIONAL_PHY=m
137137 CONFIG_QSEMI_PHY=m
@@ -139,6 +139,7 @@ CONFIG_REALTEK_PHY=m · 1 unmodified line
139139 CONFIG_SMSC_PHY=m
140140 CONFIG_STE10XP=m
141141 CONFIG_VITESSE_PHY=m
142+CONFIG_MDIO_BITBANG=m
142143 CONFIG_SLIP=m
143144 # CONFIG_WLAN is not set
144145 CONFIG_INPUT_EVDEV=y
@@ -150,7 +151,6 @@ CONFIG_SERIO_SERPORT=m · 5 unmodified lines
150151 # CONFIG_HP_SDC is not set
151152 CONFIG_SERIO_RAW=m
152153 # CONFIG_LEGACY_PTYS is not set
153−CONFIG_NOZOMI=m
154154 CONFIG_SERIAL_8250=y
155155 # CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
156156 CONFIG_SERIAL_8250_CONSOLE=y
@@ -160,6 +160,7 @@ CONFIG_SERIAL_8250_EXTENDED=y · 3 unmodified lines
160160 CONFIG_SERIAL_8250_MANY_PORTS=y
161161 CONFIG_SERIAL_8250_SHARE_IRQ=y
162162 CONFIG_SERIAL_JSM=m
163+CONFIG_NOZOMI=m
163164 CONFIG_IPMI_HANDLER=y
164165 CONFIG_IPMI_DEVICE_INTERFACE=y
165166 CONFIG_IPMI_SI=y
@@ -188,9 +189,13 @@ CONFIG_AGP=y · 22 unmodified lines
188189 CONFIG_AGP_PARISC=y
189190 CONFIG_DRM=y
190191 CONFIG_DRM_RADEON=y
191−CONFIG_FIRMWARE_EDID=y
192−CONFIG_FB_MODE_HELPERS=y
193−CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
192+CONFIG_FB=y
193+CONFIG_FB_MATROX=y
194+CONFIG_FB_MATROX_MYSTIQUE=y
195+CONFIG_FB_MATROX_G=y
196+CONFIG_FB_MATROX_I2C=y
197+CONFIG_FB_MATROX_MAVEN=y
198+CONFIG_FB_RADEON=y
194199 CONFIG_HIDRAW=y
195200 CONFIG_HID_PID=y
196201 CONFIG_USB_HIDDEV=y
@@ -202,7 +207,6 @@ CONFIG_UIO_SERCOS3=m · 5 unmodified lines
202207 CONFIG_UIO_PCI_GENERIC=m
203208 CONFIG_STAGING=y
204209 CONFIG_QLGE=m
205−CONFIG_HP100=m
206210 CONFIG_EXT2_FS=y
207211 CONFIG_EXT2_FS_XATTR=y
208212 CONFIG_EXT2_FS_SECURITY=y
@@ -245,7 +249,6 @@ CONFIG_CRYPTO_PCBC=m · 36 unmodified lines
245249 CONFIG_CRYPTO_MD4=m
246250 CONFIG_CRYPTO_MD5=y
247251 CONFIG_CRYPTO_MICHAEL_MIC=m
248−CONFIG_CRYPTO_ARC4=m
249252 CONFIG_CRYPTO_FCRYPT=m
250253 CONFIG_CRYPTO_DEFLATE=m
251254 # CONFIG_CRYPTO_HW is not set
arch/parisc/include/asm/assembly.h+32−0
@@ -42,6 +42,9 @@ · 41 unmodified lines
4242 #define ASM_ULONG_INSN .word
4343 #endif
4444
45+/* Frame alignment for 32- and 64-bit */
46+#define FRAME_ALIGN 64
47+
4548 #define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE)
4649
4750 #ifdef CONFIG_PA20
@@ -58,6 +61,10 @@ · 10 unmodified lines
5861 #define PA_ASM_LEVEL 1.1
5962 #endif
6063
64+/* Privilege level field in the rightmost two bits of the IA queues */
65+#define PRIV_USER 3
66+#define PRIV_KERNEL 0
67+
6168 #ifdef __ASSEMBLY__
6269
6370 #ifdef CONFIG_64BIT
@@ -71,6 +78,7 @@ · 7 unmodified lines
7178 #include <asm/types.h>
7279
7380 #include <asm/asmregs.h>
81+#include <asm/psw.h>
7482
7583 sp = 30
7684 gp = 27
@@ -497,6 +505,30 @@ · 420 unmodified lines
497505 nop /* 7 */
498506 .endm
499507
508+ /* Switch to virtual mapping, trashing only %r1 */
509+ .macro virt_map
510+ /* pcxt_ssm_bug */
511+ rsm PSW_SM_I, %r0 /* barrier for "Relied upon Translation */
512+ mtsp %r0, %sr4
513+ mtsp %r0, %sr5
514+ mtsp %r0, %sr6
515+ tovirt_r1 %r29
516+ load32 KERNEL_PSW, %r1
517+
518+ rsm PSW_SM_QUIET,%r0 /* second "heavy weight" ctl op */
519+ mtctl %r0, %cr17 /* Clear IIASQ tail */
520+ mtctl %r0, %cr17 /* Clear IIASQ head */
521+ mtctl %r1, %ipsw
522+ load32 4f, %r1
523+ mtctl %r1, %cr18 /* Set IIAOQ tail */
524+ ldo 4(%r1), %r1
525+ mtctl %r1, %cr18 /* Set IIAOQ head */
526+ rfir
527+ nop
528+4:
529+ .endm
530+
531+
500532 /*
501533 * ASM_EXCEPTIONTABLE_ENTRY
502534 *
arch/parisc/include/asm/bitops.h+0−10
@@ -104,8 +104,6 @@ static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr) · 103 unmodified lines
104104
105105 #include <asm-generic/bitops/non-atomic.h>
106106
107−#ifdef __KERNEL__
108−
109107 /**
110108 * __ffs - find first bit in word. returns 0 to "BITS_PER_LONG-1".
111109 * @word: The word to search
@@ -205,16 +203,8 @@ static __inline__ int fls(unsigned int x) · 93 unmodified lines
205203 #include <asm-generic/bitops/hweight.h>
206204 #include <asm-generic/bitops/lock.h>
207205 #include <asm-generic/bitops/sched.h>
208−
209−#endif /* __KERNEL__ */
210−
211206 #include <asm-generic/bitops/find.h>
212−
213−#ifdef __KERNEL__
214−
215207 #include <asm-generic/bitops/le.h>
216208 #include <asm-generic/bitops/ext2-atomic-setbit.h>
217209
218−#endif /* __KERNEL__ */
219−
220210 #endif /* _PARISC_BITOPS_H */
arch/parisc/include/asm/current.h+19−0
@@ -0,0 +1,19 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _ASM_PARISC_CURRENT_H
3+#define _ASM_PARISC_CURRENT_H
4+
5+#include <asm/special_insns.h>
6+
7+#ifndef __ASSEMBLY__
8+struct task_struct;
9+
10+static __always_inline struct task_struct *get_current(void)
11+{
12+ return (struct task_struct *) mfctl(30);
13+}
14+
15+#define current get_current()
16+
17+#endif /* __ASSEMBLY__ */
18+
19+#endif /* _ASM_PARISC_CURRENT_H */
arch/parisc/include/asm/futex.h+0−3
@@ -2,8 +2,6 @@ · 1 unmodified line
22 #ifndef _ASM_PARISC_FUTEX_H
33 #define _ASM_PARISC_FUTEX_H
44
5−#ifdef __KERNEL__
6−
75 #include <linux/futex.h>
86 #include <linux/uaccess.h>
97 #include <asm/atomic.h>
@@ -119,5 +117,4 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, · 109 unmodified lines
119117 return 0;
120118 }
121119
122−#endif /*__KERNEL__*/
123120 #endif /*_ASM_PARISC_FUTEX_H*/
arch/parisc/include/asm/ide.h+0−4
@@ -12,8 +12,6 @@ · 11 unmodified lines
1212 #ifndef __ASM_PARISC_IDE_H
1313 #define __ASM_PARISC_IDE_H
1414
15−#ifdef __KERNEL__
16−
1715 /* Generic I/O and MEMIO string operations. */
1816
1917 #define __ide_insw insw
@@ -53,6 +51,4 @@ static __inline__ void __ide_mm_outsl(void __iomem *port, void *addr, u32 count) · 33 unmodified lines
5351 }
5452 }
5553
56−#endif /* __KERNEL__ */
57−
5854 #endif /* __ASM_PARISC_IDE_H */
arch/parisc/include/asm/kfence.h+44−0
@@ -0,0 +1,44 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * PA-RISC KFENCE support.
4+ *
5+ * Copyright (C) 2021, Helge Deller <deller@gmx.de>
6+ */
7+
8+#ifndef _ASM_PARISC_KFENCE_H
9+#define _ASM_PARISC_KFENCE_H
10+
11+#include <linux/kfence.h>
12+
13+#include <asm/pgtable.h>
14+#include <asm/tlbflush.h>
15+
16+static inline bool arch_kfence_init_pool(void)
17+{
18+ return true;
19+}
20+
21+/* Protect the given page and flush TLB. */
22+static inline bool kfence_protect_page(unsigned long addr, bool protect)
23+{
24+ pte_t *pte = virt_to_kpte(addr);
25+
26+ if (WARN_ON(!pte))
27+ return false;
28+
29+ /*
30+ * We need to avoid IPIs, as we may get KFENCE allocations or faults
31+ * with interrupts disabled.
32+ */
33+
34+ if (protect)
35+ set_pte(pte, __pte(pte_val(*pte) & ~_PAGE_PRESENT));
36+ else
37+ set_pte(pte, __pte(pte_val(*pte) | _PAGE_PRESENT));
38+
39+ flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
40+
41+ return true;
42+}
43+
44+#endif /* _ASM_PARISC_KFENCE_H */
arch/parisc/include/asm/mckinley.h+0−2
@@ -1,10 +1,8 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 #ifndef ASM_PARISC_MCKINLEY_H
33 #define ASM_PARISC_MCKINLEY_H
4−#ifdef __KERNEL__
54
65 /* declared in arch/parisc/kernel/setup.c */
76 extern struct proc_dir_entry * proc_mckinley_root;
87
9−#endif /*__KERNEL__*/
108 #endif /*ASM_PARISC_MCKINLEY_H*/
arch/parisc/include/asm/pdc.h+2−0
@@ -51,6 +51,8 @@ int pdc_spaceid_bits(unsigned long *space_bits); · 50 unmodified lines
5151 int pdc_btlb_info(struct pdc_btlb_info *btlb);
5252 int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path);
5353 #endif /* !CONFIG_PA20 */
54+int pdc_pim_toc11(struct pdc_toc_pim_11 *ret);
55+int pdc_pim_toc20(struct pdc_toc_pim_20 *ret);
5456 int pdc_lan_station_id(char *lan_addr, unsigned long net_hpa);
5557
5658 int pdc_stable_read(unsigned long staddr, void *memaddr, unsigned long count);
arch/parisc/include/asm/processor.h+5−6
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #ifndef __ASSEMBLY__
1313 #include <linux/threads.h>
1414
15+#include <asm/assembly.h>
1516 #include <asm/prefetch.h>
1617 #include <asm/hardware.h>
1718 #include <asm/pdc.h>
@@ -37,16 +38,12 @@ · 19 unmodified lines
3738 #define DEFAULT_MAP_BASE DEFAULT_MAP_BASE32
3839 #endif
3940
40−#ifdef __KERNEL__
41−
4241 /* XXX: STACK_TOP actually should be STACK_BOTTOM for parisc.
4342 * prumpf */
4443
4544 #define STACK_TOP TASK_SIZE
4645 #define STACK_TOP_MAX DEFAULT_TASK_SIZE
4746
48−#endif
49−
5047 #ifndef __ASSEMBLY__
5148
5249 unsigned long calc_max_stack_size(unsigned long stack_max);
@@ -101,8 +98,6 @@ DECLARE_PER_CPU(struct cpuinfo_parisc, cpu_data); · 48 unmodified lines
10198
10299 #define CPU_HVERSION ((boot_cpu_data.hversion >> 4) & 0x0FFF)
103100
104−#define ARCH_MIN_TASKALIGN 8
105−
106101 struct thread_struct {
107102 struct pt_regs regs;
108103 unsigned long task_size;
@@ -294,6 +289,10 @@ extern int _parisc_requires_coherency; · 185 unmodified lines
294289
295290 extern int running_on_qemu;
296291
292+extern void toc_handler(void);
293+extern unsigned int toc_handler_size;
294+extern unsigned int toc_handler_csum;
295+
297296 #endif /* __ASSEMBLY__ */
298297
299298 #endif /* __ASM_PARISC_PROCESSOR_H */
arch/parisc/include/asm/ptrace.h+3−3
@@ -5,17 +5,17 @@ · 4 unmodified lines
55 #ifndef _PARISC_PTRACE_H
66 #define _PARISC_PTRACE_H
77
8+#include <asm/assembly.h>
89 #include <uapi/asm/ptrace.h>
910
10−
1111 #define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
1212
1313 #define arch_has_single_step() 1
1414 #define arch_has_block_step() 1
1515
1616 /* XXX should we use iaoq[1] or iaoq[0] ? */
17−#define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0)
18−#define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0)
17+#define user_mode(regs) (((regs)->iaoq[0] & 3) != PRIV_KERNEL)
18+#define user_space(regs) ((regs)->iasq[1] != PRIV_KERNEL)
1919 #define instruction_pointer(regs) ((regs)->iaoq[0] & ~3)
2020 #define user_stack_pointer(regs) ((regs)->gr[30])
2121 unsigned long profile_pc(struct pt_regs *);
arch/parisc/include/asm/runway.h+0−2
@@ -1,7 +1,6 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 #ifndef ASM_PARISC_RUNWAY_H
33 #define ASM_PARISC_RUNWAY_H
4−#ifdef __KERNEL__
54
65 /* declared in arch/parisc/kernel/setup.c */
76 extern struct proc_dir_entry * proc_runway_root;
@@ -9,5 +8,4 @@ extern struct proc_dir_entry * proc_runway_root; · 1 unmodified line
98 #define RUNWAY_STATUS 0x10
109 #define RUNWAY_DEBUG 0x40
1110
12−#endif /* __KERNEL__ */
1311 #endif /* ASM_PARISC_RUNWAY_H */
arch/parisc/include/asm/smp.h+17−2
@@ -34,8 +34,23 @@ extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); · 33 unmodified lines
3434
3535 #endif /* !ASSEMBLY */
3636
37−#define raw_smp_processor_id() (current_thread_info()->cpu)
38−
37+/*
38+ * This is particularly ugly: it appears we can't actually get the definition
39+ * of task_struct here, but we need access to the CPU this task is running on.
40+ * Instead of using task_struct we're using TASK_CPU which is extracted from
41+ * asm-offsets.h by kbuild to get the current processor ID.
42+ *
43+ * This also needs to be safeguarded when building asm-offsets.s because at
44+ * that time TASK_CPU is not defined yet. It could have been guarded by
45+ * TASK_CPU itself, but we want the build to fail if TASK_CPU is missing
46+ * when building something else than asm-offsets.s
47+ */
48+#ifdef GENERATING_ASM_OFFSETS
49+#define raw_smp_processor_id() (0)
50+#else
51+#include <asm/asm-offsets.h>
52+#define raw_smp_processor_id() (*(unsigned int *)((void *)current + TASK_CPU))
53+#endif
3954 #else /* CONFIG_SMP */
4055
4156 static inline void smp_send_all_nop(void) { return; }
arch/parisc/include/asm/thread_info.h+1−11
@@ -2,30 +2,21 @@ · 1 unmodified line
22 #ifndef _ASM_PARISC_THREAD_INFO_H
33 #define _ASM_PARISC_THREAD_INFO_H
44
5−#ifdef __KERNEL__
6−
75 #ifndef __ASSEMBLY__
86 #include <asm/processor.h>
97 #include <asm/special_insns.h>
108
119 struct thread_info {
12− struct task_struct *task; /* main task structure */
1310 unsigned long flags; /* thread_info flags (see TIF_*) */
14− __u32 cpu; /* current CPU */
1511 int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */
1612 };
1713
1814 #define INIT_THREAD_INFO(tsk) \
1915 { \
20− .task = &tsk, \
2116 .flags = 0, \
22− .cpu = 0, \
2317 .preempt_count = INIT_PREEMPT_COUNT, \
2418 }
2519
26−/* how to get the thread information struct from C */
27−#define current_thread_info() ((struct thread_info *)mfctl(30))
28−
2920 #endif /* !__ASSEMBLY */
3021
3122 /* thread information allocation */
@@ -57,6 +48,7 @@ struct thread_info { · 25 unmodified lines
5748 #define TIF_BLOCKSTEP 10 /* branch stepping? */
5849 #define TIF_SECCOMP 11 /* secure computing */
5950 #define TIF_SYSCALL_TRACEPOINT 12 /* syscall tracepoint instrumentation */
51+#define TIF_NONBLOCK_WARNING 13 /* warned about wrong O_NONBLOCK usage */
6052
6153 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
6254 #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
@@ -87,6 +79,4 @@ struct thread_info { · 24 unmodified lines
8779 # define is_32bit_task() (1)
8880 #endif
8981
90−#endif /* __KERNEL__ */
91−
9282 #endif /* _ASM_PARISC_THREAD_INFO_H */
arch/parisc/include/asm/traps.h+1−0
@@ -14,6 +14,7 @@ void parisc_terminate(char *msg, struct pt_regs *regs, · 13 unmodified lines
1414 void die_if_kernel(char *str, struct pt_regs *regs, long err);
1515
1616 /* mm/fault.c */
17+unsigned long parisc_acctyp(unsigned long code, unsigned int inst);
1718 const char *trap_name(unsigned long code);
1819 void do_page_fault(struct pt_regs *regs, unsigned long code,
1920 unsigned long address);
arch/parisc/include/asm/unaligned.h+0−2
@@ -4,10 +4,8 @@ · 3 unmodified lines
44
55 #include <asm-generic/unaligned.h>
66
7−#ifdef __KERNEL__
87 struct pt_regs;
98 void handle_unaligned(struct pt_regs *regs);
109 int check_unaligned(struct pt_regs *regs);
11−#endif
1210
1311 #endif /* _ASM_PARISC_UNALIGNED_H */
arch/parisc/include/uapi/asm/pdc.h+26−2
@@ -398,8 +398,10 @@ struct zeropage { · 397 unmodified lines
398398 /* int (*vec_rendz)(void); */
399399 unsigned int vec_rendz;
400400 int vec_pow_fail_flen;
401− int vec_pad[10];
402−
401+ int vec_pad0[3];
402+ unsigned int vec_toc_hi;
403+ int vec_pad1[6];
404+
403405 /* [0x040] reserved processor dependent */
404406 int pad0[112];
405407
@@ -689,6 +691,28 @@ struct pdc_hpmc_pim_20 { /* PDC_PIM */ · 283 unmodified lines
689691 unsigned long long fr[32];
690692 };
691693
694+struct pdc_toc_pim_11 {
695+ unsigned int gr[32];
696+ unsigned int cr[32];
697+ unsigned int sr[8];
698+ unsigned int iasq_back;
699+ unsigned int iaoq_back;
700+ unsigned int check_type;
701+ unsigned int hversion;
702+ unsigned int cpu_state;
703+};
704+
705+struct pdc_toc_pim_20 {
706+ unsigned long long gr[32];
707+ unsigned long long cr[32];
708+ unsigned long long sr[8];
709+ unsigned long long iasq_back;
710+ unsigned long long iaoq_back;
711+ unsigned int check_type;
712+ unsigned int hversion;
713+ unsigned int cpu_state;
714+};
715+
692716 #endif /* !defined(__ASSEMBLY__) */
693717
694718 #endif /* _UAPI_PARISC_PDC_H */
arch/parisc/kernel/Makefile+1−0
@@ -39,3 +39,4 @@ obj-$(CONFIG_KGDB) += kgdb.o · 38 unmodified lines
3939 obj-$(CONFIG_KPROBES) += kprobes.o
4040 obj-$(CONFIG_KEXEC_CORE) += kexec.o relocate_kernel.o
4141 obj-$(CONFIG_KEXEC_FILE) += kexec_file.o
42+obj-$(CONFIG_TOC) += toc.o toc_asm.o
arch/parisc/kernel/asm-offsets.c+9−25
@@ -14,6 +14,8 @@ · 13 unmodified lines
1414 * Copyright (C) 2003 James Bottomley <jejb at parisc-linux.org>
1515 */
1616
17+#define GENERATING_ASM_OFFSETS /* asm/smp.h */
18+
1719 #include <linux/types.h>
1820 #include <linux/sched.h>
1921 #include <linux/thread_info.h>
@@ -22,18 +24,12 @@ · 2 unmodified lines
2224 #include <linux/kbuild.h>
2325 #include <linux/pgtable.h>
2426
27+#include <asm/assembly.h>
2528 #include <asm/ptrace.h>
2629 #include <asm/processor.h>
2730 #include <asm/pdc.h>
2831 #include <linux/uaccess.h>
2932
30−#ifdef CONFIG_64BIT
31−#define FRAME_SIZE 128
32−#else
33−#define FRAME_SIZE 64
34−#endif
35−#define FRAME_ALIGN 64
36−
3733 /* Add FRAME_SIZE to the size x and align it to y. All definitions
3834 * that use align_frame will include space for a frame.
3935 */
@@ -41,13 +37,11 @@ · 1 unmodified line
4137
4238 int main(void)
4339 {
44− DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, stack));
45− DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
46− DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, pending));
47− DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
48− DEFINE(TASK_MM, offsetof(struct task_struct, mm));
49− DEFINE(TASK_PERSONALITY, offsetof(struct task_struct, personality));
50− DEFINE(TASK_PID, offsetof(struct task_struct, pid));
40+ DEFINE(TASK_TI_FLAGS, offsetof(struct task_struct, thread_info.flags));
41+ DEFINE(TASK_STACK, offsetof(struct task_struct, stack));
42+#ifdef CONFIG_SMP
43+ DEFINE(TASK_CPU, offsetof(struct task_struct, cpu));
44+#endif
5145 BLANK();
5246 DEFINE(TASK_REGS, offsetof(struct task_struct, thread.regs));
5347 DEFINE(TASK_PT_PSW, offsetof(struct task_struct, thread.regs.gr[ 0]));
@@ -135,10 +129,6 @@ int main(void) · 81 unmodified lines
135129 DEFINE(TASK_PT_ISR, offsetof(struct task_struct, thread.regs.isr));
136130 DEFINE(TASK_PT_IOR, offsetof(struct task_struct, thread.regs.ior));
137131 BLANK();
138− DEFINE(TASK_SZ, sizeof(struct task_struct));
139− /* TASK_SZ_ALGN includes space for a stack frame. */
140− DEFINE(TASK_SZ_ALGN, align_frame(sizeof(struct task_struct), FRAME_ALIGN));
141− BLANK();
142132 DEFINE(PT_PSW, offsetof(struct pt_regs, gr[ 0]));
143133 DEFINE(PT_GR1, offsetof(struct pt_regs, gr[ 1]));
144134 DEFINE(PT_GR2, offsetof(struct pt_regs, gr[ 2]));
@@ -223,17 +213,11 @@ int main(void) · 78 unmodified lines
223213 DEFINE(PT_IIR, offsetof(struct pt_regs, iir));
224214 DEFINE(PT_ISR, offsetof(struct pt_regs, isr));
225215 DEFINE(PT_IOR, offsetof(struct pt_regs, ior));
226− DEFINE(PT_SIZE, sizeof(struct pt_regs));
227216 /* PT_SZ_ALGN includes space for a stack frame. */
228217 DEFINE(PT_SZ_ALGN, align_frame(sizeof(struct pt_regs), FRAME_ALIGN));
229218 BLANK();
230− DEFINE(TI_TASK, offsetof(struct thread_info, task));
231219 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
232− DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
233− DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
234− DEFINE(THREAD_SZ, sizeof(struct thread_info));
235− /* THREAD_SZ_ALGN includes space for a stack frame. */
236− DEFINE(THREAD_SZ_ALGN, align_frame(sizeof(struct thread_info), FRAME_ALIGN));
220+ DEFINE(TI_PRE_COUNT, offsetof(struct task_struct, thread_info.preempt_count));
237221 BLANK();
238222 DEFINE(ICACHE_BASE, offsetof(struct pdc_cache_info, ic_base));
239223 DEFINE(ICACHE_STRIDE, offsetof(struct pdc_cache_info, ic_stride));
arch/parisc/kernel/cache.c+36−51
@@ -543,10 +543,33 @@ static inline pte_t *get_ptep(pgd_t *pgd, unsigned long addr) · 542 unmodified lines
543543 return ptep;
544544 }
545545
546+static void flush_cache_pages(struct vm_area_struct *vma, struct mm_struct *mm,
547+ unsigned long start, unsigned long end)
548+{
549+ unsigned long addr, pfn;
550+ pte_t *ptep;
551+
552+ for (addr = start; addr < end; addr += PAGE_SIZE) {
553+ ptep = get_ptep(mm->pgd, addr);
554+ if (ptep) {
555+ pfn = pte_pfn(*ptep);
556+ flush_cache_page(vma, addr, pfn);
557+ }
558+ }
559+}
560+
561+static void flush_user_cache_tlb(struct vm_area_struct *vma,
562+ unsigned long start, unsigned long end)
563+{
564+ flush_user_dcache_range_asm(start, end);
565+ if (vma->vm_flags & VM_EXEC)
566+ flush_user_icache_range_asm(start, end);
567+ flush_tlb_range(vma, start, end);
568+}
569+
546570 void flush_cache_mm(struct mm_struct *mm)
547571 {
548572 struct vm_area_struct *vma;
549− pgd_t *pgd;
550573
551574 /* Flushing the whole cache on each cpu takes forever on
552575 rp3440, etc. So, avoid it if the mm isn't too big. */
@@ -558,45 +581,22 @@ void flush_cache_mm(struct mm_struct *mm) · 5 unmodified lines
558581 return;
559582 }
560583
584+ preempt_disable();
561585 if (mm->context == mfsp(3)) {
562− for (vma = mm->mmap; vma; vma = vma->vm_next) {
563− flush_user_dcache_range_asm(vma->vm_start, vma->vm_end);
564− if (vma->vm_flags & VM_EXEC)
565− flush_user_icache_range_asm(vma->vm_start, vma->vm_end);
566− flush_tlb_range(vma, vma->vm_start, vma->vm_end);
567− }
586+ for (vma = mm->mmap; vma; vma = vma->vm_next)
587+ flush_user_cache_tlb(vma, vma->vm_start, vma->vm_end);
588+ preempt_enable();
568589 return;
569590 }
570591
571− pgd = mm->pgd;
572− for (vma = mm->mmap; vma; vma = vma->vm_next) {
573− unsigned long addr;
574−
575− for (addr = vma->vm_start; addr < vma->vm_end;
576− addr += PAGE_SIZE) {
577− unsigned long pfn;
578− pte_t *ptep = get_ptep(pgd, addr);
579− if (!ptep)
580− continue;
581− pfn = pte_pfn(*ptep);
582− if (!pfn_valid(pfn))
583− continue;
584− if (unlikely(mm->context)) {
585− flush_tlb_page(vma, addr);
586− __flush_cache_page(vma, addr, PFN_PHYS(pfn));
587− } else {
588− __purge_cache_page(vma, addr, PFN_PHYS(pfn));
589− }
590− }
591− }
592+ for (vma = mm->mmap; vma; vma = vma->vm_next)
593+ flush_cache_pages(vma, mm, vma->vm_start, vma->vm_end);
594+ preempt_enable();
592595 }
593596
594597 void flush_cache_range(struct vm_area_struct *vma,
595598 unsigned long start, unsigned long end)
596599 {
597− pgd_t *pgd;
598− unsigned long addr;
599−
600600 if ((!IS_ENABLED(CONFIG_SMP) || !arch_irqs_disabled()) &&
601601 end - start >= parisc_cache_flush_threshold) {
602602 if (vma->vm_mm->context)
@@ -605,30 +605,15 @@ void flush_cache_range(struct vm_area_struct *vma, · 2 unmodified lines
605605 return;
606606 }
607607
608+ preempt_disable();
608609 if (vma->vm_mm->context == mfsp(3)) {
609− flush_user_dcache_range_asm(start, end);
610− if (vma->vm_flags & VM_EXEC)
611− flush_user_icache_range_asm(start, end);
612− flush_tlb_range(vma, start, end);
610+ flush_user_cache_tlb(vma, start, end);
611+ preempt_enable();
613612 return;
614613 }
615614
616− pgd = vma->vm_mm->pgd;
617− for (addr = vma->vm_start; addr < vma->vm_end; addr += PAGE_SIZE) {
618− unsigned long pfn;
619− pte_t *ptep = get_ptep(pgd, addr);
620− if (!ptep)
621− continue;
622− pfn = pte_pfn(*ptep);
623− if (pfn_valid(pfn)) {
624− if (unlikely(vma->vm_mm->context)) {
625− flush_tlb_page(vma, addr);
626− __flush_cache_page(vma, addr, PFN_PHYS(pfn));
627− } else {
628− __purge_cache_page(vma, addr, PFN_PHYS(pfn));
629− }
630− }
631− }
615+ flush_cache_pages(vma, vma->vm_mm, vma->vm_start, vma->vm_end);
616+ preempt_enable();
632617 }
633618
634619 void
arch/parisc/kernel/entry.S+30−60
@@ -51,30 +51,6 @@ · 50 unmodified lines
5151 extrd,u \spc,(64 - (SPACEID_SHIFT)),32,\prot
5252 .endm
5353 #endif
54−
55− /* Switch to virtual mapping, trashing only %r1 */
56− .macro virt_map
57− /* pcxt_ssm_bug */
58− rsm PSW_SM_I, %r0 /* barrier for "Relied upon Translation */
59− mtsp %r0, %sr4
60− mtsp %r0, %sr5
61− mtsp %r0, %sr6
62− tovirt_r1 %r29
63− load32 KERNEL_PSW, %r1
64−
65− rsm PSW_SM_QUIET,%r0 /* second "heavy weight" ctl op */
66− mtctl %r0, %cr17 /* Clear IIASQ tail */
67− mtctl %r0, %cr17 /* Clear IIASQ head */
68− mtctl %r1, %ipsw
69− load32 4f, %r1
70− mtctl %r1, %cr18 /* Set IIAOQ tail */
71− ldo 4(%r1), %r1
72− mtctl %r1, %cr18 /* Set IIAOQ head */
73− rfir
74− nop
75−4:
76− .endm
77−
7854 /*
7955 * The "get_stack" macros are responsible for determining the
8056 * kernel stack value.
@@ -87,8 +63,8 @@ · 6 unmodified lines
8763 * Need to set up a kernel stack, so call the
8864 * get_stack_use_cr30 macro to set up a pointer
8965 * to the pt_regs structure contained within the
90− * task pointer pointed to by cr30. Set the stack
91− * pointer to point to the end of the task structure.
66+ * task pointer pointed to by cr30. Load the stack
67+ * pointer from the task structure.
9268 *
9369 * Note that we use shadowed registers for temps until
9470 * we can save %r26 and %r29. %r26 is used to preserve
@@ -100,8 +76,6 @@ · 5 unmodified lines
10076 * or handle_interruption. %r29 is used to hold a pointer
10177 * the register save area, and once again, it needs to
10278 * be a non-shadowed register so that it survives the rfir.
103− *
104− * N.B. TASK_SZ_ALGN and PT_SZ_ALGN include space for a stack frame.
10579 */
10680
10781 .macro get_stack_use_cr30
@@ -110,12 +84,11 @@ · 2 unmodified lines
11084
11185 copy %r30, %r17
11286 mfctl %cr30, %r1
113− ldo THREAD_SZ_ALGN(%r1), %r30
114− mtsp %r0,%sr7
87+ tophys %r1,%r9 /* task_struct */
88+ LDREG TASK_STACK(%r9),%r30
89+ ldo PT_SZ_ALGN(%r30),%r30
90+ mtsp %r0,%sr7 /* clear sr7 after kernel stack was set! */
11591 mtsp %r16,%sr3
116− tophys %r1,%r9
117− LDREG TI_TASK(%r9), %r1 /* thread_info -> task_struct */
118− tophys %r1,%r9
11992 ldo TASK_REGS(%r9),%r9
12093 STREG %r17,PT_GR30(%r9)
12194 STREG %r29,PT_GR29(%r9)
@@ -757,7 +730,7 @@ ENTRY(ret_from_kernel_thread) · 635 unmodified lines
757730 BL schedule_tail, %r2
758731 nop
759732
760− LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30), %r1
733+ mfctl %cr30,%r1 /* task_struct */
761734 LDREG TASK_PT_GR25(%r1), %r26
762735 #ifdef CONFIG_64BIT
763736 LDREG TASK_PT_GR27(%r1), %r27
@@ -788,7 +761,6 @@ ENTRY_CFI(_switch_to) · 24 unmodified lines
788761
789762 STREG %r30, TASK_PT_KSP(%r26)
790763 LDREG TASK_PT_KSP(%r25), %r30
791− LDREG TASK_THREAD_INFO(%r25), %r25
792764 bv %r0(%r2)
793765 mtctl %r25,%cr30
794766
@@ -819,17 +791,16 @@ ENDPROC_CFI(_switch_to) · 24 unmodified lines
819791 .align PAGE_SIZE
820792
821793 ENTRY_CFI(syscall_exit_rfi)
822− mfctl %cr30,%r16
823− LDREG TI_TASK(%r16), %r16 /* thread_info -> task_struct */
794+ mfctl %cr30,%r16 /* task_struct */
824795 ldo TASK_REGS(%r16),%r16
825796 /* Force iaoq to userspace, as the user has had access to our current
826797 * context via sigcontext. Also Filter the PSW for the same reason.
827798 */
828799 LDREG PT_IAOQ0(%r16),%r19
829− depi 3,31,2,%r19
800+ depi PRIV_USER,31,2,%r19
830801 STREG %r19,PT_IAOQ0(%r16)
831802 LDREG PT_IAOQ1(%r16),%r19
832− depi 3,31,2,%r19
803+ depi PRIV_USER,31,2,%r19
833804 STREG %r19,PT_IAOQ1(%r16)
834805 LDREG PT_PSW(%r16),%r19
835806 load32 USER_PSW_MASK,%r1
@@ -865,14 +836,14 @@ ENTRY_CFI(syscall_exit_rfi) · 29 unmodified lines
865836 ENTRY(intr_return)
866837 /* check for reschedule */
867838 mfctl %cr30,%r1
868− LDREG TI_FLAGS(%r1),%r19 /* sched.h: TIF_NEED_RESCHED */
839+ LDREG TASK_TI_FLAGS(%r1),%r19 /* sched.h: TIF_NEED_RESCHED */
869840 bb,<,n %r19,31-TIF_NEED_RESCHED,intr_do_resched /* forward */
870841
871842 .import do_notify_resume,code
872843 intr_check_sig:
873844 /* As above */
874845 mfctl %cr30,%r1
875− LDREG TI_FLAGS(%r1),%r19
846+ LDREG TASK_TI_FLAGS(%r1),%r19
876847 ldi (_TIF_USER_WORK_MASK & ~_TIF_NEED_RESCHED), %r20
877848 and,COND(<>) %r19, %r20, %r0
878849 b,n intr_restore /* skip past if we've nothing to do */
@@ -974,8 +945,8 @@ intr_do_preempt: · 95 unmodified lines
974945
975946 /* current_thread_info()->preempt_count */
976947 mfctl %cr30, %r1
977− LDREG TI_PRE_COUNT(%r1), %r19
978− cmpib,COND(<>) 0, %r19, intr_restore /* if preempt_count > 0 */
948+ ldw TI_PRE_COUNT(%r1), %r19
949+ cmpib,<> 0, %r19, intr_restore /* if preempt_count > 0 */
979950 nop /* prev insn branched backwards */
980951
981952 /* check if we interrupted a critical path */
@@ -1716,7 +1687,7 @@ dtlb_fault: · 734 unmodified lines
17161687
17171688 .macro fork_like name
17181689 ENTRY_CFI(sys_\name\()_wrapper)
1719− LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30), %r1
1690+ mfctl %cr30,%r1
17201691 ldo TASK_REGS(%r1),%r1
17211692 reg_save %r1
17221693 mfctl %cr27, %r28
@@ -1736,7 +1707,7 @@ ENTRY(child_return) · 13 unmodified lines
17361707 BL schedule_tail, %r2
17371708 nop
17381709 finish_child_return:
1739− LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30), %r1
1710+ mfctl %cr30,%r1
17401711 ldo TASK_REGS(%r1),%r1 /* get pt regs */
17411712
17421713 LDREG PT_CR27(%r1), %r3
@@ -1747,7 +1718,7 @@ finish_child_return: · 4 unmodified lines
17471718 END(child_return)
17481719
17491720 ENTRY_CFI(sys_rt_sigreturn_wrapper)
1750− LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r26
1721+ mfctl %cr30,%r26
17511722 ldo TASK_REGS(%r26),%r26 /* get pt regs */
17521723 /* Don't save regs, we are going to restore them from sigcontext. */
17531724 STREG %r2, -RP_OFFSET(%r30)
@@ -1764,7 +1735,7 @@ ENTRY_CFI(sys_rt_sigreturn_wrapper) · 10 unmodified lines
17641735 LDREG -RP_OFFSET(%r30), %r2
17651736
17661737 /* FIXME: I think we need to restore a few more things here. */
1767− LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1
1738+ mfctl %cr30,%r1
17681739 ldo TASK_REGS(%r1),%r1 /* get pt regs */
17691740 reg_restore %r1
17701741
@@ -1783,9 +1754,7 @@ ENTRY(syscall_exit) · 12 unmodified lines
17831754 */
17841755
17851756 /* save return value now */
1786−
17871757 mfctl %cr30, %r1
1788− LDREG TI_TASK(%r1),%r1
17891758 STREG %r28,TASK_PT_GR28(%r1)
17901759
17911760 /* Seems to me that dp could be wrong here, if the syscall involved
@@ -1796,13 +1765,14 @@ ENTRY(syscall_exit) · 4 unmodified lines
17961765 syscall_check_resched:
17971766
17981767 /* check for reschedule */
1799−
1800− LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19 /* long */
1768+ mfctl %cr30,%r19
1769+ LDREG TASK_TI_FLAGS(%r19),%r19 /* long */
18011770 bb,<,n %r19, 31-TIF_NEED_RESCHED, syscall_do_resched /* forward */
18021771
18031772 .import do_signal,code
18041773 syscall_check_sig:
1805− LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19
1774+ mfctl %cr30,%r19
1775+ LDREG TASK_TI_FLAGS(%r19),%r19
18061776 ldi (_TIF_USER_WORK_MASK & ~_TIF_NEED_RESCHED), %r26
18071777 and,COND(<>) %r19, %r26, %r0
18081778 b,n syscall_restore /* skip past if we've nothing to do */
@@ -1813,7 +1783,7 @@ syscall_do_signal: · 4 unmodified lines
18131783 * consistent with all the relevant state of the process
18141784 * before the syscall. We need to verify this.
18151785 */
1816− LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1
1786+ mfctl %cr30,%r1
18171787 ldo TASK_REGS(%r1), %r26 /* struct pt_regs *regs */
18181788 reg_save %r26
18191789
@@ -1824,17 +1794,17 @@ syscall_do_signal: · 4 unmodified lines
18241794 BL do_notify_resume,%r2
18251795 ldi 1, %r25 /* long in_syscall = 1 */
18261796
1827− LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1
1797+ mfctl %cr30,%r1
18281798 ldo TASK_REGS(%r1), %r20 /* reload pt_regs */
18291799 reg_restore %r20
18301800
18311801 b,n syscall_check_sig
18321802
18331803 syscall_restore:
1834− LDREG TI_TASK-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1
1804+ mfctl %cr30,%r1
18351805
18361806 /* Are we being ptraced? */
1837− ldw TASK_FLAGS(%r1),%r19
1807+ LDREG TASK_TI_FLAGS(%r1),%r19
18381808 ldi _TIF_SYSCALL_TRACE_MASK,%r2
18391809 and,COND(=) %r19,%r2,%r0
18401810 b,n syscall_restore_rfi
@@ -1873,7 +1843,7 @@ syscall_restore: · 32 unmodified lines
18731843 mtsp %r1,%sr5 /* Restore sr5 */
18741844 mtsp %r1,%sr6 /* Restore sr6 */
18751845
1876− depi 3,31,2,%r31 /* ensure return to user mode. */
1846+ depi PRIV_USER,31,2,%r31 /* ensure return to user mode. */
18771847
18781848 #ifdef CONFIG_64BIT
18791849 /* decide whether to reset the wide mode bit
@@ -1949,7 +1919,7 @@ syscall_restore_rfi: · 69 unmodified lines
19491919 STREG %r0,TASK_PT_SR2(%r1)
19501920
19511921 LDREG TASK_PT_GR31(%r1),%r2
1952− depi 3,31,2,%r2 /* ensure return to user mode. */
1922+ depi PRIV_USER,31,2,%r2 /* ensure return to user mode. */
19531923 STREG %r2,TASK_PT_IAOQ0(%r1)
19541924 ldo 4(%r2),%r2
19551925 STREG %r2,TASK_PT_IAOQ1(%r1)
@@ -1958,10 +1928,10 @@ syscall_restore_rfi: · 2 unmodified lines
19581928
19591929 pt_regs_ok:
19601930 LDREG TASK_PT_IAOQ0(%r1),%r2
1961− depi 3,31,2,%r2 /* ensure return to user mode. */
1931+ depi PRIV_USER,31,2,%r2 /* ensure return to user mode. */
19621932 STREG %r2,TASK_PT_IAOQ0(%r1)
19631933 LDREG TASK_PT_IAOQ1(%r1),%r2
1964− depi 3,31,2,%r2
1934+ depi PRIV_USER,31,2,%r2
19651935 STREG %r2,TASK_PT_IAOQ1(%r1)
19661936 b intr_restore
19671937 copy %r25,%r16
arch/parisc/kernel/firmware.c+32−0
@@ -1061,6 +1061,38 @@ int pdc_mem_pdt_read_entries(struct pdc_mem_read_pdt *pret, · 1060 unmodified lines
10611061 return retval;
10621062 }
10631063
1064+/**
1065+ * pdc_pim_toc11 - Fetch TOC PIM 1.1 data from firmware.
1066+ * @ret: pointer to return buffer
1067+ */
1068+int pdc_pim_toc11(struct pdc_toc_pim_11 *ret)
1069+{
1070+ int retval;
1071+ unsigned long flags;
1072+
1073+ spin_lock_irqsave(&pdc_lock, flags);
1074+ retval = mem_pdc_call(PDC_PIM, PDC_PIM_TOC, __pa(pdc_result),
1075+ __pa(ret), sizeof(*ret));
1076+ spin_unlock_irqrestore(&pdc_lock, flags);
1077+ return retval;
1078+}
1079+
1080+/**
1081+ * pdc_pim_toc20 - Fetch TOC PIM 2.0 data from firmware.
1082+ * @ret: pointer to return buffer
1083+ */
1084+int pdc_pim_toc20(struct pdc_toc_pim_20 *ret)
1085+{
1086+ int retval;
1087+ unsigned long flags;
1088+
1089+ spin_lock_irqsave(&pdc_lock, flags);
1090+ retval = mem_pdc_call(PDC_PIM, PDC_PIM_TOC, __pa(pdc_result),
1091+ __pa(ret), sizeof(*ret));
1092+ spin_unlock_irqrestore(&pdc_lock, flags);
1093+ return retval;
1094+}
1095+
10641096 /**
10651097 * pdc_tod_set - Set the Time-Of-Day clock.
10661098 * @sec: The number of seconds since epoch.
arch/parisc/kernel/ftrace.c+11−10
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/uaccess.h>
1616 #include <linux/kprobes.h>
1717 #include <linux/ptrace.h>
18+#include <linux/jump_label.h>
1819
1920 #include <asm/assembly.h>
2021 #include <asm/sections.h>
@@ -24,6 +25,8 @@ · 3 unmodified lines
2425 #define __hot __section(".text.hot")
2526
2627 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
28+static DEFINE_STATIC_KEY_FALSE(ftrace_graph_enable);
29+
2730 /*
2831 * Hook the return address and push it in the stack of return addrs
2932 * in current thread info.
@@ -48,25 +51,19 @@ static void __hot prepare_ftrace_return(unsigned long *parent, · 18 unmodified lines
4851 }
4952 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
5053
54+static ftrace_func_t ftrace_func;
55+
5156 void notrace __hot ftrace_function_trampoline(unsigned long parent,
5257 unsigned long self_addr,
5358 unsigned long org_sp_gr3,
5459 struct ftrace_regs *fregs)
5560 {
56−#ifndef CONFIG_DYNAMIC_FTRACE
57− extern ftrace_func_t ftrace_trace_function;
58−#endif
5961 extern struct ftrace_ops *function_trace_op;
6062
61− if (function_trace_op->flags & FTRACE_OPS_FL_ENABLED &&
62− ftrace_trace_function != ftrace_stub)
63− ftrace_trace_function(self_addr, parent,
64− function_trace_op, fregs);
63+ ftrace_func(self_addr, parent, function_trace_op, fregs);
6564
6665 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
67− if (dereference_function_descriptor(ftrace_graph_return) !=
68− dereference_function_descriptor(ftrace_stub) ||
69− ftrace_graph_entry != ftrace_graph_entry_stub) {
66+ if (static_branch_unlikely(&ftrace_graph_enable)) {
7067 unsigned long *parent_rp;
7168
7269 /* calculate pointer to %rp in stack */
@@ -84,11 +81,13 @@ void notrace __hot ftrace_function_trampoline(unsigned long parent, · 11 unmodified lines
8481 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
8582 int ftrace_enable_ftrace_graph_caller(void)
8683 {
84+ static_key_enable(&ftrace_graph_enable.key);
8785 return 0;
8886 }
8987
9088 int ftrace_disable_ftrace_graph_caller(void)
9189 {
90+ static_key_enable(&ftrace_graph_enable.key);
9291 return 0;
9392 }
9493 #endif
@@ -99,8 +98,10 @@ int __init ftrace_dyn_arch_init(void) · 4 unmodified lines
9998 {
10099 return 0;
101100 }
101+
102102 int ftrace_update_ftrace_func(ftrace_func_t func)
103103 {
104+ ftrace_func = func;
104105 return 0;
105106 }
106107
arch/parisc/kernel/head.S+19−21
@@ -35,7 +35,8 @@ END(boot_args) · 34 unmodified lines
3535 __HEAD
3636
3737 .align 4
38− .import init_thread_union,data
38+ .import init_task,data
39+ .import init_stack,data
3940 .import fault_vector_20,code /* IVA parisc 2.0 32 bit */
4041 #ifndef CONFIG_64BIT
4142 .import fault_vector_11,code /* IVA parisc 1.1 32 bit */
@@ -123,12 +124,12 @@ $pgt_fill_loop: · 81 unmodified lines
123124 load32 start_parisc,%r11
124125
125126 /* And the initial task pointer */
126− load32 init_thread_union,%r6
127+ load32 init_task,%r6
127128 mtctl %r6,%cr30
128129
129130 /* And the stack pointer too */
130− ldo THREAD_SZ_ALGN(%r6),%sp
131−
131+ load32 init_stack,%sp
132+ tophys_r1 %sp
132133 #if defined(CONFIG_64BIT) && defined(CONFIG_FUNCTION_TRACER)
133134 .import _mcount,data
134135 /* initialize mcount FPTR */
@@ -186,12 +187,11 @@ common_stext: · 51 unmodified lines
186187 #endif /*CONFIG_SMP*/
187188
188189 #ifdef CONFIG_64BIT
189− tophys_r1 %sp
190+ mfctl %cr30,%r6 /* PCX-W2 firmware bug */
191+ tophys_r1 %r6
190192
191193 /* Save the rfi target address */
192− ldd TI_TASK-THREAD_SZ_ALGN(%sp), %r10
193− tophys_r1 %r10
194− std %r11, TASK_PT_GR11(%r10)
194+ STREG %r11, TASK_PT_GR11(%r6)
195195 /* Switch to wide mode Superdome doesn't support narrow PDC
196196 ** calls.
197197 */
@@ -206,7 +206,6 @@ common_stext: · 8 unmodified lines
206206 ** Someday, palo might not do this for the Monarch either.
207207 */
208208 2:
209− mfctl %cr30,%r6 /* PCX-W2 firmware bug */
210209
211210 ldo PDC_PSW(%r0),%arg0 /* 21 */
212211 ldo PDC_PSW_SET_DEFAULTS(%r0),%arg1 /* 2 */
@@ -216,13 +215,9 @@ common_stext: · 3 unmodified lines
216215 copy %r0,%arg3
217216
218217 stext_pdc_ret:
218+ LDREG TASK_PT_GR11(%r6), %r11
219+ tovirt_r1 %r6
219220 mtctl %r6,%cr30 /* restore task thread info */
220−
221− /* restore rfi target address*/
222− ldd TI_TASK-THREAD_SZ_ALGN(%sp), %r10
223− tophys_r1 %r10
224− ldd TASK_PT_GR11(%r10), %r11
225− tovirt_r1 %sp
226221 #endif
227222
228223 /* PARANOID: clear user scratch/user space SR's */
@@ -287,7 +282,9 @@ aligned_rfi: · 58 unmodified lines
287282
288283 load32 KERNEL_PSW,%r10
289284 mtctl %r10,%ipsw
290−
285+
286+ tovirt_r1 %sp
287+
291288 /* Jump through hyperspace to Virt Mode */
292289 rfi
293290 nop
@@ -343,12 +340,13 @@ smp_slave_stext: · 49 unmodified lines
343340 #endif
344341
345342 /* Initialize the SP - monarch sets up smp_init_current_idle_task */
346− load32 PA(smp_init_current_idle_task),%sp
347− LDREG 0(%sp),%sp /* load task address */
343+ load32 PA(smp_init_current_idle_task),%r6
344+ LDREG 0(%r6),%r6
345+ mtctl %r6,%cr30
346+ tophys_r1 %r6
347+ LDREG TASK_STACK(%r6),%sp
348348 tophys_r1 %sp
349− LDREG TASK_THREAD_INFO(%sp),%sp
350− mtctl %sp,%cr30 /* store in cr30 */
351− ldo THREAD_SZ_ALGN(%sp),%sp
349+ ldo FRAME_SIZE(%sp),%sp
352350
353351 /* point CPU to kernel page tables */
354352 load32 PA(swapper_pg_dir),%r4
arch/parisc/kernel/irq.c+3−3
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/kernel_stat.h>
1616 #include <linux/seq_file.h>
1717 #include <linux/types.h>
18+#include <linux/sched/task_stack.h>
1819 #include <asm/io.h>
1920
2021 #include <asm/softirq_stack.h>
@@ -399,8 +400,7 @@ static inline void stack_overflow_check(struct pt_regs *regs) · 378 unmodified lines
399400 #ifdef CONFIG_DEBUG_STACKOVERFLOW
400401 #define STACK_MARGIN (256*6)
401402
402− /* Our stack starts directly behind the thread_info struct. */
403− unsigned long stack_start = (unsigned long) current_thread_info();
403+ unsigned long stack_start = (unsigned long) task_stack_page(current);
404404 unsigned long sp = regs->gr[30];
405405 unsigned long stack_usage;
406406 unsigned int *last_usage;
@@ -476,7 +476,7 @@ static void execute_on_irq_stack(void *func, unsigned long param1) · 69 unmodified lines
476476 union_ptr = &per_cpu(irq_stack_union, smp_processor_id());
477477 irq_stack = (unsigned long) &union_ptr->stack;
478478 irq_stack = ALIGN(irq_stack + sizeof(irq_stack_union.slock),
479− 64); /* align for stack frame usage */
479+ FRAME_ALIGN); /* align for stack frame usage */
480480
481481 /* We may be called recursive. If we are already using the irq stack,
482482 * just continue to use it. Use spinlocks to serialize
arch/parisc/kernel/pdt.c+1−3
@@ -352,12 +352,10 @@ static int __init pdt_initcall(void) · 351 unmodified lines
352352 if (pdt_type == PDT_NONE)
353353 return -ENODEV;
354354
355− kpdtd_task = kthread_create(pdt_mainloop, NULL, "kpdtd");
355+ kpdtd_task = kthread_run(pdt_mainloop, NULL, "kpdtd");
356356 if (IS_ERR(kpdtd_task))
357357 return PTR_ERR(kpdtd_task);
358358
359− wake_up_process(kpdtd_task);
360−
361359 return 0;
362360 }
363361
arch/parisc/kernel/process.c+2−2
@@ -205,7 +205,7 @@ copy_thread(unsigned long clone_flags, unsigned long usp, · 204 unmodified lines
205205 /* Must exit via ret_from_kernel_thread in order
206206 * to call schedule_tail()
207207 */
208− cregs->ksp = (unsigned long)stack + THREAD_SZ_ALGN + FRAME_SIZE;
208+ cregs->ksp = (unsigned long) stack + FRAME_SIZE + PT_SZ_ALGN;
209209 cregs->kpc = (unsigned long) &ret_from_kernel_thread;
210210 /*
211211 * Copy function and argument to be called from
@@ -228,7 +228,7 @@ copy_thread(unsigned long clone_flags, unsigned long usp, · 16 unmodified lines
228228 if (likely(usp))
229229 cregs->gr[30] = usp;
230230 }
231− cregs->ksp = (unsigned long)stack + THREAD_SZ_ALGN + FRAME_SIZE;
231+ cregs->ksp = (unsigned long) stack + FRAME_SIZE;
232232 cregs->kpc = (unsigned long) &child_return;
233233
234234 /* Setup thread TLS area */
arch/parisc/kernel/smp.c+21−4
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <linux/bitops.h>
3030 #include <linux/ftrace.h>
3131 #include <linux/cpu.h>
32+#include <linux/kgdb.h>
3233
3334 #include <linux/atomic.h>
3435 #include <asm/current.h>
@@ -69,7 +70,10 @@ enum ipi_message_type { · 34 unmodified lines
6970 IPI_CALL_FUNC,
7071 IPI_CPU_START,
7172 IPI_CPU_STOP,
72− IPI_CPU_TEST
73+ IPI_CPU_TEST,
74+#ifdef CONFIG_KGDB
75+ IPI_ENTER_KGDB,
76+#endif
7377 };
7478
7579
@@ -167,7 +171,12 @@ ipi_interrupt(int irq, void *dev_id) · 91 unmodified lines
167171 case IPI_CPU_TEST:
168172 smp_debug(100, KERN_DEBUG "CPU%d is alive!\n", this_cpu);
169173 break;
170−
174+#ifdef CONFIG_KGDB
175+ case IPI_ENTER_KGDB:
176+ smp_debug(100, KERN_DEBUG "CPU%d ENTER_KGDB\n", this_cpu);
177+ kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
178+ break;
179+#endif
171180 default:
172181 printk(KERN_CRIT "Unknown IPI num on CPU%d: %lu\n",
173182 this_cpu, which);
@@ -219,13 +228,21 @@ static inline void · 45 unmodified lines
219228 send_IPI_allbutself(enum ipi_message_type op)
220229 {
221230 int i;
222−
231+
232+ preempt_disable();
223233 for_each_online_cpu(i) {
224234 if (i != smp_processor_id())
225235 send_IPI_single(i, op);
226236 }
237+ preempt_enable();
227238 }
228239
240+#ifdef CONFIG_KGDB
241+void kgdb_roundup_cpus(void)
242+{
243+ send_IPI_allbutself(IPI_ENTER_KGDB);
244+}
245+#endif
229246
230247 inline void
231248 smp_send_stop(void) { send_IPI_allbutself(IPI_CPU_STOP); }
@@ -322,7 +339,7 @@ int smp_boot_one_cpu(int cpuid, struct task_struct *idle) · 90 unmodified lines
322339 const struct cpuinfo_parisc *p = &per_cpu(cpu_data, cpuid);
323340 long timeout;
324341
325− task_thread_info(idle)->cpu = cpuid;
342+ idle->cpu = cpuid;
326343
327344 /* Let _start know what logical CPU we're booting
328345 ** (offset into init_tasks[],cpu_data[])
arch/parisc/kernel/stacktrace.c+13−17
@@ -2,45 +2,41 @@ · 1 unmodified line
22 /*
33 * Stack trace management functions
44 *
5− * Copyright (C) 2009 Helge Deller <deller@gmx.de>
5+ * Copyright (C) 2009-2021 Helge Deller <deller@gmx.de>
66 * based on arch/x86/kernel/stacktrace.c by Ingo Molnar <mingo@redhat.com>
77 * and parisc unwind functions by Randolph Chung <tausq@debian.org>
88 *
99 * TODO: Userspace stacktrace (CONFIG_USER_STACKTRACE_SUPPORT)
1010 */
11−#include <linux/module.h>
1211 #include <linux/stacktrace.h>
1312
1413 #include <asm/unwind.h>
1514
16−static void dump_trace(struct task_struct *task, struct stack_trace *trace)
15+static void notrace walk_stackframe(struct task_struct *task,
16+ struct pt_regs *regs, bool (*fn)(void *, unsigned long), void *cookie)
1717 {
1818 struct unwind_frame_info info;
1919
2020 unwind_frame_init_task(&info, task, NULL);
21−
22− /* unwind stack and save entries in stack_trace struct */
23− trace->nr_entries = 0;
24− while (trace->nr_entries < trace->max_entries) {
21+ while (1) {
2522 if (unwind_once(&info) < 0 || info.ip == 0)
2623 break;
2724
2825 if (__kernel_text_address(info.ip))
29− trace->entries[trace->nr_entries++] = info.ip;
26+ if (!fn(cookie, info.ip))
27+ break;
3028 }
3129 }
3230
33−/*
34− * Save stack-backtrace addresses into a stack_trace buffer.
35− */
36−void save_stack_trace(struct stack_trace *trace)
31+void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie,
32+ struct task_struct *task, struct pt_regs *regs)
3733 {
38− dump_trace(current, trace);
34+ walk_stackframe(task, regs, consume_entry, cookie);
3935 }
40−EXPORT_SYMBOL_GPL(save_stack_trace);
4136
42−void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
37+int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry, void *cookie,
38+ struct task_struct *task)
4339 {
44− dump_trace(tsk, trace);
40+ walk_stackframe(task, NULL, consume_entry, cookie);
41+ return 1;
4542 }
46−EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
arch/parisc/kernel/sys_parisc.c+6−4
@@ -409,10 +409,12 @@ long parisc_personality(unsigned long personality) · 408 unmodified lines
409409
410410 static int FIX_O_NONBLOCK(int flags)
411411 {
412− if (flags & O_NONBLOCK_MASK_OUT) {
413− struct task_struct *tsk = current;
414− pr_warn_once("%s(%d) uses a deprecated O_NONBLOCK value.\n",
415− tsk->comm, tsk->pid);
412+ if ((flags & O_NONBLOCK_MASK_OUT) &&
413+ !test_thread_flag(TIF_NONBLOCK_WARNING)) {
414+ set_thread_flag(TIF_NONBLOCK_WARNING);
415+ pr_warn("%s(%d) uses a deprecated O_NONBLOCK value."
416+ " Please recompile with newer glibc.\n",
417+ current->comm, current->pid);
416418 }
417419 return flags & ~O_NONBLOCK_MASK_OUT;
418420 }
arch/parisc/kernel/syscall.S+10−16
@@ -78,7 +78,7 @@ ENTRY(linux_gateway_page) · 77 unmodified lines
7878
7979 lws_entry:
8080 gate lws_start, %r0 /* increase privilege */
81− depi 3, 31, 2, %r31 /* Ensure we return into user mode. */
81+ depi PRIV_USER, 31, 2, %r31 /* Ensure we return into user mode. */
8282
8383 /* Fill from 0xb8 to 0xe0 */
8484 .rept 10
@@ -89,7 +89,7 @@ lws_entry: · 4 unmodified lines
8989 mechanism to work. DO NOT MOVE THIS CODE EVER! */
9090 set_thread_pointer:
9191 gate .+8, %r0 /* increase privilege */
92− depi 3, 31, 2, %r31 /* Ensure we return into user mode. */
92+ depi PRIV_USER, 31, 2, %r31 /* Ensure we return into user mode. */
9393 be 0(%sr7,%r31) /* return to user space */
9494 mtctl %r26, %cr27 /* move arg0 to the control register */
9595
@@ -139,9 +139,9 @@ linux_gateway_entry: · 43 unmodified lines
139139 xor %r1,%r30,%r30 /* ye olde xor trick */
140140 xor %r1,%r30,%r1
141141 xor %r1,%r30,%r30
142−
143− ldo THREAD_SZ_ALGN+FRAME_SIZE(%r30),%r30 /* set up kernel stack */
144142
143+ LDREG TASK_STACK(%r30),%r30 /* set up kernel stack */
144+ ldo FRAME_SIZE(%r30),%r30
145145 /* N.B.: It is critical that we don't set sr7 to 0 until r30
146146 * contains a valid kernel stack pointer. It is also
147147 * critical that we don't start using the kernel stack
@@ -152,7 +152,6 @@ linux_gateway_entry: · 4 unmodified lines
152152 ssm PSW_SM_I, %r0 /* enable interrupts */
153153 STREGM %r1,FRAME_SIZE(%r30) /* save r1 (usp) here for now */
154154 mfctl %cr30,%r1 /* get task ptr in %r1 */
155− LDREG TI_TASK(%r1),%r1
156155
157156 /* Save some registers for sigcontext and potential task
158157 switch (see entry.S for the details of which ones are
@@ -207,7 +206,7 @@ linux_gateway_entry: · 48 unmodified lines
207206
208207 /* Are we being ptraced? */
209208 mfctl %cr30, %r1
210− LDREG TI_FLAGS(%r1),%r1
209+ LDREG TASK_TI_FLAGS(%r1),%r1
211210 ldi _TIF_SYSCALL_TRACE_MASK, %r19
212211 and,COND(=) %r1, %r19, %r0
213212 b,n .Ltracesys
@@ -272,8 +271,7 @@ tracesys: · 58 unmodified lines
272271 * C bit set, a non-straced syscall entry results in C and D clear
273272 * in the saved PSW.
274273 */
275− ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
276− LDREG TI_TASK(%r1), %r1
274+ mfctl %cr30,%r1 /* get task ptr */
277275 ssm 0,%r2
278276 STREG %r2,TASK_PT_PSW(%r1) /* Lower 8 bits only!! */
279277 mfsp %sr0,%r2
@@ -327,8 +325,7 @@ tracesys_next: · 47 unmodified lines
327325 */
328326 copy %ret0,%r20
329327
330− ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
331− LDREG TI_TASK(%r1), %r1
328+ mfctl %cr30,%r1 /* get task ptr */
332329 LDREG TASK_PT_GR28(%r1), %r28 /* Restore return value */
333330 LDREG TASK_PT_GR26(%r1), %r26 /* Restore the users args */
334331 LDREG TASK_PT_GR25(%r1), %r25
@@ -385,16 +382,14 @@ tracesys_next: · 50 unmodified lines
385382 makes a direct call to syscall_trace. */
386383
387384 tracesys_exit:
388− ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
389− LDREG TI_TASK(%r1), %r1
385+ mfctl %cr30,%r1 /* get task ptr */
390386 #ifdef CONFIG_64BIT
391387 ldo -16(%r30),%r29 /* Reference param save area */
392388 #endif
393389 ldo TASK_REGS(%r1),%r26
394390 BL do_syscall_trace_exit,%r2
395391 STREG %r28,TASK_PT_GR28(%r1) /* save return value now */
396− ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
397− LDREG TI_TASK(%r1), %r1
392+ mfctl %cr30,%r1 /* get task ptr */
398393 LDREG TASK_PT_GR28(%r1), %r28 /* Restore return val. */
399394
400395 ldil L%syscall_exit,%r1
@@ -407,8 +402,7 @@ tracesys_exit: · 6 unmodified lines
407402 ldo R%tracesys_sigexit(%r2),%r2
408403
409404 tracesys_sigexit:
410− ldo -THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r1 /* get task ptr */
411− LDREG TI_TASK(%r1), %r1
405+ mfctl %cr30,%r1 /* get task ptr */
412406 #ifdef CONFIG_64BIT
413407 ldo -16(%r30),%r29 /* Reference param save area */
414408 #endif
arch/parisc/kernel/toc.c+111−0
@@ -0,0 +1,111 @@
1+// SPDX-License-Identifier: GPL-2.0
2+
3+#include <linux/kernel.h>
4+#include <linux/kgdb.h>
5+#include <linux/printk.h>
6+#include <linux/sched/debug.h>
7+#include <linux/delay.h>
8+#include <linux/reboot.h>
9+
10+#include <asm/pdc.h>
11+#include <asm/pdc_chassis.h>
12+
13+unsigned int __aligned(16) toc_lock = 1;
14+
15+static void toc20_to_pt_regs(struct pt_regs *regs, struct pdc_toc_pim_20 *toc)
16+{
17+ int i;
18+
19+ regs->gr[0] = (unsigned long)toc->cr[22];
20+
21+ for (i = 1; i < 32; i++)
22+ regs->gr[i] = (unsigned long)toc->gr[i];
23+
24+ for (i = 0; i < 8; i++)
25+ regs->sr[i] = (unsigned long)toc->sr[i];
26+
27+ regs->iasq[0] = (unsigned long)toc->cr[17];
28+ regs->iasq[1] = (unsigned long)toc->iasq_back;
29+ regs->iaoq[0] = (unsigned long)toc->cr[18];
30+ regs->iaoq[1] = (unsigned long)toc->iaoq_back;
31+
32+ regs->sar = (unsigned long)toc->cr[11];
33+ regs->iir = (unsigned long)toc->cr[19];
34+ regs->isr = (unsigned long)toc->cr[20];
35+ regs->ior = (unsigned long)toc->cr[21];
36+}
37+
38+static void toc11_to_pt_regs(struct pt_regs *regs, struct pdc_toc_pim_11 *toc)
39+{
40+ int i;
41+
42+ regs->gr[0] = toc->cr[22];
43+
44+ for (i = 1; i < 32; i++)
45+ regs->gr[i] = toc->gr[i];
46+
47+ for (i = 0; i < 8; i++)
48+ regs->sr[i] = toc->sr[i];
49+
50+ regs->iasq[0] = toc->cr[17];
51+ regs->iasq[1] = toc->iasq_back;
52+ regs->iaoq[0] = toc->cr[18];
53+ regs->iaoq[1] = toc->iaoq_back;
54+
55+ regs->sar = toc->cr[11];
56+ regs->iir = toc->cr[19];
57+ regs->isr = toc->cr[20];
58+ regs->ior = toc->cr[21];
59+}
60+
61+void notrace __noreturn __cold toc_intr(struct pt_regs *regs)
62+{
63+ struct pdc_toc_pim_20 pim_data20;
64+ struct pdc_toc_pim_11 pim_data11;
65+
66+ nmi_enter();
67+
68+ if (boot_cpu_data.cpu_type >= pcxu) {
69+ if (pdc_pim_toc20(&pim_data20))
70+ panic("Failed to get PIM data");
71+ toc20_to_pt_regs(regs, &pim_data20);
72+ } else {
73+ if (pdc_pim_toc11(&pim_data11))
74+ panic("Failed to get PIM data");
75+ toc11_to_pt_regs(regs, &pim_data11);
76+ }
77+
78+#ifdef CONFIG_KGDB
79+ if (atomic_read(&kgdb_active) != -1)
80+ kgdb_nmicallback(raw_smp_processor_id(), regs);
81+ kgdb_handle_exception(9, SIGTRAP, 0, regs);
82+#endif
83+ show_regs(regs);
84+
85+ /* give other CPUs time to show their backtrace */
86+ mdelay(2000);
87+ machine_restart("TOC");
88+
89+ /* should never reach this */
90+ panic("TOC");
91+}
92+
93+static __init int setup_toc(void)
94+{
95+ unsigned int csum = 0;
96+ unsigned long toc_code = (unsigned long)dereference_function_descriptor(toc_handler);
97+ int i;
98+
99+ PAGE0->vec_toc = __pa(toc_code) & 0xffffffff;
100+#ifdef CONFIG_64BIT
101+ PAGE0->vec_toc_hi = __pa(toc_code) >> 32;
102+#endif
103+ PAGE0->vec_toclen = toc_handler_size;
104+
105+ for (i = 0; i < toc_handler_size/4; i++)
106+ csum += ((u32 *)toc_code)[i];
107+ toc_handler_csum = -csum;
108+ pr_info("TOC handler registered\n");
109+ return 0;
110+}
111+early_initcall(setup_toc);
arch/parisc/kernel/toc_asm.S+88−0
@@ -0,0 +1,88 @@
1+/* SPDX-License-Identifier: GPL-2.0-or-later */
2+
3+/* TOC (Transfer of Control) handler. */
4+
5+ .level 1.1
6+
7+#include <asm/assembly.h>
8+#include <asm/psw.h>
9+#include <linux/threads.h>
10+#include <linux/linkage.h>
11+
12+ .text
13+ .import toc_intr,code
14+ .import toc_lock,data
15+ .align 16
16+ENTRY_CFI(toc_handler)
17+ /*
18+ * synchronize CPUs and obtain offset
19+ * for stack setup.
20+ */
21+ load32 PA(toc_lock),%r1
22+0: ldcw,co 0(%r1),%r2
23+ cmpib,= 0,%r2,0b
24+ nop
25+ addi 1,%r2,%r4
26+ stw %r4,0(%r1)
27+ addi -1,%r2,%r4
28+
29+ load32 PA(toc_stack),%sp
30+ /*
31+ * deposit CPU number into stack address,
32+ * so every CPU will have its own stack.
33+ */
34+ SHLREG %r4,14,%r4
35+ add %r4,%sp,%sp
36+
37+ /*
38+ * setup pt_regs on stack and save the
39+ * floating point registers. PIM_TOC doesn't
40+ * save fp registers, so we're doing it here.
41+ */
42+ copy %sp,%arg0
43+ ldo PT_SZ_ALGN(%sp), %sp
44+
45+ /* clear pt_regs */
46+ copy %arg0,%r1
47+0: cmpb,<<,n %r1,%sp,0b
48+ stw,ma %r0,4(%r1)
49+
50+ ldo PT_FR0(%arg0),%r25
51+ save_fp %r25
52+
53+ /* go virtual */
54+ load32 PA(swapper_pg_dir),%r4
55+ mtctl %r4,%cr24
56+ mtctl %r4,%cr25
57+
58+ /* Clear sr4-sr7 */
59+ mtsp %r0, %sr4
60+ mtsp %r0, %sr5
61+ mtsp %r0, %sr6
62+ mtsp %r0, %sr7
63+
64+ tovirt_r1 %sp
65+ tovirt_r1 %arg0
66+ virt_map
67+
68+ loadgp
69+
70+#ifdef CONFIG_64BIT
71+ ldo -16(%sp),%r29
72+#endif
73+ load32 toc_intr,%r1
74+ be 0(%sr7,%r1)
75+ nop
76+ENDPROC_CFI(toc_handler)
77+
78+ /*
79+ * keep this checksum here, as it is part of the toc_handler
80+ * spanned by toc_handler_size (all words in toc_handler are
81+ * added in PDC and the sum must equal to zero.
82+ */
83+SYM_DATA(toc_handler_csum, .long 0)
84+SYM_DATA(toc_handler_size, .long . - toc_handler)
85+
86+ __PAGE_ALIGNED_BSS
87+ .align 64
88+SYM_DATA(toc_stack, .block 16384*NR_CPUS)
arch/parisc/kernel/traps.c+6−1
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #include <linux/ratelimit.h>
3131 #include <linux/uaccess.h>
3232 #include <linux/kdebug.h>
33+#include <linux/kfence.h>
3334
3435 #include <asm/assembly.h>
3536 #include <asm/io.h>
@@ -143,7 +144,7 @@ void show_regs(struct pt_regs *regs) · 107 unmodified lines
143144 printk("%s IIR: %08lx ISR: " RFMT " IOR: " RFMT "\n",
144145 level, regs->iir, regs->isr, regs->ior);
145146 printk("%s CPU: %8d CR30: " RFMT " CR31: " RFMT "\n",
146− level, current_thread_info()->cpu, cr30, cr31);
147+ level, task_cpu(current), cr30, cr31);
147148 printk("%s ORIG_R28: " RFMT "\n", level, regs->orig_r28);
148149
149150 if (user) {
@@ -787,6 +788,10 @@ void notrace handle_interruption(int code, struct pt_regs *regs) · 637 unmodified lines
787788 /* Clean up and return if in exception table. */
788789 if (fixup_exception(regs))
789790 return;
791+ /* Clean up and return if handled by kfence. */
792+ if (kfence_handle_page_fault(fault_address,
793+ parisc_acctyp(code, regs->iir) == VM_WRITE, regs))
794+ return;
790795 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC);
791796 parisc_terminate("Kernel Fault", regs, code, fault_address);
792797 }
arch/parisc/kernel/unwind.c+20−14
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/sched.h>
1515 #include <linux/slab.h>
1616 #include <linux/sort.h>
17+#include <linux/sched/task_stack.h>
1718
1819 #include <linux/uaccess.h>
1920 #include <asm/assembly.h>
@@ -21,6 +22,8 @@ · 1 unmodified line
2122 #include <asm/ptrace.h>
2223
2324 #include <asm/unwind.h>
25+#include <asm/switch_to.h>
26+#include <asm/sections.h>
2427
2528 /* #define DEBUG 1 */
2629 #ifdef DEBUG
@@ -203,6 +206,11 @@ int __init unwind_init(void) · 176 unmodified lines
203206 return 0;
204207 }
205208
209+static bool pc_is_kernel_fn(unsigned long pc, void *fn)
210+{
211+ return (unsigned long)dereference_kernel_function_descriptor(fn) == pc;
212+}
213+
206214 static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int frame_size)
207215 {
208216 /*
@@ -221,7 +229,7 @@ static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int · 12 unmodified lines
221229 extern void * const _call_on_stack;
222230 #endif /* CONFIG_IRQSTACKS */
223231
224− if (pc == (unsigned long) &handle_interruption) {
232+ if (pc_is_kernel_fn(pc, handle_interruption)) {
225233 struct pt_regs *regs = (struct pt_regs *)(info->sp - frame_size - PT_SZ_ALGN);
226234 dbg("Unwinding through handle_interruption()\n");
227235 info->prev_sp = regs->gr[30];
@@ -229,13 +237,13 @@ static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int · 1 unmodified line
229237 return 1;
230238 }
231239
232− if (pc == (unsigned long) &ret_from_kernel_thread ||
233− pc == (unsigned long) &syscall_exit) {
240+ if (pc_is_kernel_fn(pc, ret_from_kernel_thread) ||
241+ pc_is_kernel_fn(pc, syscall_exit)) {
234242 info->prev_sp = info->prev_ip = 0;
235243 return 1;
236244 }
237245
238− if (pc == (unsigned long) &intr_return) {
246+ if (pc_is_kernel_fn(pc, intr_return)) {
239247 struct pt_regs *regs;
240248
241249 dbg("Found intr_return()\n");
@@ -246,20 +254,20 @@ static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int · 4 unmodified lines
246254 return 1;
247255 }
248256
249− if (pc == (unsigned long) &_switch_to_ret) {
257+ if (pc_is_kernel_fn(pc, _switch_to) ||
258+ pc_is_kernel_fn(pc, _switch_to_ret)) {
250259 info->prev_sp = info->sp - CALLEE_SAVE_FRAME_SIZE;
251260 info->prev_ip = *(unsigned long *)(info->prev_sp - RP_OFFSET);
252261 return 1;
253262 }
254263
255264 #ifdef CONFIG_IRQSTACKS
256− if (pc == (unsigned long) &_call_on_stack) {
265+ if (pc_is_kernel_fn(pc, _call_on_stack)) {
257266 info->prev_sp = *(unsigned long *)(info->sp - FRAME_SIZE - REG_SZ);
258267 info->prev_ip = *(unsigned long *)(info->sp - FRAME_SIZE - RP_OFFSET);
259268 return 1;
260269 }
261270 #endif
262−
263271 return 0;
264272 }
265273
@@ -292,17 +300,15 @@ static void unwind_frame_regs(struct unwind_frame_info *info) · 26 unmodified lines
292300 info->prev_sp = sp - 64;
293301 info->prev_ip = 0;
294302
295− /* The stack is at the end inside the thread_union
296− * struct. If we reach data, we have reached the
297− * beginning of the stack and should stop unwinding. */
298− if (info->prev_sp >= (unsigned long) task_thread_info(info->t) &&
299− info->prev_sp < ((unsigned long) task_thread_info(info->t)
300− + THREAD_SZ_ALGN)) {
303+ /* Check if stack is inside kernel stack area */
304+ if ((info->prev_sp - (unsigned long) task_stack_page(info->t))
305+ >= THREAD_SIZE) {
301306 info->prev_sp = 0;
302307 break;
303308 }
304309
305− if (get_user(tmp, (unsigned long *)(info->prev_sp - RP_OFFSET)))
310+ if (copy_from_kernel_nofault(&tmp,
311+ (void *)info->prev_sp - RP_OFFSET, sizeof(tmp)))
306312 break;
307313 info->prev_ip = tmp;
308314 sp = info->prev_sp;
arch/parisc/lib/bitops.c+6−6
@@ -18,7 +18,7 @@ arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = { · 17 unmodified lines
1818 #endif
1919
2020 #ifdef CONFIG_64BIT
21−unsigned long __xchg64(unsigned long x, volatile unsigned long *ptr)
21+unsigned long notrace __xchg64(unsigned long x, volatile unsigned long *ptr)
2222 {
2323 unsigned long temp, flags;
2424
@@ -30,7 +30,7 @@ unsigned long __xchg64(unsigned long x, volatile unsigned long *ptr) · 5 unmodified lines
3030 }
3131 #endif
3232
33−unsigned long __xchg32(int x, volatile int *ptr)
33+unsigned long notrace __xchg32(int x, volatile int *ptr)
3434 {
3535 unsigned long flags;
3636 long temp;
@@ -43,7 +43,7 @@ unsigned long __xchg32(int x, volatile int *ptr) · 6 unmodified lines
4343 }
4444
4545
46−unsigned long __xchg8(char x, volatile char *ptr)
46+unsigned long notrace __xchg8(char x, volatile char *ptr)
4747 {
4848 unsigned long flags;
4949 long temp;
@@ -56,7 +56,7 @@ unsigned long __xchg8(char x, volatile char *ptr) · 6 unmodified lines
5656 }
5757
5858
59−u64 __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new)
59+u64 notrace __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new)
6060 {
6161 unsigned long flags;
6262 u64 prev;
@@ -68,7 +68,7 @@ u64 __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new) · 5 unmodified lines
6868 return prev;
6969 }
7070
71−unsigned long __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsigned int new)
71+unsigned long notrace __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsigned int new)
7272 {
7373 unsigned long flags;
7474 unsigned int prev;
@@ -80,7 +80,7 @@ unsigned long __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsign · 5 unmodified lines
8080 return (unsigned long)prev;
8181 }
8282
83−u8 __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new)
83+u8 notrace __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new)
8484 {
8585 unsigned long flags;
8686 u8 prev;
arch/parisc/mm/fault.c+1−1
@@ -48,7 +48,7 @@ int show_unhandled_signals = 1; · 47 unmodified lines
4848 * VM_WRITE if write operation
4949 * VM_EXEC if execute operation
5050 */
51−static unsigned long
51+unsigned long
5252 parisc_acctyp(unsigned long code, unsigned int inst)
5353 {
5454 if (code == 6 || code == 16)
arch/parisc/mm/fixmap.c+1−4
@@ -20,12 +20,9 @@ void notrace set_fixmap(enum fixed_addresses idx, phys_addr_t phys) · 19 unmodified lines
2020 pte_t *pte;
2121
2222 if (pmd_none(*pmd))
23− pmd = pmd_alloc(NULL, pud, vaddr);
24−
25− pte = pte_offset_kernel(pmd, vaddr);
26− if (pte_none(*pte))
2723 pte = pte_alloc_kernel(pmd, vaddr);
2824
25+ pte = pte_offset_kernel(pmd, vaddr);
2926 set_pte_at(&init_mm, vaddr, pte, __mk_pte(phys, PAGE_KERNEL_RWX));
3027 flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE);
3128 }
arch/parisc/mm/init.c+3−7
@@ -127,16 +127,12 @@ static void __init setup_bootmem(void) · 126 unmodified lines
127127 int j;
128128
129129 for (j = i; j > 0; j--) {
130− physmem_range_t tmp;
131−
132130 if (pmem_ranges[j-1].start_pfn <
133131 pmem_ranges[j].start_pfn) {
134132
135133 break;
136134 }
137− tmp = pmem_ranges[j-1];
138− pmem_ranges[j-1] = pmem_ranges[j];
139− pmem_ranges[j] = tmp;
135+ swap(pmem_ranges[j-1], pmem_ranges[j]);
140136 }
141137 }
142138
@@ -842,9 +838,9 @@ void flush_tlb_all(void) · 699 unmodified lines
842838 {
843839 int do_recycle;
844840
845− __inc_irq_stat(irq_tlb_count);
846841 do_recycle = 0;
847842 spin_lock(&sid_lock);
843+ __inc_irq_stat(irq_tlb_count);
848844 if (dirty_space_ids > RECYCLE_THRESHOLD) {
849845 BUG_ON(recycle_inuse); /* FIXME: Use a semaphore/wait queue here */
850846 get_dirty_sids(&recycle_ndirty,recycle_dirty_array);
@@ -863,8 +859,8 @@ void flush_tlb_all(void) · 12 unmodified lines
863859 #else
864860 void flush_tlb_all(void)
865861 {
866− __inc_irq_stat(irq_tlb_count);
867862 spin_lock(&sid_lock);
863+ __inc_irq_stat(irq_tlb_count);
868864 flush_tlb_all_local(NULL);
869865 recycle_sids();
870866 spin_unlock(&sid_lock);
include/linux/sched/task_stack.h+4−0
@@ -25,7 +25,11 @@ static inline void *task_stack_page(const struct task_struct *task) · 24 unmodified lines
2525
2626 static inline unsigned long *end_of_stack(const struct task_struct *task)
2727 {
28+#ifdef CONFIG_STACK_GROWSUP
29+ return (unsigned long *)((unsigned long)task->stack + THREAD_SIZE) - 1;
30+#else
2831 return task->stack;
32+#endif
2933 }
3034
3135 #elif !defined(__HAVE_THREAD_FUNCTIONS)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t