aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-02 12:32:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-02 12:32:50 -0400
commitba22906a9fdb197b10e3e062dc8c438efb7ea6f6 (patch)
treefa827a48cbbb27f29545c227ab565632a4e6fd2a
parent04974df8049fc4240d22759a91e035082ccd18b4 (diff)
parent49fa5230462f9f2c4e97c81356473a6bdf06c422 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc fixes from David Miller: 1) Fix panics with SR-IOV, from Babu Moger. 2) Wire up preadv2/pwritev2. 3) Allow proper auto-loading of VIO devices, from John Paul Adrian Glaubitz. 4) Recognize Sonoma cpus, from Khalid Aziz. 5) Fix bootup regressions caused by syscall trace fixes made recently. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc64: Fix bootup regressions on some Kconfig combinations. sparc64: recognize and support Sonoma CPU type sparc: Implement and wire up vio_hotplug for vio. sparc: Implement and wire up modalias_show for vio. sparc/pci: Refactor dev_archdata initialization into pci_init_dev_archdata sparc/defconfigs: Remove CONFIG_IPV6_PRIVACY sparc: Write up preadv2/pwritev2 syscalls. sparc/PCI: Fix for panic while enabling SR-IOV
-rw-r--r--arch/sparc/configs/sparc32_defconfig1
-rw-r--r--arch/sparc/configs/sparc64_defconfig1
-rw-r--r--arch/sparc/include/asm/spitfire.h1
-rw-r--r--arch/sparc/include/uapi/asm/unistd.h4
-rw-r--r--arch/sparc/kernel/cherrs.S14
-rw-r--r--arch/sparc/kernel/cpu.c6
-rw-r--r--arch/sparc/kernel/cpumap.c1
-rw-r--r--arch/sparc/kernel/fpu_traps.S11
-rw-r--r--arch/sparc/kernel/head_64.S32
-rw-r--r--arch/sparc/kernel/misctrap.S12
-rw-r--r--arch/sparc/kernel/pci.c42
-rw-r--r--arch/sparc/kernel/setup_64.c7
-rw-r--r--arch/sparc/kernel/spiterrs.S18
-rw-r--r--arch/sparc/kernel/systbls_32.S2
-rw-r--r--arch/sparc/kernel/systbls_64.S4
-rw-r--r--arch/sparc/kernel/utrap.S3
-rw-r--r--arch/sparc/kernel/vio.c18
-rw-r--r--arch/sparc/kernel/vmlinux.lds.S4
-rw-r--r--arch/sparc/kernel/winfixup.S3
-rw-r--r--arch/sparc/mm/init_64.c3
20 files changed, 119 insertions, 68 deletions
diff --git a/arch/sparc/configs/sparc32_defconfig b/arch/sparc/configs/sparc32_defconfig
index fb23fd6b186a..c74d3701ad68 100644
--- a/arch/sparc/configs/sparc32_defconfig
+++ b/arch/sparc/configs/sparc32_defconfig
@@ -24,7 +24,6 @@ CONFIG_INET_AH=y
24CONFIG_INET_ESP=y 24CONFIG_INET_ESP=y
25CONFIG_INET_IPCOMP=y 25CONFIG_INET_IPCOMP=y
26# CONFIG_INET_LRO is not set 26# CONFIG_INET_LRO is not set
27CONFIG_IPV6_PRIVACY=y
28CONFIG_INET6_AH=m 27CONFIG_INET6_AH=m
29CONFIG_INET6_ESP=m 28CONFIG_INET6_ESP=m
30CONFIG_INET6_IPCOMP=m 29CONFIG_INET6_IPCOMP=m
diff --git a/arch/sparc/configs/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig
index 04920ab8e292..3583d676a916 100644
--- a/arch/sparc/configs/sparc64_defconfig
+++ b/arch/sparc/configs/sparc64_defconfig
@@ -48,7 +48,6 @@ CONFIG_SYN_COOKIES=y
48CONFIG_INET_AH=y 48CONFIG_INET_AH=y
49CONFIG_INET_ESP=y 49CONFIG_INET_ESP=y
50CONFIG_INET_IPCOMP=y 50CONFIG_INET_IPCOMP=y
51CONFIG_IPV6_PRIVACY=y
52CONFIG_IPV6_ROUTER_PREF=y 51CONFIG_IPV6_ROUTER_PREF=y
53CONFIG_IPV6_ROUTE_INFO=y 52CONFIG_IPV6_ROUTE_INFO=y
54CONFIG_IPV6_OPTIMISTIC_DAD=y 53CONFIG_IPV6_OPTIMISTIC_DAD=y
diff --git a/arch/sparc/include/asm/spitfire.h b/arch/sparc/include/asm/spitfire.h
index 56f933816144..1d8321c827a8 100644
--- a/arch/sparc/include/asm/spitfire.h
+++ b/arch/sparc/include/asm/spitfire.h
@@ -48,6 +48,7 @@
48#define SUN4V_CHIP_SPARC_M6 0x06 48#define SUN4V_CHIP_SPARC_M6 0x06
49#define SUN4V_CHIP_SPARC_M7 0x07 49#define SUN4V_CHIP_SPARC_M7 0x07
50#define SUN4V_CHIP_SPARC64X 0x8a 50#define SUN4V_CHIP_SPARC64X 0x8a
51#define SUN4V_CHIP_SPARC_SN 0x8b
51#define SUN4V_CHIP_UNKNOWN 0xff 52#define SUN4V_CHIP_UNKNOWN 0xff
52 53
53#ifndef __ASSEMBLY__ 54#ifndef __ASSEMBLY__
diff --git a/arch/sparc/include/uapi/asm/unistd.h b/arch/sparc/include/uapi/asm/unistd.h
index b6de8b10a55b..36eee8132c22 100644
--- a/arch/sparc/include/uapi/asm/unistd.h
+++ b/arch/sparc/include/uapi/asm/unistd.h
@@ -423,8 +423,10 @@
423#define __NR_setsockopt 355 423#define __NR_setsockopt 355
424#define __NR_mlock2 356 424#define __NR_mlock2 356
425#define __NR_copy_file_range 357 425#define __NR_copy_file_range 357
426#define __NR_preadv2 358
427#define __NR_pwritev2 359
426 428
427#define NR_syscalls 358 429#define NR_syscalls 360
428 430
429/* Bitmask values returned from kern_features system call. */ 431/* Bitmask values returned from kern_features system call. */
430#define KERN_FEATURE_MIXED_MODE_STACK 0x00000001 432#define KERN_FEATURE_MIXED_MODE_STACK 0x00000001
diff --git a/arch/sparc/kernel/cherrs.S b/arch/sparc/kernel/cherrs.S
index 4ee1ad420862..655628def68e 100644
--- a/arch/sparc/kernel/cherrs.S
+++ b/arch/sparc/kernel/cherrs.S
@@ -214,8 +214,7 @@ do_dcpe_tl1_nonfatal: /* Ok we may use interrupt globals safely. */
214 subcc %g1, %g2, %g1 ! Next cacheline 214 subcc %g1, %g2, %g1 ! Next cacheline
215 bge,pt %icc, 1b 215 bge,pt %icc, 1b
216 nop 216 nop
217 ba,pt %xcc, dcpe_icpe_tl1_common 217 ba,a,pt %xcc, dcpe_icpe_tl1_common
218 nop
219 218
220do_dcpe_tl1_fatal: 219do_dcpe_tl1_fatal:
221 sethi %hi(1f), %g7 220 sethi %hi(1f), %g7
@@ -224,8 +223,7 @@ do_dcpe_tl1_fatal:
224 mov 0x2, %o0 223 mov 0x2, %o0
225 call cheetah_plus_parity_error 224 call cheetah_plus_parity_error
226 add %sp, PTREGS_OFF, %o1 225 add %sp, PTREGS_OFF, %o1
227 ba,pt %xcc, rtrap 226 ba,a,pt %xcc, rtrap
228 nop
229 .size do_dcpe_tl1,.-do_dcpe_tl1 227 .size do_dcpe_tl1,.-do_dcpe_tl1
230 228
231 .globl do_icpe_tl1 229 .globl do_icpe_tl1
@@ -259,8 +257,7 @@ do_icpe_tl1_nonfatal: /* Ok we may use interrupt globals safely. */
259 subcc %g1, %g2, %g1 257 subcc %g1, %g2, %g1
260 bge,pt %icc, 1b 258 bge,pt %icc, 1b
261 nop 259 nop
262 ba,pt %xcc, dcpe_icpe_tl1_common 260 ba,a,pt %xcc, dcpe_icpe_tl1_common
263 nop
264 261
265do_icpe_tl1_fatal: 262do_icpe_tl1_fatal:
266 sethi %hi(1f), %g7 263 sethi %hi(1f), %g7
@@ -269,8 +266,7 @@ do_icpe_tl1_fatal:
269 mov 0x3, %o0 266 mov 0x3, %o0
270 call cheetah_plus_parity_error 267 call cheetah_plus_parity_error
271 add %sp, PTREGS_OFF, %o1 268 add %sp, PTREGS_OFF, %o1
272 ba,pt %xcc, rtrap 269 ba,a,pt %xcc, rtrap
273 nop
274 .size do_icpe_tl1,.-do_icpe_tl1 270 .size do_icpe_tl1,.-do_icpe_tl1
275 271
276 .type dcpe_icpe_tl1_common,#function 272 .type dcpe_icpe_tl1_common,#function
@@ -456,7 +452,7 @@ __cheetah_log_error:
456 cmp %g2, 0x63 452 cmp %g2, 0x63
457 be c_cee 453 be c_cee
458 nop 454 nop
459 ba,pt %xcc, c_deferred 455 ba,a,pt %xcc, c_deferred
460 .size __cheetah_log_error,.-__cheetah_log_error 456 .size __cheetah_log_error,.-__cheetah_log_error
461 457
462 /* Cheetah FECC trap handling, we get here from tl{0,1}_fecc 458 /* Cheetah FECC trap handling, we get here from tl{0,1}_fecc
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
index dfad8b1aea9f..493e023a468a 100644
--- a/arch/sparc/kernel/cpu.c
+++ b/arch/sparc/kernel/cpu.c
@@ -506,6 +506,12 @@ static void __init sun4v_cpu_probe(void)
506 sparc_pmu_type = "sparc-m7"; 506 sparc_pmu_type = "sparc-m7";
507 break; 507 break;
508 508
509 case SUN4V_CHIP_SPARC_SN:
510 sparc_cpu_type = "SPARC-SN";
511 sparc_fpu_type = "SPARC-SN integrated FPU";
512 sparc_pmu_type = "sparc-sn";
513 break;
514
509 case SUN4V_CHIP_SPARC64X: 515 case SUN4V_CHIP_SPARC64X:
510 sparc_cpu_type = "SPARC64-X"; 516 sparc_cpu_type = "SPARC64-X";
511 sparc_fpu_type = "SPARC64-X integrated FPU"; 517 sparc_fpu_type = "SPARC64-X integrated FPU";
diff --git a/arch/sparc/kernel/cpumap.c b/arch/sparc/kernel/cpumap.c
index e69ec0e3f155..45c820e1cba5 100644
--- a/arch/sparc/kernel/cpumap.c
+++ b/arch/sparc/kernel/cpumap.c
@@ -328,6 +328,7 @@ static int iterate_cpu(struct cpuinfo_tree *t, unsigned int root_index)
328 case SUN4V_CHIP_NIAGARA5: 328 case SUN4V_CHIP_NIAGARA5:
329 case SUN4V_CHIP_SPARC_M6: 329 case SUN4V_CHIP_SPARC_M6:
330 case SUN4V_CHIP_SPARC_M7: 330 case SUN4V_CHIP_SPARC_M7:
331 case SUN4V_CHIP_SPARC_SN:
331 case SUN4V_CHIP_SPARC64X: 332 case SUN4V_CHIP_SPARC64X:
332 rover_inc_table = niagara_iterate_method; 333 rover_inc_table = niagara_iterate_method;
333 break; 334 break;
diff --git a/arch/sparc/kernel/fpu_traps.S b/arch/sparc/kernel/fpu_traps.S
index a6864826a4bd..336d2750fe78 100644
--- a/arch/sparc/kernel/fpu_traps.S
+++ b/arch/sparc/kernel/fpu_traps.S
@@ -100,8 +100,8 @@ do_fpdis:
100 fmuld %f0, %f2, %f26 100 fmuld %f0, %f2, %f26
101 faddd %f0, %f2, %f28 101 faddd %f0, %f2, %f28
102 fmuld %f0, %f2, %f30 102 fmuld %f0, %f2, %f30
103 b,pt %xcc, fpdis_exit 103 ba,a,pt %xcc, fpdis_exit
104 nop 104
1052: andcc %g5, FPRS_DU, %g0 1052: andcc %g5, FPRS_DU, %g0
106 bne,pt %icc, 3f 106 bne,pt %icc, 3f
107 fzero %f32 107 fzero %f32
@@ -144,8 +144,8 @@ do_fpdis:
144 fmuld %f32, %f34, %f58 144 fmuld %f32, %f34, %f58
145 faddd %f32, %f34, %f60 145 faddd %f32, %f34, %f60
146 fmuld %f32, %f34, %f62 146 fmuld %f32, %f34, %f62
147 ba,pt %xcc, fpdis_exit 147 ba,a,pt %xcc, fpdis_exit
148 nop 148
1493: mov SECONDARY_CONTEXT, %g3 1493: mov SECONDARY_CONTEXT, %g3
150 add %g6, TI_FPREGS, %g1 150 add %g6, TI_FPREGS, %g1
151 151
@@ -197,8 +197,7 @@ fpdis_exit2:
197fp_other_bounce: 197fp_other_bounce:
198 call do_fpother 198 call do_fpother
199 add %sp, PTREGS_OFF, %o0 199 add %sp, PTREGS_OFF, %o0
200 ba,pt %xcc, rtrap 200 ba,a,pt %xcc, rtrap
201 nop
202 .size fp_other_bounce,.-fp_other_bounce 201 .size fp_other_bounce,.-fp_other_bounce
203 202
204 .align 32 203 .align 32
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S
index cd1f592cd347..a076b4249e62 100644
--- a/arch/sparc/kernel/head_64.S
+++ b/arch/sparc/kernel/head_64.S
@@ -414,6 +414,8 @@ sun4v_chip_type:
414 cmp %g2, 'T' 414 cmp %g2, 'T'
415 be,pt %xcc, 70f 415 be,pt %xcc, 70f
416 cmp %g2, 'M' 416 cmp %g2, 'M'
417 be,pt %xcc, 70f
418 cmp %g2, 'S'
417 bne,pn %xcc, 49f 419 bne,pn %xcc, 49f
418 nop 420 nop
419 421
@@ -433,6 +435,9 @@ sun4v_chip_type:
433 cmp %g2, '7' 435 cmp %g2, '7'
434 be,pt %xcc, 5f 436 be,pt %xcc, 5f
435 mov SUN4V_CHIP_SPARC_M7, %g4 437 mov SUN4V_CHIP_SPARC_M7, %g4
438 cmp %g2, 'N'
439 be,pt %xcc, 5f
440 mov SUN4V_CHIP_SPARC_SN, %g4
436 ba,pt %xcc, 49f 441 ba,pt %xcc, 49f
437 nop 442 nop
438 443
@@ -461,9 +466,8 @@ sun4v_chip_type:
461 subcc %g3, 1, %g3 466 subcc %g3, 1, %g3
462 bne,pt %xcc, 41b 467 bne,pt %xcc, 41b
463 add %g1, 1, %g1 468 add %g1, 1, %g1
464 mov SUN4V_CHIP_SPARC64X, %g4
465 ba,pt %xcc, 5f 469 ba,pt %xcc, 5f
466 nop 470 mov SUN4V_CHIP_SPARC64X, %g4
467 471
46849: 47249:
469 mov SUN4V_CHIP_UNKNOWN, %g4 473 mov SUN4V_CHIP_UNKNOWN, %g4
@@ -548,8 +552,7 @@ sun4u_init:
548 stxa %g0, [%g7] ASI_DMMU 552 stxa %g0, [%g7] ASI_DMMU
549 membar #Sync 553 membar #Sync
550 554
551 ba,pt %xcc, sun4u_continue 555 ba,a,pt %xcc, sun4u_continue
552 nop
553 556
554sun4v_init: 557sun4v_init:
555 /* Set ctx 0 */ 558 /* Set ctx 0 */
@@ -560,14 +563,12 @@ sun4v_init:
560 mov SECONDARY_CONTEXT, %g7 563 mov SECONDARY_CONTEXT, %g7
561 stxa %g0, [%g7] ASI_MMU 564 stxa %g0, [%g7] ASI_MMU
562 membar #Sync 565 membar #Sync
563 ba,pt %xcc, niagara_tlb_fixup 566 ba,a,pt %xcc, niagara_tlb_fixup
564 nop
565 567
566sun4u_continue: 568sun4u_continue:
567 BRANCH_IF_ANY_CHEETAH(g1, g7, cheetah_tlb_fixup) 569 BRANCH_IF_ANY_CHEETAH(g1, g7, cheetah_tlb_fixup)
568 570
569 ba,pt %xcc, spitfire_tlb_fixup 571 ba,a,pt %xcc, spitfire_tlb_fixup
570 nop
571 572
572niagara_tlb_fixup: 573niagara_tlb_fixup:
573 mov 3, %g2 /* Set TLB type to hypervisor. */ 574 mov 3, %g2 /* Set TLB type to hypervisor. */
@@ -597,6 +598,9 @@ niagara_tlb_fixup:
597 cmp %g1, SUN4V_CHIP_SPARC_M7 598 cmp %g1, SUN4V_CHIP_SPARC_M7
598 be,pt %xcc, niagara4_patch 599 be,pt %xcc, niagara4_patch
599 nop 600 nop
601 cmp %g1, SUN4V_CHIP_SPARC_SN
602 be,pt %xcc, niagara4_patch
603 nop
600 604
601 call generic_patch_copyops 605 call generic_patch_copyops
602 nop 606 nop
@@ -639,8 +643,7 @@ niagara_patch:
639 call hypervisor_patch_cachetlbops 643 call hypervisor_patch_cachetlbops
640 nop 644 nop
641 645
642 ba,pt %xcc, tlb_fixup_done 646 ba,a,pt %xcc, tlb_fixup_done
643 nop
644 647
645cheetah_tlb_fixup: 648cheetah_tlb_fixup:
646 mov 2, %g2 /* Set TLB type to cheetah+. */ 649 mov 2, %g2 /* Set TLB type to cheetah+. */
@@ -659,8 +662,7 @@ cheetah_tlb_fixup:
659 call cheetah_patch_cachetlbops 662 call cheetah_patch_cachetlbops
660 nop 663 nop
661 664
662 ba,pt %xcc, tlb_fixup_done 665 ba,a,pt %xcc, tlb_fixup_done
663 nop
664 666
665spitfire_tlb_fixup: 667spitfire_tlb_fixup:
666 /* Set TLB type to spitfire. */ 668 /* Set TLB type to spitfire. */
@@ -774,8 +776,7 @@ setup_trap_table:
774 call %o1 776 call %o1
775 add %sp, (2047 + 128), %o0 777 add %sp, (2047 + 128), %o0
776 778
777 ba,pt %xcc, 2f 779 ba,a,pt %xcc, 2f
778 nop
779 780
7801: sethi %hi(sparc64_ttable_tl0), %o0 7811: sethi %hi(sparc64_ttable_tl0), %o0
781 set prom_set_trap_table_name, %g2 782 set prom_set_trap_table_name, %g2
@@ -814,8 +815,7 @@ setup_trap_table:
814 815
815 BRANCH_IF_ANY_CHEETAH(o2, o3, 1f) 816 BRANCH_IF_ANY_CHEETAH(o2, o3, 1f)
816 817
817 ba,pt %xcc, 2f 818 ba,a,pt %xcc, 2f
818 nop
819 819
820 /* Disable STICK_INT interrupts. */ 820 /* Disable STICK_INT interrupts. */
8211: 8211:
diff --git a/arch/sparc/kernel/misctrap.S b/arch/sparc/kernel/misctrap.S
index 753b4f031bfb..34b4933900bf 100644
--- a/arch/sparc/kernel/misctrap.S
+++ b/arch/sparc/kernel/misctrap.S
@@ -18,8 +18,7 @@ __do_privact:
18109: or %g7, %lo(109b), %g7 18109: or %g7, %lo(109b), %g7
19 call do_privact 19 call do_privact
20 add %sp, PTREGS_OFF, %o0 20 add %sp, PTREGS_OFF, %o0
21 ba,pt %xcc, rtrap 21 ba,a,pt %xcc, rtrap
22 nop
23 .size __do_privact,.-__do_privact 22 .size __do_privact,.-__do_privact
24 23
25 .type do_mna,#function 24 .type do_mna,#function
@@ -46,8 +45,7 @@ do_mna:
46 mov %l5, %o2 45 mov %l5, %o2
47 call mem_address_unaligned 46 call mem_address_unaligned
48 add %sp, PTREGS_OFF, %o0 47 add %sp, PTREGS_OFF, %o0
49 ba,pt %xcc, rtrap 48 ba,a,pt %xcc, rtrap
50 nop
51 .size do_mna,.-do_mna 49 .size do_mna,.-do_mna
52 50
53 .type do_lddfmna,#function 51 .type do_lddfmna,#function
@@ -65,8 +63,7 @@ do_lddfmna:
65 mov %l5, %o2 63 mov %l5, %o2
66 call handle_lddfmna 64 call handle_lddfmna
67 add %sp, PTREGS_OFF, %o0 65 add %sp, PTREGS_OFF, %o0
68 ba,pt %xcc, rtrap 66 ba,a,pt %xcc, rtrap
69 nop
70 .size do_lddfmna,.-do_lddfmna 67 .size do_lddfmna,.-do_lddfmna
71 68
72 .type do_stdfmna,#function 69 .type do_stdfmna,#function
@@ -84,8 +81,7 @@ do_stdfmna:
84 mov %l5, %o2 81 mov %l5, %o2
85 call handle_stdfmna 82 call handle_stdfmna
86 add %sp, PTREGS_OFF, %o0 83 add %sp, PTREGS_OFF, %o0
87 ba,pt %xcc, rtrap 84 ba,a,pt %xcc, rtrap
88 nop
89 .size do_stdfmna,.-do_stdfmna 85 .size do_stdfmna,.-do_stdfmna
90 86
91 .type breakpoint_trap,#function 87 .type breakpoint_trap,#function
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index badf0951d73c..c2b202d763a1 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -245,6 +245,18 @@ static void pci_parse_of_addrs(struct platform_device *op,
245 } 245 }
246} 246}
247 247
248static void pci_init_dev_archdata(struct dev_archdata *sd, void *iommu,
249 void *stc, void *host_controller,
250 struct platform_device *op,
251 int numa_node)
252{
253 sd->iommu = iommu;
254 sd->stc = stc;
255 sd->host_controller = host_controller;
256 sd->op = op;
257 sd->numa_node = numa_node;
258}
259
248static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, 260static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
249 struct device_node *node, 261 struct device_node *node,
250 struct pci_bus *bus, int devfn) 262 struct pci_bus *bus, int devfn)
@@ -259,13 +271,10 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
259 if (!dev) 271 if (!dev)
260 return NULL; 272 return NULL;
261 273
274 op = of_find_device_by_node(node);
262 sd = &dev->dev.archdata; 275 sd = &dev->dev.archdata;
263 sd->iommu = pbm->iommu; 276 pci_init_dev_archdata(sd, pbm->iommu, &pbm->stc, pbm, op,
264 sd->stc = &pbm->stc; 277 pbm->numa_node);
265 sd->host_controller = pbm;
266 sd->op = op = of_find_device_by_node(node);
267 sd->numa_node = pbm->numa_node;
268
269 sd = &op->dev.archdata; 278 sd = &op->dev.archdata;
270 sd->iommu = pbm->iommu; 279 sd->iommu = pbm->iommu;
271 sd->stc = &pbm->stc; 280 sd->stc = &pbm->stc;
@@ -994,6 +1003,27 @@ void pcibios_set_master(struct pci_dev *dev)
994 /* No special bus mastering setup handling */ 1003 /* No special bus mastering setup handling */
995} 1004}
996 1005
1006#ifdef CONFIG_PCI_IOV
1007int pcibios_add_device(struct pci_dev *dev)
1008{
1009 struct pci_dev *pdev;
1010
1011 /* Add sriov arch specific initialization here.
1012 * Copy dev_archdata from PF to VF
1013 */
1014 if (dev->is_virtfn) {
1015 struct dev_archdata *psd;
1016
1017 pdev = dev->physfn;
1018 psd = &pdev->dev.archdata;
1019 pci_init_dev_archdata(&dev->dev.archdata, psd->iommu,
1020 psd->stc, psd->host_controller, NULL,
1021 psd->numa_node);
1022 }
1023 return 0;
1024}
1025#endif /* CONFIG_PCI_IOV */
1026
997static int __init pcibios_init(void) 1027static int __init pcibios_init(void)
998{ 1028{
999 pci_dfl_cache_line_size = 64 >> 2; 1029 pci_dfl_cache_line_size = 64 >> 2;
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index 26db95b54ee9..599f1207eed2 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -285,7 +285,8 @@ static void __init sun4v_patch(void)
285 285
286 sun4v_patch_2insn_range(&__sun4v_2insn_patch, 286 sun4v_patch_2insn_range(&__sun4v_2insn_patch,
287 &__sun4v_2insn_patch_end); 287 &__sun4v_2insn_patch_end);
288 if (sun4v_chip_type == SUN4V_CHIP_SPARC_M7) 288 if (sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
289 sun4v_chip_type == SUN4V_CHIP_SPARC_SN)
289 sun_m7_patch_2insn_range(&__sun_m7_2insn_patch, 290 sun_m7_patch_2insn_range(&__sun_m7_2insn_patch,
290 &__sun_m7_2insn_patch_end); 291 &__sun_m7_2insn_patch_end);
291 292
@@ -524,6 +525,7 @@ static void __init init_sparc64_elf_hwcap(void)
524 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || 525 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
525 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || 526 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
526 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || 527 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
528 sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
527 sun4v_chip_type == SUN4V_CHIP_SPARC64X) 529 sun4v_chip_type == SUN4V_CHIP_SPARC64X)
528 cap |= HWCAP_SPARC_BLKINIT; 530 cap |= HWCAP_SPARC_BLKINIT;
529 if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2 || 531 if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2 ||
@@ -532,6 +534,7 @@ static void __init init_sparc64_elf_hwcap(void)
532 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || 534 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
533 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || 535 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
534 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || 536 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
537 sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
535 sun4v_chip_type == SUN4V_CHIP_SPARC64X) 538 sun4v_chip_type == SUN4V_CHIP_SPARC64X)
536 cap |= HWCAP_SPARC_N2; 539 cap |= HWCAP_SPARC_N2;
537 } 540 }
@@ -561,6 +564,7 @@ static void __init init_sparc64_elf_hwcap(void)
561 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || 564 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
562 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || 565 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
563 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || 566 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
567 sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
564 sun4v_chip_type == SUN4V_CHIP_SPARC64X) 568 sun4v_chip_type == SUN4V_CHIP_SPARC64X)
565 cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 | 569 cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 |
566 AV_SPARC_ASI_BLK_INIT | 570 AV_SPARC_ASI_BLK_INIT |
@@ -570,6 +574,7 @@ static void __init init_sparc64_elf_hwcap(void)
570 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 || 574 sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
571 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 || 575 sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
572 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 || 576 sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
577 sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
573 sun4v_chip_type == SUN4V_CHIP_SPARC64X) 578 sun4v_chip_type == SUN4V_CHIP_SPARC64X)
574 cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC | 579 cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC |
575 AV_SPARC_FMAF); 580 AV_SPARC_FMAF);
diff --git a/arch/sparc/kernel/spiterrs.S b/arch/sparc/kernel/spiterrs.S
index c357e40ffd01..4a73009f66a5 100644
--- a/arch/sparc/kernel/spiterrs.S
+++ b/arch/sparc/kernel/spiterrs.S
@@ -85,8 +85,7 @@ __spitfire_cee_trap_continue:
85 ba,pt %xcc, etraptl1 85 ba,pt %xcc, etraptl1
86 rd %pc, %g7 86 rd %pc, %g7
87 87
88 ba,pt %xcc, 2f 88 ba,a,pt %xcc, 2f
89 nop
90 89
911: ba,pt %xcc, etrap_irq 901: ba,pt %xcc, etrap_irq
92 rd %pc, %g7 91 rd %pc, %g7
@@ -100,8 +99,7 @@ __spitfire_cee_trap_continue:
100 mov %l5, %o2 99 mov %l5, %o2
101 call spitfire_access_error 100 call spitfire_access_error
102 add %sp, PTREGS_OFF, %o0 101 add %sp, PTREGS_OFF, %o0
103 ba,pt %xcc, rtrap 102 ba,a,pt %xcc, rtrap
104 nop
105 .size __spitfire_access_error,.-__spitfire_access_error 103 .size __spitfire_access_error,.-__spitfire_access_error
106 104
107 /* This is the trap handler entry point for ECC correctable 105 /* This is the trap handler entry point for ECC correctable
@@ -179,8 +177,7 @@ __spitfire_data_access_exception_tl1:
179 mov %l5, %o2 177 mov %l5, %o2
180 call spitfire_data_access_exception_tl1 178 call spitfire_data_access_exception_tl1
181 add %sp, PTREGS_OFF, %o0 179 add %sp, PTREGS_OFF, %o0
182 ba,pt %xcc, rtrap 180 ba,a,pt %xcc, rtrap
183 nop
184 .size __spitfire_data_access_exception_tl1,.-__spitfire_data_access_exception_tl1 181 .size __spitfire_data_access_exception_tl1,.-__spitfire_data_access_exception_tl1
185 182
186 .type __spitfire_data_access_exception,#function 183 .type __spitfire_data_access_exception,#function
@@ -200,8 +197,7 @@ __spitfire_data_access_exception:
200 mov %l5, %o2 197 mov %l5, %o2
201 call spitfire_data_access_exception 198 call spitfire_data_access_exception
202 add %sp, PTREGS_OFF, %o0 199 add %sp, PTREGS_OFF, %o0
203 ba,pt %xcc, rtrap 200 ba,a,pt %xcc, rtrap
204 nop
205 .size __spitfire_data_access_exception,.-__spitfire_data_access_exception 201 .size __spitfire_data_access_exception,.-__spitfire_data_access_exception
206 202
207 .type __spitfire_insn_access_exception_tl1,#function 203 .type __spitfire_insn_access_exception_tl1,#function
@@ -220,8 +216,7 @@ __spitfire_insn_access_exception_tl1:
220 mov %l5, %o2 216 mov %l5, %o2
221 call spitfire_insn_access_exception_tl1 217 call spitfire_insn_access_exception_tl1
222 add %sp, PTREGS_OFF, %o0 218 add %sp, PTREGS_OFF, %o0
223 ba,pt %xcc, rtrap 219 ba,a,pt %xcc, rtrap
224 nop
225 .size __spitfire_insn_access_exception_tl1,.-__spitfire_insn_access_exception_tl1 220 .size __spitfire_insn_access_exception_tl1,.-__spitfire_insn_access_exception_tl1
226 221
227 .type __spitfire_insn_access_exception,#function 222 .type __spitfire_insn_access_exception,#function
@@ -240,6 +235,5 @@ __spitfire_insn_access_exception:
240 mov %l5, %o2 235 mov %l5, %o2
241 call spitfire_insn_access_exception 236 call spitfire_insn_access_exception
242 add %sp, PTREGS_OFF, %o0 237 add %sp, PTREGS_OFF, %o0
243 ba,pt %xcc, rtrap 238 ba,a,pt %xcc, rtrap
244 nop
245 .size __spitfire_insn_access_exception,.-__spitfire_insn_access_exception 239 .size __spitfire_insn_access_exception,.-__spitfire_insn_access_exception
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S
index 6c3dd6c52f8b..eac7f0db5c8c 100644
--- a/arch/sparc/kernel/systbls_32.S
+++ b/arch/sparc/kernel/systbls_32.S
@@ -88,4 +88,4 @@ sys_call_table:
88/*340*/ .long sys_ni_syscall, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr 88/*340*/ .long sys_ni_syscall, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
89/*345*/ .long sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf 89/*345*/ .long sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf
90/*350*/ .long sys_execveat, sys_membarrier, sys_userfaultfd, sys_bind, sys_listen 90/*350*/ .long sys_execveat, sys_membarrier, sys_userfaultfd, sys_bind, sys_listen
91/*355*/ .long sys_setsockopt, sys_mlock2, sys_copy_file_range 91/*355*/ .long sys_setsockopt, sys_mlock2, sys_copy_file_range, sys_preadv2, sys_pwritev2
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S
index 12b524cfcfa0..b0f17ff2ddba 100644
--- a/arch/sparc/kernel/systbls_64.S
+++ b/arch/sparc/kernel/systbls_64.S
@@ -89,7 +89,7 @@ sys_call_table32:
89/*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr 89/*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
90 .word sys32_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf 90 .word sys32_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf
91/*350*/ .word sys32_execveat, sys_membarrier, sys_userfaultfd, sys_bind, sys_listen 91/*350*/ .word sys32_execveat, sys_membarrier, sys_userfaultfd, sys_bind, sys_listen
92 .word compat_sys_setsockopt, sys_mlock2, sys_copy_file_range 92 .word compat_sys_setsockopt, sys_mlock2, sys_copy_file_range, compat_sys_preadv2, compat_sys_pwritev2
93 93
94#endif /* CONFIG_COMPAT */ 94#endif /* CONFIG_COMPAT */
95 95
@@ -170,4 +170,4 @@ sys_call_table:
170/*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr 170/*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
171 .word sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf 171 .word sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf
172/*350*/ .word sys64_execveat, sys_membarrier, sys_userfaultfd, sys_bind, sys_listen 172/*350*/ .word sys64_execveat, sys_membarrier, sys_userfaultfd, sys_bind, sys_listen
173 .word sys_setsockopt, sys_mlock2, sys_copy_file_range 173 .word sys_setsockopt, sys_mlock2, sys_copy_file_range, sys_preadv2, sys_pwritev2
diff --git a/arch/sparc/kernel/utrap.S b/arch/sparc/kernel/utrap.S
index b7f0f3f3a909..c731e8023d3e 100644
--- a/arch/sparc/kernel/utrap.S
+++ b/arch/sparc/kernel/utrap.S
@@ -11,8 +11,7 @@ utrap_trap: /* %g3=handler,%g4=level */
11 mov %l4, %o1 11 mov %l4, %o1
12 call bad_trap 12 call bad_trap
13 add %sp, PTREGS_OFF, %o0 13 add %sp, PTREGS_OFF, %o0
14 ba,pt %xcc, rtrap 14 ba,a,pt %xcc, rtrap
15 nop
16 15
17invoke_utrap: 16invoke_utrap:
18 sllx %g3, 3, %g3 17 sllx %g3, 3, %g3
diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index cb5789c9f961..f6bb857254fc 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -45,6 +45,14 @@ static const struct vio_device_id *vio_match_device(
45 return NULL; 45 return NULL;
46} 46}
47 47
48static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
49{
50 const struct vio_dev *vio_dev = to_vio_dev(dev);
51
52 add_uevent_var(env, "MODALIAS=vio:T%sS%s", vio_dev->type, vio_dev->compat);
53 return 0;
54}
55
48static int vio_bus_match(struct device *dev, struct device_driver *drv) 56static int vio_bus_match(struct device *dev, struct device_driver *drv)
49{ 57{
50 struct vio_dev *vio_dev = to_vio_dev(dev); 58 struct vio_dev *vio_dev = to_vio_dev(dev);
@@ -105,15 +113,25 @@ static ssize_t type_show(struct device *dev,
105 return sprintf(buf, "%s\n", vdev->type); 113 return sprintf(buf, "%s\n", vdev->type);
106} 114}
107 115
116static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
117 char *buf)
118{
119 const struct vio_dev *vdev = to_vio_dev(dev);
120
121 return sprintf(buf, "vio:T%sS%s\n", vdev->type, vdev->compat);
122}
123
108static struct device_attribute vio_dev_attrs[] = { 124static struct device_attribute vio_dev_attrs[] = {
109 __ATTR_RO(devspec), 125 __ATTR_RO(devspec),
110 __ATTR_RO(type), 126 __ATTR_RO(type),
127 __ATTR_RO(modalias),
111 __ATTR_NULL 128 __ATTR_NULL
112}; 129};
113 130
114static struct bus_type vio_bus_type = { 131static struct bus_type vio_bus_type = {
115 .name = "vio", 132 .name = "vio",
116 .dev_attrs = vio_dev_attrs, 133 .dev_attrs = vio_dev_attrs,
134 .uevent = vio_hotplug,
117 .match = vio_bus_match, 135 .match = vio_bus_match,
118 .probe = vio_device_probe, 136 .probe = vio_device_probe,
119 .remove = vio_device_remove, 137 .remove = vio_device_remove,
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index aadd321aa05d..7d02b1fef025 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -33,6 +33,10 @@ ENTRY(_start)
33jiffies = jiffies_64; 33jiffies = jiffies_64;
34#endif 34#endif
35 35
36#ifdef CONFIG_SPARC64
37ASSERT((swapper_tsb == 0x0000000000408000), "Error: sparc64 early assembler too large")
38#endif
39
36SECTIONS 40SECTIONS
37{ 41{
38#ifdef CONFIG_SPARC64 42#ifdef CONFIG_SPARC64
diff --git a/arch/sparc/kernel/winfixup.S b/arch/sparc/kernel/winfixup.S
index 1e67ce958369..855019a8590e 100644
--- a/arch/sparc/kernel/winfixup.S
+++ b/arch/sparc/kernel/winfixup.S
@@ -32,8 +32,7 @@ fill_fixup:
32 rd %pc, %g7 32 rd %pc, %g7
33 call do_sparc64_fault 33 call do_sparc64_fault
34 add %sp, PTREGS_OFF, %o0 34 add %sp, PTREGS_OFF, %o0
35 ba,pt %xcc, rtrap 35 ba,a,pt %xcc, rtrap
36 nop
37 36
38 /* Be very careful about usage of the trap globals here. 37 /* Be very careful about usage of the trap globals here.
39 * You cannot touch %g5 as that has the fault information. 38 * You cannot touch %g5 as that has the fault information.
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 1cfe6aab7a11..09e838801e39 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -1769,6 +1769,7 @@ static void __init setup_page_offset(void)
1769 max_phys_bits = 47; 1769 max_phys_bits = 47;
1770 break; 1770 break;
1771 case SUN4V_CHIP_SPARC_M7: 1771 case SUN4V_CHIP_SPARC_M7:
1772 case SUN4V_CHIP_SPARC_SN:
1772 default: 1773 default:
1773 /* M7 and later support 52-bit virtual addresses. */ 1774 /* M7 and later support 52-bit virtual addresses. */
1774 sparc64_va_hole_top = 0xfff8000000000000UL; 1775 sparc64_va_hole_top = 0xfff8000000000000UL;
@@ -1986,6 +1987,7 @@ static void __init sun4v_linear_pte_xor_finalize(void)
1986 */ 1987 */
1987 switch (sun4v_chip_type) { 1988 switch (sun4v_chip_type) {
1988 case SUN4V_CHIP_SPARC_M7: 1989 case SUN4V_CHIP_SPARC_M7:
1990 case SUN4V_CHIP_SPARC_SN:
1989 pagecv_flag = 0x00; 1991 pagecv_flag = 0x00;
1990 break; 1992 break;
1991 default: 1993 default:
@@ -2138,6 +2140,7 @@ void __init paging_init(void)
2138 */ 2140 */
2139 switch (sun4v_chip_type) { 2141 switch (sun4v_chip_type) {
2140 case SUN4V_CHIP_SPARC_M7: 2142 case SUN4V_CHIP_SPARC_M7:
2143 case SUN4V_CHIP_SPARC_SN:
2141 page_cache4v_flag = _PAGE_CP_4V; 2144 page_cache4v_flag = _PAGE_CP_4V;
2142 break; 2145 break;
2143 default: 2146 default: