Skip to content

Commit ba22906

Browse files
committed
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
2 parents 04974df + 49fa523 commit ba22906

File tree

20 files changed

+119
-68
lines changed

20 files changed

+119
-68
lines changed

arch/sparc/configs/sparc32_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ CONFIG_INET_AH=y
2424
CONFIG_INET_ESP=y
2525
CONFIG_INET_IPCOMP=y
2626
# CONFIG_INET_LRO is not set
27-
CONFIG_IPV6_PRIVACY=y
2827
CONFIG_INET6_AH=m
2928
CONFIG_INET6_ESP=m
3029
CONFIG_INET6_IPCOMP=m

arch/sparc/configs/sparc64_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ CONFIG_SYN_COOKIES=y
4848
CONFIG_INET_AH=y
4949
CONFIG_INET_ESP=y
5050
CONFIG_INET_IPCOMP=y
51-
CONFIG_IPV6_PRIVACY=y
5251
CONFIG_IPV6_ROUTER_PREF=y
5352
CONFIG_IPV6_ROUTE_INFO=y
5453
CONFIG_IPV6_OPTIMISTIC_DAD=y

arch/sparc/include/asm/spitfire.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#define SUN4V_CHIP_SPARC_M6 0x06
4949
#define SUN4V_CHIP_SPARC_M7 0x07
5050
#define SUN4V_CHIP_SPARC64X 0x8a
51+
#define SUN4V_CHIP_SPARC_SN 0x8b
5152
#define SUN4V_CHIP_UNKNOWN 0xff
5253

5354
#ifndef __ASSEMBLY__

arch/sparc/include/uapi/asm/unistd.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,10 @@
423423
#define __NR_setsockopt 355
424424
#define __NR_mlock2 356
425425
#define __NR_copy_file_range 357
426+
#define __NR_preadv2 358
427+
#define __NR_pwritev2 359
426428

427-
#define NR_syscalls 358
429+
#define NR_syscalls 360
428430

429431
/* Bitmask values returned from kern_features system call. */
430432
#define KERN_FEATURE_MIXED_MODE_STACK 0x00000001

arch/sparc/kernel/cherrs.S

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ do_dcpe_tl1_nonfatal: /* Ok we may use interrupt globals safely. */
214214
subcc %g1, %g2, %g1 ! Next cacheline
215215
bge,pt %icc, 1b
216216
nop
217-
ba,pt %xcc, dcpe_icpe_tl1_common
218-
nop
217+
ba,a,pt %xcc, dcpe_icpe_tl1_common
219218

220219
do_dcpe_tl1_fatal:
221220
sethi %hi(1f), %g7
@@ -224,8 +223,7 @@ do_dcpe_tl1_fatal:
224223
mov 0x2, %o0
225224
call cheetah_plus_parity_error
226225
add %sp, PTREGS_OFF, %o1
227-
ba,pt %xcc, rtrap
228-
nop
226+
ba,a,pt %xcc, rtrap
229227
.size do_dcpe_tl1,.-do_dcpe_tl1
230228

231229
.globl do_icpe_tl1
@@ -259,8 +257,7 @@ do_icpe_tl1_nonfatal: /* Ok we may use interrupt globals safely. */
259257
subcc %g1, %g2, %g1
260258
bge,pt %icc, 1b
261259
nop
262-
ba,pt %xcc, dcpe_icpe_tl1_common
263-
nop
260+
ba,a,pt %xcc, dcpe_icpe_tl1_common
264261

265262
do_icpe_tl1_fatal:
266263
sethi %hi(1f), %g7
@@ -269,8 +266,7 @@ do_icpe_tl1_fatal:
269266
mov 0x3, %o0
270267
call cheetah_plus_parity_error
271268
add %sp, PTREGS_OFF, %o1
272-
ba,pt %xcc, rtrap
273-
nop
269+
ba,a,pt %xcc, rtrap
274270
.size do_icpe_tl1,.-do_icpe_tl1
275271

276272
.type dcpe_icpe_tl1_common,#function
@@ -456,7 +452,7 @@ __cheetah_log_error:
456452
cmp %g2, 0x63
457453
be c_cee
458454
nop
459-
ba,pt %xcc, c_deferred
455+
ba,a,pt %xcc, c_deferred
460456
.size __cheetah_log_error,.-__cheetah_log_error
461457

