summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-06-06 16:13:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-06-06 16:13:09 -0400
commit16d72dd4891fecc1e1bf7ca193bb7d5b9804c038 (patch)
treeba1b45b83cb5dc674f4c2f601b9fbe3a92572414
parentae8766042beee814c9e16e9ae1e84cd6eaa7ffaa (diff)
parent527a1d1ede98479bf90c31a64822107ac7e6d276 (diff)
Merge branch 'parisc-5.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc fixes from Helge Deller: - Fix crashes when accessing PCI devices on some machines like C240 and J5000. The crashes were triggered because we replaced cache flushes by nops in the alternative coding where we shouldn't for some machines. - Dave fixed a race in the usage of the sr1 space register when used to load the coherence index. - Use the hardware lpa instruction to to load the physical address of kernel virtual addresses in the iommu driver code. - The kernel may fail to link when CONFIG_MLONGCALLS isn't set. Solve that by rearranging functions in the final vmlinux executeable. - Some defconfig cleanups and removal of compiler warnings. * 'parisc-5.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix crash due alternative coding for NP iopdir_fdc bit parisc: Use lpa instruction to load physical addresses in driver code parisc: configs: Remove useless UEVENT_HELPER_PATH parisc: Use implicit space register selection for loading the coherence index of I/O pdirs parisc: Fix compiler warnings in float emulation code parisc/slab: cleanup after /proc/slab_allocators removal parisc: Allow building 64-bit kernel without -mlong-calls compiler option parisc: Kconfig: remove ARCH_DISCARD_MEMBLOCK
-rw-r--r--arch/parisc/Kconfig4
-rw-r--r--arch/parisc/configs/712_defconfig1
-rw-r--r--arch/parisc/configs/a500_defconfig1
-rw-r--r--arch/parisc/configs/b180_defconfig1
-rw-r--r--arch/parisc/configs/c3000_defconfig1
-rw-r--r--arch/parisc/configs/c8000_defconfig1
-rw-r--r--arch/parisc/configs/default_defconfig1
-rw-r--r--arch/parisc/configs/generic-32bit_defconfig1
-rw-r--r--arch/parisc/include/asm/special_insns.h24
-rw-r--r--arch/parisc/kernel/alternative.c3
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S21
-rw-r--r--arch/parisc/math-emu/cnv_float.h8
-rw-r--r--drivers/parisc/ccio-dma.c6
-rw-r--r--drivers/parisc/sba_iommu.c5
14 files changed, 50 insertions, 28 deletions
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 09407ed1aacd..4860efa91d7b 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -36,7 +36,6 @@ config PARISC
36 select GENERIC_STRNCPY_FROM_USER 36 select GENERIC_STRNCPY_FROM_USER
37 select SYSCTL_ARCH_UNALIGN_ALLOW 37 select SYSCTL_ARCH_UNALIGN_ALLOW
38 select SYSCTL_EXCEPTION_TRACE 38 select SYSCTL_EXCEPTION_TRACE
39 select ARCH_DISCARD_MEMBLOCK
40 select HAVE_MOD_ARCH_SPECIFIC 39 select HAVE_MOD_ARCH_SPECIFIC
41 select VIRT_TO_BUS 40 select VIRT_TO_BUS
42 select MODULES_USE_ELF_RELA 41 select MODULES_USE_ELF_RELA
@@ -195,7 +194,8 @@ config PREFETCH
195 194
196config MLONGCALLS 195config MLONGCALLS
197 bool "Enable the -mlong-calls compiler option for big kernels" 196 bool "Enable the -mlong-calls compiler option for big kernels"
198 default y 197 default y if !MODULES || UBSAN || FTRACE
198 default n
199 depends on PA8X00 199 depends on PA8X00
200 help 200 help
201 If you configure the kernel to include many drivers built-in instead 201 If you configure the kernel to include many drivers built-in instead
diff --git a/arch/parisc/configs/712_defconfig b/arch/parisc/configs/712_defconfig
index ccc109761f44..d3e3d94e90c3 100644
--- a/arch/parisc/configs/712_defconfig
+++ b/arch/parisc/configs/712_defconfig
@@ -34,7 +34,6 @@ CONFIG_INET_DIAG=m
34CONFIG_NETFILTER=y 34CONFIG_NETFILTER=y
35CONFIG_LLC2=m 35CONFIG_LLC2=m
36CONFIG_NET_PKTGEN=m 36CONFIG_NET_PKTGEN=m
37CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
38CONFIG_DEVTMPFS=y 37CONFIG_DEVTMPFS=y
39CONFIG_DEVTMPFS_MOUNT=y 38CONFIG_DEVTMPFS_MOUNT=y
40# CONFIG_STANDALONE is not set 39# CONFIG_STANDALONE is not set
diff --git a/arch/parisc/configs/a500_defconfig b/arch/parisc/configs/a500_defconfig
index 5acb93dcaabf..a8859496b0b9 100644
--- a/arch/parisc/configs/a500_defconfig
+++ b/arch/parisc/configs/a500_defconfig
@@ -70,7 +70,6 @@ CONFIG_IP_DCCP=m
70# CONFIG_IP_DCCP_CCID3 is not set 70# CONFIG_IP_DCCP_CCID3 is not set
71CONFIG_LLC2=m 71CONFIG_LLC2=m
72CONFIG_NET_PKTGEN=m 72CONFIG_NET_PKTGEN=m
73CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
74CONFIG_DEVTMPFS=y 73CONFIG_DEVTMPFS=y
75CONFIG_DEVTMPFS_MOUNT=y 74CONFIG_DEVTMPFS_MOUNT=y
76# CONFIG_STANDALONE is not set 75# CONFIG_STANDALONE is not set
diff --git a/arch/parisc/configs/b180_defconfig b/arch/parisc/configs/b180_defconfig
index 83ffd161aec5..0cae9664bf67 100644
--- a/arch/parisc/configs/b180_defconfig
+++ b/arch/parisc/configs/b180_defconfig
@@ -24,7 +24,6 @@ CONFIG_INET=y
24CONFIG_IP_MULTICAST=y 24CONFIG_IP_MULTICAST=y
25CONFIG_IP_PNP=y 25CONFIG_IP_PNP=y
26CONFIG_IP_PNP_BOOTP=y 26CONFIG_IP_PNP_BOOTP=y
27CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
28CONFIG_DEVTMPFS=y 27CONFIG_DEVTMPFS=y
29CONFIG_DEVTMPFS_MOUNT=y 28CONFIG_DEVTMPFS_MOUNT=y
30# CONFIG_PREVENT_FIRMWARE_BUILD is not set 29# CONFIG_PREVENT_FIRMWARE_BUILD is not set
diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig
index 8d41a73bd71b..6c29b841735c 100644
--- a/arch/parisc/configs/c3000_defconfig
+++ b/arch/parisc/configs/c3000_defconfig
@@ -32,7 +32,6 @@ CONFIG_INET6_IPCOMP=m
32CONFIG_IPV6_TUNNEL=m 32CONFIG_IPV6_TUNNEL=m
33CONFIG_NETFILTER=y 33CONFIG_NETFILTER=y
34CONFIG_NET_PKTGEN=m 34CONFIG_NET_PKTGEN=m
35CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
36CONFIG_DEVTMPFS=y 35CONFIG_DEVTMPFS=y
37CONFIG_DEVTMPFS_MOUNT=y 36CONFIG_DEVTMPFS_MOUNT=y
38# CONFIG_STANDALONE is not set 37# CONFIG_STANDALONE is not set
diff --git a/arch/parisc/configs/c8000_defconfig b/arch/parisc/configs/c8000_defconfig
index 900b00084953..507f0644fcf8 100644
--- a/arch/parisc/configs/c8000_defconfig
+++ b/arch/parisc/configs/c8000_defconfig
@@ -57,7 +57,6 @@ CONFIG_IP_DCCP=m
57CONFIG_TIPC=m 57CONFIG_TIPC=m
58CONFIG_LLC2=m 58CONFIG_LLC2=m
59CONFIG_DNS_RESOLVER=y 59CONFIG_DNS_RESOLVER=y
60CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
61CONFIG_DEVTMPFS=y 60CONFIG_DEVTMPFS=y
62CONFIG_DEVTMPFS_MOUNT=y 61CONFIG_DEVTMPFS_MOUNT=y
63# CONFIG_STANDALONE is not set 62# CONFIG_STANDALONE is not set
diff --git a/arch/parisc/configs/default_defconfig b/arch/parisc/configs/default_defconfig
index 52c9050a7c5c..6a91cc2623e8 100644
--- a/arch/parisc/configs/default_defconfig
+++ b/arch/parisc/configs/default_defconfig
@@ -44,7 +44,6 @@ CONFIG_INET6_AH=y
44CONFIG_INET6_ESP=y 44CONFIG_INET6_ESP=y
45CONFIG_INET6_IPCOMP=y 45CONFIG_INET6_IPCOMP=y
46CONFIG_LLC2=m 46CONFIG_LLC2=m
47CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
48CONFIG_DEVTMPFS=y 47CONFIG_DEVTMPFS=y
49CONFIG_DEVTMPFS_MOUNT=y 48CONFIG_DEVTMPFS_MOUNT=y
50# CONFIG_STANDALONE is not set 49# CONFIG_STANDALONE is not set
diff --git a/arch/parisc/configs/generic-32bit_defconfig b/arch/parisc/configs/generic-32bit_defconfig
index a8f9bbef0975..18b072a47a10 100644
--- a/arch/parisc/configs/generic-32bit_defconfig
+++ b/arch/parisc/configs/generic-32bit_defconfig
@@ -47,7 +47,6 @@ CONFIG_INET_ESP=m
47CONFIG_INET_DIAG=m 47CONFIG_INET_DIAG=m
48CONFIG_LLC2=m 48CONFIG_LLC2=m
49# CONFIG_WIRELESS is not set 49# CONFIG_WIRELESS is not set
50CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
51CONFIG_DEVTMPFS=y 50CONFIG_DEVTMPFS=y
52CONFIG_DEVTMPFS_MOUNT=y 51CONFIG_DEVTMPFS_MOUNT=y
53# CONFIG_STANDALONE is not set 52# CONFIG_STANDALONE is not set
diff --git a/arch/parisc/include/asm/special_insns.h b/arch/parisc/include/asm/special_insns.h
index 3d4dd68e181b..a303ae9a77f4 100644
--- a/arch/parisc/include/asm/special_insns.h
+++ b/arch/parisc/include/asm/special_insns.h
@@ -2,6 +2,30 @@
2#ifndef __PARISC_SPECIAL_INSNS_H 2#ifndef __PARISC_SPECIAL_INSNS_H
3#define __PARISC_SPECIAL_INSNS_H 3#define __PARISC_SPECIAL_INSNS_H
4 4
5#define lpa(va) ({ \
6 unsigned long pa; \
7 __asm__ __volatile__( \
8 "copy %%r0,%0\n\t" \
9 "lpa %%r0(%1),%0" \
10 : "=r" (pa) \
11 : "r" (va) \
12 : "memory" \
13 ); \
14 pa; \
15})
16
17#define lpa_user(va) ({ \
18 unsigned long pa; \
19 __asm__ __volatile__( \
20 "copy %%r0,%0\n\t" \
21 "lpa %%r0(%%sr3,%1),%0" \
22 : "=r" (pa) \
23 : "r" (va) \
24 : "memory" \
25 ); \
26 pa; \
27})
28
5#define mfctl(reg) ({ \ 29#define mfctl(reg) ({ \
6 unsigned long cr; \ 30 unsigned long cr; \
7 __asm__ __volatile__( \ 31 __asm__ __volatile__( \
diff --git a/arch/parisc/kernel/alternative.c b/arch/parisc/kernel/alternative.c
index bf2274e01a96..ca1f5ca0540a 100644
--- a/arch/parisc/kernel/alternative.c
+++ b/arch/parisc/kernel/alternative.c
@@ -56,7 +56,8 @@ void __init_or_module apply_alternatives(struct alt_instr *start,
56 * time IO-PDIR is changed in Ike/Astro. 56 * time IO-PDIR is changed in Ike/Astro.
57 */ 57 */
58 if ((cond & ALT_COND_NO_IOC_FDC) && 58 if ((cond & ALT_COND_NO_IOC_FDC) &&
59 (boot_cpu_data.pdc.capabilities & PDC_MODEL_IOPDIR_FDC)) 59 ((boot_cpu_data.cpu_type <= pcxw_) ||
60 (boot_cpu_data.pdc.capabilities & PDC_MODEL_IOPDIR_FDC)))
60 continue; 61 continue;
61 62
62 /* Want to replace pdtlb by a pdtlb,l instruction? */ 63 /* Want to replace pdtlb by a pdtlb,l instruction? */
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index c3b1b9c24ede..cd33b4feacb1 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -35,6 +35,15 @@ OUTPUT_FORMAT("elf64-hppa-linux")
35OUTPUT_ARCH(hppa:hppa2.0w) 35OUTPUT_ARCH(hppa:hppa2.0w)
36#endif 36#endif
37 37
38#define EXIT_TEXT_SECTIONS() .exit.text : { EXIT_TEXT }
39#if !defined(CONFIG_64BIT) || defined(CONFIG_MLONGCALLS)
40#define MLONGCALL_KEEP(x)
41#define MLONGCALL_DISCARD(x) x
42#else
43#define MLONGCALL_KEEP(x) x
44#define MLONGCALL_DISCARD(x)
45#endif
46
38ENTRY(parisc_kernel_start) 47ENTRY(parisc_kernel_start)
39#ifndef CONFIG_64BIT 48#ifndef CONFIG_64BIT
40jiffies = jiffies_64 + 4; 49jiffies = jiffies_64 + 4;
@@ -47,15 +56,11 @@ SECTIONS
47 56
48 __init_begin = .; 57 __init_begin = .;
49 HEAD_TEXT_SECTION 58 HEAD_TEXT_SECTION
50 INIT_TEXT_SECTION(8) 59 MLONGCALL_DISCARD(INIT_TEXT_SECTION(8))
51 60
52 . = ALIGN(PAGE_SIZE); 61 . = ALIGN(PAGE_SIZE);
53 INIT_DATA_SECTION(PAGE_SIZE) 62 INIT_DATA_SECTION(PAGE_SIZE)
54 /* we have to discard exit text and such at runtime, not link time */ 63 MLONGCALL_DISCARD(EXIT_TEXT_SECTIONS())
55 .exit.text :
56 {
57 EXIT_TEXT
58 }
59 .exit.data : 64 .exit.data :
60 { 65 {
61 EXIT_DATA 66 EXIT_DATA
@@ -73,11 +78,12 @@ SECTIONS
73 78
74 _text = .; /* Text and read-only data */ 79 _text = .; /* Text and read-only data */
75 _stext = .; 80 _stext = .;
81 MLONGCALL_KEEP(INIT_TEXT_SECTION(8))
76 .text ALIGN(PAGE_SIZE) : { 82 .text ALIGN(PAGE_SIZE) : {
77 TEXT_TEXT 83 TEXT_TEXT
84 LOCK_TEXT
78 SCHED_TEXT 85 SCHED_TEXT
79 CPUIDLE_TEXT 86 CPUIDLE_TEXT
80 LOCK_TEXT
81 KPROBES_TEXT 87 KPROBES_TEXT
82 IRQENTRY_TEXT 88 IRQENTRY_TEXT
83 SOFTIRQENTRY_TEXT 89 SOFTIRQENTRY_TEXT
@@ -92,6 +98,7 @@ SECTIONS
92 *(.lock.text) /* out-of-line lock text */ 98 *(.lock.text) /* out-of-line lock text */
93 *(.gnu.warning) 99 *(.gnu.warning)
94 } 100 }
101 MLONGCALL_KEEP(EXIT_TEXT_SECTIONS())
95 . = ALIGN(PAGE_SIZE); 102 . = ALIGN(PAGE_SIZE);
96 _etext = .; 103 _etext = .;
97 /* End of text section */ 104 /* End of text section */
diff --git a/arch/parisc/math-emu/cnv_float.h b/arch/parisc/math-emu/cnv_float.h
index bfcd834f42d0..ef783a383c5a 100644
--- a/arch/parisc/math-emu/cnv_float.h
+++ b/arch/parisc/math-emu/cnv_float.h
@@ -47,19 +47,19 @@
47 ((exponent < (SGL_P - 1)) ? \ 47 ((exponent < (SGL_P - 1)) ? \
48 (Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) : FALSE) 48 (Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) : FALSE)
49 49
50#define Int_isinexact_to_sgl(int_value) (int_value << 33 - SGL_EXP_LENGTH) 50#define Int_isinexact_to_sgl(int_value) ((int_value << 33 - SGL_EXP_LENGTH) != 0)
51 51
52#define Sgl_roundnearest_from_int(int_value,sgl_value) \ 52#define Sgl_roundnearest_from_int(int_value,sgl_value) \
53 if (int_value & 1<<(SGL_EXP_LENGTH - 2)) /* round bit */ \ 53 if (int_value & 1<<(SGL_EXP_LENGTH - 2)) /* round bit */ \
54 if ((int_value << 34 - SGL_EXP_LENGTH) || Slow(sgl_value)) \ 54 if (((int_value << 34 - SGL_EXP_LENGTH) != 0) || Slow(sgl_value)) \
55 Sall(sgl_value)++ 55 Sall(sgl_value)++
56 56
57#define Dint_isinexact_to_sgl(dint_valueA,dint_valueB) \ 57#define Dint_isinexact_to_sgl(dint_valueA,dint_valueB) \
58 ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB)) 58 (((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) != 0) || Dintp2(dint_valueB))
59 59
60#define Sgl_roundnearest_from_dint(dint_valueA,dint_valueB,sgl_value) \ 60#define Sgl_roundnearest_from_dint(dint_valueA,dint_valueB,sgl_value) \
61 if (Dintp1(dint_valueA) & 1<<(SGL_EXP_LENGTH - 2)) \ 61 if (Dintp1(dint_valueA) & 1<<(SGL_EXP_LENGTH - 2)) \
62 if ((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) || \ 62 if (((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) != 0) || \
63 Dintp2(dint_valueB) || Slow(sgl_value)) Sall(sgl_value)++ 63 Dintp2(dint_valueB) || Slow(sgl_value)) Sall(sgl_value)++
64 64
65#define Dint_isinexact_to_dbl(dint_value) \ 65#define Dint_isinexact_to_dbl(dint_value) \
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index 121f7603a595..217f15aafa4a 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -562,14 +562,12 @@ ccio_io_pdir_entry(u64 *pdir_ptr, space_t sid, unsigned long vba,
562 /* We currently only support kernel addresses */ 562 /* We currently only support kernel addresses */
563 BUG_ON(sid != KERNEL_SPACE); 563 BUG_ON(sid != KERNEL_SPACE);
564 564
565 mtsp(sid,1);
566
567 /* 565 /*
568 ** WORD 1 - low order word 566 ** WORD 1 - low order word
569 ** "hints" parm includes the VALID bit! 567 ** "hints" parm includes the VALID bit!
570 ** "dep" clobbers the physical address offset bits as well. 568 ** "dep" clobbers the physical address offset bits as well.
571 */ 569 */
572 pa = virt_to_phys(vba); 570 pa = lpa(vba);
573 asm volatile("depw %1,31,12,%0" : "+r" (pa) : "r" (hints)); 571 asm volatile("depw %1,31,12,%0" : "+r" (pa) : "r" (hints));
574 ((u32 *)pdir_ptr)[1] = (u32) pa; 572 ((u32 *)pdir_ptr)[1] = (u32) pa;
575 573
@@ -594,7 +592,7 @@ ccio_io_pdir_entry(u64 *pdir_ptr, space_t sid, unsigned long vba,
594 ** Grab virtual index [0:11] 592 ** Grab virtual index [0:11]
595 ** Deposit virt_idx bits into I/O PDIR word 593 ** Deposit virt_idx bits into I/O PDIR word
596 */ 594 */
597 asm volatile ("lci %%r0(%%sr1, %1), %0" : "=r" (ci) : "r" (vba)); 595 asm volatile ("lci %%r0(%1), %0" : "=r" (ci) : "r" (vba));
598 asm volatile ("extru %1,19,12,%0" : "+r" (ci) : "r" (ci)); 596 asm volatile ("extru %1,19,12,%0" : "+r" (ci) : "r" (ci));
599 asm volatile ("depw %1,15,12,%0" : "+r" (pa) : "r" (ci)); 597 asm volatile ("depw %1,15,12,%0" : "+r" (pa) : "r" (ci));
600 598
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 8a9ea9bd050c..296668caf7e5 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -569,11 +569,10 @@ sba_io_pdir_entry(u64 *pdir_ptr, space_t sid, unsigned long vba,
569 u64 pa; /* physical address */ 569 u64 pa; /* physical address */
570 register unsigned ci; /* coherent index */ 570 register unsigned ci; /* coherent index */
571 571
572 pa = virt_to_phys(vba); 572 pa = lpa(vba);
573 pa &= IOVP_MASK; 573 pa &= IOVP_MASK;
574 574
575 mtsp(sid,1); 575 asm("lci 0(%1), %0" : "=r" (ci) : "r" (vba));
576 asm("lci 0(%%sr1, %1), %0" : "=r" (ci) : "r" (vba));
577 pa |= (ci >> PAGE_SHIFT) & 0xff; /* move CI (8 bits) into lowest byte */ 576 pa |= (ci >> PAGE_SHIFT) & 0xff; /* move CI (8 bits) into lowest byte */
578 577
579 pa |= SBA_PDIR_VALID_BIT; /* set "valid" bit */ 578 pa |= SBA_PDIR_VALID_BIT; /* set "valid" bit */