462458
/* Cheetah FECC trap handling, we get here from tl{0,1}_fecc

arch/sparc/kernel/cpu.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,12 @@ static void __init sun4v_cpu_probe(void)
506506
sparc_pmu_type = "sparc-m7";
507507
break;
508508

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+
509515
case SUN4V_CHIP_SPARC64X:
510516
sparc_cpu_type = "SPARC64-X";
511517
sparc_fpu_type = "SPARC64-X integrated FPU";

arch/sparc/kernel/cpumap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ static int iterate_cpu(struct cpuinfo_tree *t, unsigned int root_index)
328328
case SUN4V_CHIP_NIAGARA5:
329329
case SUN4V_CHIP_SPARC_M6:
330330
case SUN4V_CHIP_SPARC_M7:
331+
case SUN4V_CHIP_SPARC_SN:
331332
case SUN4V_CHIP_SPARC64X:
332333
rover_inc_table = niagara_iterate_method;
333334
break;

arch/sparc/kernel/fpu_traps.S

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ do_fpdis:
100100
fmuld %f0, %f2, %f26
101101
faddd %f0, %f2, %f28
102102
fmuld %f0, %f2, %f30
103-
b,pt %xcc, fpdis_exit
104-
nop
103+
ba,a,pt %xcc, fpdis_exit
104+
105105
2: andcc %g5, FPRS_DU, %g0
106106
bne,pt %icc, 3f
107107
fzero %f32
@@ -144,8 +144,8 @@ do_fpdis:
144144
fmuld %f32, %f34, %f58
145145
faddd %f32, %f34, %f60
146146
fmuld %f32, %f34, %f62
147-
ba,pt %xcc, fpdis_exit
148-
nop
147+
ba,a,pt %xcc, fpdis_exit
148+
149149
3: mov SECONDARY_CONTEXT, %g3
150150
add %g6, TI_FPREGS, %g1
151151

@@ -197,8 +197,7 @@ fpdis_exit2:
197197
fp_other_bounce:
198198
call do_fpother
199199
add %sp, PTREGS_OFF, %o0
200-
ba,pt %xcc, rtrap
201-
nop
200+
ba,a,pt %xcc, rtrap
202201
.size fp_other_bounce,.-fp_other_bounce
203202

204203
.align 32

arch/sparc/kernel/head_64.S

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ sun4v_chip_type:
414414
cmp %g2, 'T'
415415
be,pt %xcc, 70f
416416
cmp %g2, 'M'
417+
be,pt %xcc, 70f
418+
cmp %g2, 'S'
417419
bne,pn %xcc, 49f
418420
nop
419421

@@ -433,6 +435,9 @@ sun4v_chip_type:
433435
cmp %g2, '7'
434436
be,pt %xcc, 5f
435437
mov SUN4V_CHIP_SPARC_M7, %g4
438+
cmp %g2, 'N'
439+
be,pt %xcc, 5f
440+
mov SUN4V_CHIP_SPARC_SN, %g4
436441
ba,pt %xcc, 49f
437442
nop
438443

@@ -461,9 +466,8 @@ sun4v_chip_type:
461466
subcc %g3, 1, %g3
462467
bne,pt %xcc, 41b
463468
add %g1, 1, %g1
464-
mov SUN4V_CHIP_SPARC64X, %g4
465469
ba,pt %xcc, 5f
466-
nop
470+
mov SUN4V_CHIP_SPARC64X, %g4
467471

468472
49:
469473
mov SUN4V_CHIP_UNKNOWN, %g4
@@ -548,8 +552,7 @@ sun4u_init:
548552
stxa %g0, [%g7] ASI_DMMU
549553
membar #Sync
550554

551-
ba,pt %xcc, sun4u_continue
552-
nop
555+
ba,a,pt %xcc, sun4u_continue
553556

554557
sun4v_init:
555558
/* Set ctx 0 */
@@ -560,14 +563,12 @@ sun4v_init:
560563
mov SECONDARY_CONTEXT, %g7
561564
stxa %g0, [%g7] ASI_MMU
562565
membar #Sync
563-
ba,pt %xcc, niagara_tlb_fixup
564-
nop
566+
ba,a,pt %xcc, niagara_tlb_fixup
565567

566568
sun4u_continue:
567569
BRANCH_IF_ANY_CHEETAH(g1, g7, cheetah_tlb_fixup)
568570

569-
ba,pt %xcc, spitfire_tlb_fixup
570-
nop
571+
ba,a,pt %xcc, spitfire_tlb_fixup
571572

572573
niagara_tlb_fixup:
573574
mov 3, %g2 /* Set TLB type to hypervisor. */
@@ -595,6 +596,9 @@ niagara_tlb_fixup:
595596
be,pt %xcc, niagara4_patch
596597
nop
597598
cmp %g1, SUN4V_CHIP_SPARC_M7
599+
be,pt %xcc, niagara4_patch
600+
nop
601+
cmp %g1, SUN4V_CHIP_SPARC_SN
598602
be,pt %xcc, niagara4_patch
599603
nop
600604

@@ -639,8 +643,7 @@ niagara_patch:
639643
call hypervisor_patch_cachetlbops
640644
nop
641645

642-
ba,pt %xcc, tlb_fixup_done
643-
nop
646+
ba,a,pt %xcc, tlb_fixup_done
644647

645648
cheetah_tlb_fixup:
646649
mov 2, %g2 /* Set TLB type to cheetah+. */
@@ -659,8 +662,7 @@ cheetah_tlb_fixup:
659662
call cheetah_patch_cachetlbops
660663
nop
661664

662-
ba,pt %xcc, tlb_fixup_done
663-
nop
665+
ba,a,pt %xcc, tlb_fixup_done
664666

665667
spitfire_tlb_fixup:
666668
/* Set TLB type to spitfire. */
@@ -774,8 +776,7 @@ setup_trap_table:
774776
call %o1
775777
add %sp, (2047 + 128), %o0
776778

777-
ba,pt %xcc, 2f
778-
nop
779+
ba,a,pt %xcc, 2f
779780

780781
1: sethi %hi(sparc64_ttable_tl0), %o0
781782
set prom_set_trap_table_name, %g2
@@ -814,8 +815,7 @@ setup_trap_table:
814815

815816
BRANCH_IF_ANY_CHEETAH(o2, o3, 1f)
816817

817-
ba,pt %xcc, 2f
818-
nop
818+
ba,a,pt %xcc, 2f
819819

820820
/* Disable STICK_INT interrupts. */
821821
1:

arch/sparc/kernel/misctrap.S

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ __do_privact:
1818
109: or %g7, %lo(109b), %g7
1919
call do_privact
2020
add %sp, PTREGS_OFF, %o0
21-
ba,pt %xcc, rtrap
22-
nop
21+
ba,a,pt %xcc, rtrap
2322
.size __do_privact,.-__do_privact
2423

2524
.type do_mna,#function
@@ -46,8 +45,7 @@ do_mna:
4645
mov %l5, %o2
4746
call mem_address_unaligned
4847
add %sp, PTREGS_OFF, %o0
49-
ba,pt %xcc, rtrap
50-
nop
48+
ba,a,pt %xcc, rtrap
5149
.size do_mna,.-do_mna
5250

5351
.type do_lddfmna,#function
@@ -65,8 +63,7 @@ do_lddfmna:
6563
mov %l5, %o2
6664
call handle_lddfmna
6765
add %sp, PTREGS_OFF, %o0
68-
ba,pt %xcc, rtrap
69-
nop
66+
ba,a,pt %xcc, rtrap
7067
.size do_lddfmna,.-do_lddfmna
7168

7269
.type do_stdfmna,#function
@@ -84,8 +81,7 @@ do_stdfmna:
8481
mov %l5, %o2
8582
call handle_stdfmna
8683
add %sp, PTREGS_OFF, %o0
87-
ba,pt %xcc, rtrap
88-
nop
84+
ba,a,pt %xcc, rtrap
8985
.size do_stdfmna,.-do_stdfmna
9086

9187
.type breakpoint_trap,#function

arch/sparc/kernel/pci.c

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,18 @@ static void pci_parse_of_addrs(struct platform_device *op,
245245
}
246246
}
247247

248+
static 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+
248260
static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
249261
struct device_node *node,
250262
struct pci_bus *bus, int devfn)
@@ -259,13 +271,10 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
259271
if (!dev)
260272
return NULL;
261273

274+
op = of_find_device_by_node(node);
262275
sd = &dev->dev.archdata;
263-
sd->iommu = pbm->iommu;
264-
sd->stc = &pbm->stc;
265-
sd->host_controller = pbm;
266-
sd->op = op = of_find_device_by_node(node);
267-
sd->numa_node = pbm->numa_node;
268-
276+
pci_init_dev_archdata(sd, pbm->iommu, &pbm->stc, pbm, op,
277+
pbm->numa_node);
269278
sd = &op->dev.archdata;
270279
sd->iommu = pbm->iommu;
271280
sd->stc = &pbm->stc;
@@ -994,6 +1003,27 @@ void pcibios_set_master(struct pci_dev *dev)
9941003
/* No special bus mastering setup handling */
9951004
}
9961005

1006+
#ifdef CONFIG_PCI_IOV
1007+
int 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+
9971027
static int __init pcibios_init(void)
9981028
{
9991029
pci_dfl_cache_line_size = 64 >> 2;

arch/sparc/kernel/setup_64.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ static void __init sun4v_patch(void)
285285

286286
sun4v_patch_2insn_range(&__sun4v_2insn_patch,
287287
&__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)
289290
sun_m7_patch_2insn_range(&__sun_m7_2insn_patch,
290291
&__sun_m7_2insn_patch_end);
291292

@@ -524,6 +525,7 @@ static void __init init_sparc64_elf_hwcap(void)
524525
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
525526
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
526527
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
528+
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
527529
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
528530
cap |= HWCAP_SPARC_BLKINIT;
529531
if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2 ||
@@ -532,6 +534,7 @@ static void __init init_sparc64_elf_hwcap(void)
532534
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
533535
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
534536
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
537+
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
535538
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
536539
cap |= HWCAP_SPARC_N2;
537540
}
@@ -561,6 +564,7 @@ static void __init init_sparc64_elf_hwcap(void)
561564
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
562565
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
563566
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
567+
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
564568
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
565569
cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 |
566570
AV_SPARC_ASI_BLK_INIT |
@@ -570,6 +574,7 @@ static void __init init_sparc64_elf_hwcap(void)
570574
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
571575
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
572576
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
577+
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
573578
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
574579
cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC |
575580
AV_SPARC_FMAF);

0 commit comments

Comments
 (0)