Skip to content

Commit 84d8002

Browse files
committed
Automatic merge of 'next' into merge (2024-02-25 10:38)
2 parents 27441de + b22ea62 commit 84d8002

23 files changed

+108
-43
lines changed

arch/powerpc/include/asm/cputable.h

+3
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,9 @@ static inline void cpu_feature_keys_init(void) { }
454454
CPU_FTR_ARCH_300 | CPU_FTR_ARCH_31 | \
455455
CPU_FTR_DAWR | CPU_FTR_DAWR1 | \
456456
CPU_FTR_DEXCR_NPHIE)
457+
458+
#define CPU_FTRS_POWER11 CPU_FTRS_POWER10
459+
457460
#define CPU_FTRS_CELL (CPU_FTR_LWSYNC | \
458461
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
459462
CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \

arch/powerpc/include/asm/mmu.h

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
#define MMU_FTRS_POWER8 MMU_FTRS_POWER6
134134
#define MMU_FTRS_POWER9 MMU_FTRS_POWER6
135135
#define MMU_FTRS_POWER10 MMU_FTRS_POWER6
136+
#define MMU_FTRS_POWER11 MMU_FTRS_POWER6
136137
#define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
137138
MMU_FTR_CI_LARGE_PAGE
138139
#define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \

arch/powerpc/include/asm/paca.h

-4
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ struct paca_struct {
163163
u64 kstack; /* Saved Kernel stack addr */
164164
u64 saved_r1; /* r1 save for RTAS calls or PM or EE=0 */
165165
u64 saved_msr; /* MSR saved here by enter_rtas */
166-
#ifdef CONFIG_PPC64
167166
u64 exit_save_r1; /* Syscall/interrupt R1 save */
168-
#endif
169167
#ifdef CONFIG_PPC_BOOK3E_64
170168
u16 trap_save; /* Used when bad stack is encountered */
171169
#endif
@@ -214,8 +212,6 @@ struct paca_struct {
214212
/* Non-maskable exceptions that are not performance critical */
215213
u64 exnmi[EX_SIZE]; /* used for system reset (nmi) */
216214
u64 exmc[EX_SIZE]; /* used for machine checks */
217-
#endif
218-
#ifdef CONFIG_PPC_BOOK3S_64
219215
/* Exclusive stacks for system reset and machine check exception. */
220216
void *nmi_emergency_sp;
221217
void *mc_emergency_sp;

arch/powerpc/include/asm/reg.h

+2
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,7 @@
13661366
#define PVR_HX_C2000 0x0066
13671367
#define PVR_POWER9 0x004E
13681368
#define PVR_POWER10 0x0080
1369+
#define PVR_POWER11 0x0082
13691370
#define PVR_BE 0x0070
13701371
#define PVR_PA6T 0x0090
13711372

@@ -1377,6 +1378,7 @@
13771378
#define PVR_ARCH_207 0x0f000004
13781379
#define PVR_ARCH_300 0x0f000005
13791380
#define PVR_ARCH_31 0x0f000006
1381+
#define PVR_ARCH_31_P11 0x0f000007
13801382

13811383
/* Macros for setting and retrieving special purpose registers */
13821384
#ifndef __ASSEMBLY__

arch/powerpc/kernel/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ CFLAGS_btext.o += -DDISABLE_BRANCH_PROFILING
5555
endif
5656

5757
KCSAN_SANITIZE_early_32.o := n
58-
KCSAN_SANITIZE_early_64.o := n
5958
KCSAN_SANITIZE_cputable.o := n
6059
KCSAN_SANITIZE_btext.o := n
6160
KCSAN_SANITIZE_paca.o := n

arch/powerpc/kernel/asm-offsets.c

-2
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,7 @@ int main(void)
246246
OFFSET(PACAHWCPUID, paca_struct, hw_cpu_id);
247247
OFFSET(PACAKEXECSTATE, paca_struct, kexec_state);
248248
OFFSET(PACA_DSCR_DEFAULT, paca_struct, dscr_default);
249-
#ifdef CONFIG_PPC64
250249
OFFSET(PACA_EXIT_SAVE_R1, paca_struct, exit_save_r1);
251-
#endif
252250
#ifdef CONFIG_PPC_BOOK3E_64
253251
OFFSET(PACA_TRAP_SAVE, paca_struct, trap_save);
254252
#endif

arch/powerpc/kernel/cpu_specs_book3s_64.h

+34
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | \
6161
PPC_FEATURE2_VEC_CRYPTO)
6262

63+
#define COMMON_USER_POWER11 COMMON_USER_POWER10
64+
#define COMMON_USER2_POWER11 COMMON_USER2_POWER10
65+
6366
static struct cpu_spec cpu_specs[] __initdata = {
6467
{ /* PPC970 */
6568
.pvr_mask = 0xffff0000,
@@ -281,6 +284,20 @@ static struct cpu_spec cpu_specs[] __initdata = {
281284
.cpu_restore = __restore_cpu_power10,
282285
.platform = "power10",
283286
},
287+
{ /* 3.1-compliant processor, i.e. Power11 "architected" mode */
288+
.pvr_mask = 0xffffffff,
289+
.pvr_value = 0x0f000007,
290+
.cpu_name = "Power11 (architected)",
291+
.cpu_features = CPU_FTRS_POWER11,
292+
.cpu_user_features = COMMON_USER_POWER11,
293+
.cpu_user_features2 = COMMON_USER2_POWER11,
294+
.mmu_features = MMU_FTRS_POWER11,
295+
.icache_bsize = 128,
296+
.dcache_bsize = 128,
297+
.cpu_setup = __setup_cpu_power10,
298+
.cpu_restore = __restore_cpu_power10,
299+
.platform = "power11",
300+
},
284301
{ /* Power7 */
285302
.pvr_mask = 0xffff0000,
286303
.pvr_value = 0x003f0000,
@@ -451,6 +468,23 @@ static struct cpu_spec cpu_specs[] __initdata = {
451468
.machine_check_early = __machine_check_early_realmode_p10,
452469
.platform = "power10",
453470
},
471+
{ /* Power11 */
472+
.pvr_mask = 0xffff0000,
473+
.pvr_value = 0x00820000,
474+
.cpu_name = "Power11 (raw)",
475+
.cpu_features = CPU_FTRS_POWER11,
476+
.cpu_user_features = COMMON_USER_POWER11,
477+
.cpu_user_features2 = COMMON_USER2_POWER11,
478+
.mmu_features = MMU_FTRS_POWER11,
479+
.icache_bsize = 128,
480+
.dcache_bsize = 128,
481+
.num_pmcs = 6,
482+
.pmc_type = PPC_PMC_IBM,
483+
.cpu_setup = __setup_cpu_power10,
484+
.cpu_restore = __restore_cpu_power10,
485+
.machine_check_early = __machine_check_early_realmode_p10,
486+
.platform = "power11",
487+
},
454488
{ /* Cell Broadband Engine */
455489
.pvr_mask = 0xffff0000,
456490
.pvr_value = 0x00700000,

arch/powerpc/kernel/dt_cpu_ftrs.c

+10
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,14 @@ static int __init feat_enable_mce_power10(struct dt_cpu_feature *f)
458458
return 1;
459459
}
460460

461+
static int __init feat_enable_mce_power11(struct dt_cpu_feature *f)
462+
{
463+
cur_cpu_spec->platform = "power11";
464+
cur_cpu_spec->machine_check_early = __machine_check_early_realmode_p10;
465+
466+
return 1;
467+
}
468+
461469
static int __init feat_enable_tm(struct dt_cpu_feature *f)
462470
{
463471
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
@@ -648,8 +656,10 @@ static struct dt_cpu_feature_match __initdata
648656
{"pc-relative-addressing", feat_enable, 0},
649657
{"machine-check-power9", feat_enable_mce_power9, 0},
650658
{"machine-check-power10", feat_enable_mce_power10, 0},
659+
{"machine-check-power11", feat_enable_mce_power11, 0},
651660
{"performance-monitor-power9", feat_enable_pmu_power9, 0},
652661
{"performance-monitor-power10", feat_enable_pmu_power10, 0},
662+
{"performance-monitor-power11", feat_enable_pmu_power10, 0},
653663
{"event-based-branch-v3", feat_enable, 0},
654664
{"random-number-generator", feat_enable, 0},
655665
{"system-call-vectored", feat_disable, 0},

arch/powerpc/kernel/prom_init.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ struct option_vector7 {
947947
} __packed;
948948

949949
struct ibm_arch_vec {
950-
struct { __be32 mask, val; } pvrs[14];
950+
struct { __be32 mask, val; } pvrs[16];
951951

952952
u8 num_vectors;
953953

@@ -1007,6 +1007,14 @@ static const struct ibm_arch_vec ibm_architecture_vec_template __initconst = {
10071007
.mask = cpu_to_be32(0xffff0000), /* POWER10 */
10081008
.val = cpu_to_be32(0x00800000),
10091009
},
1010+
{
1011+
.mask = cpu_to_be32(0xffff0000), /* POWER11 */
1012+
.val = cpu_to_be32(0x00820000),
1013+
},
1014+
{
1015+
.mask = cpu_to_be32(0xffffffff), /* P11 compliant */
1016+
.val = cpu_to_be32(0x0f000007),
1017+
},
10101018
{
10111019
.mask = cpu_to_be32(0xffffffff), /* all 3.1-compliant */
10121020
.val = cpu_to_be32(0x0f000006),

arch/powerpc/kvm/book3s_hv.c

+1
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ static int kvmppc_set_arch_compat(struct kvm_vcpu *vcpu, u32 arch_compat)
444444
guest_pcr_bit = PCR_ARCH_300;
445445
break;
446446
case PVR_ARCH_31:
447+
case PVR_ARCH_31_P11:
447448
guest_pcr_bit = PCR_ARCH_31;
448449
break;
449450
default:

arch/powerpc/perf/core-book3s.c

+2
Original file line numberDiff line numberDiff line change
@@ -2593,6 +2593,8 @@ static int __init init_ppc64_pmu(void)
25932593
return 0;
25942594
else if (!init_power10_pmu())
25952595
return 0;
2596+
else if (!init_power11_pmu())
2597+
return 0;
25962598
else if (!init_ppc970_pmu())
25972599
return 0;
25982600
else

arch/powerpc/perf/internal.h

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ int __init init_power7_pmu(void);
1010
int __init init_power8_pmu(void);
1111
int __init init_power9_pmu(void);
1212
int __init init_power10_pmu(void);
13+
int __init init_power11_pmu(void);
1314
int __init init_generic_compat_pmu(void);

arch/powerpc/perf/power10-pmu.c

+27
Original file line numberDiff line numberDiff line change
@@ -634,3 +634,30 @@ int __init init_power10_pmu(void)
634634

635635
return 0;
636636
}
637+
638+
static struct power_pmu power11_pmu;
639+
640+
int __init init_power11_pmu(void)
641+
{
642+
unsigned int pvr;
643+
int rc;
644+
645+
pvr = mfspr(SPRN_PVR);
646+
if (PVR_VER(pvr) != PVR_POWER11)
647+
return -ENODEV;
648+
649+
/* Set the PERF_REG_EXTENDED_MASK here */
650+
PERF_REG_EXTENDED_MASK = PERF_REG_PMU_MASK_31;
651+
652+
power11_pmu = power10_pmu;
653+
power11_pmu.name = "Power11";
654+
655+
rc = register_power_pmu(&power11_pmu);
656+
if (rc)
657+
return rc;
658+
659+
/* Tell userspace that EBB is supported */
660+
cur_cpu_spec->cpu_user_features2 |= PPC_FEATURE2_EBB;
661+
662+
return 0;
663+
}

arch/powerpc/platforms/powermac/feature.c

-2
Original file line numberDiff line numberDiff line change
@@ -2333,7 +2333,6 @@ static struct pmac_mb_def pmac_mb_defs[] = {
23332333
PMAC_TYPE_POWERMAC_G5, g5_features,
23342334
0,
23352335
},
2336-
#ifdef CONFIG_PPC64
23372336
{ "PowerMac7,3", "PowerMac G5",
23382337
PMAC_TYPE_POWERMAC_G5, g5_features,
23392338
0,
@@ -2359,7 +2358,6 @@ static struct pmac_mb_def pmac_mb_defs[] = {
23592358
0,
23602359
},
23612360
#endif /* CONFIG_PPC64 */
2362-
#endif /* CONFIG_PPC64 */
23632361
};
23642362

23652363
/*

arch/powerpc/xmon/xmon.c

-2
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,8 @@ static int xmon_core(struct pt_regs *regs, volatile int fromipi)
643643
touch_nmi_watchdog();
644644
} else {
645645
cmd = 1;
646-
#ifdef CONFIG_SMP
647646
if (xmon_batch)
648647
cmd = batch_cmds(regs);
649-
#endif
650648
if (!locked_down && cmd)
651649
cmd = cmds(regs);
652650
if (locked_down || cmd != 0) {

drivers/macintosh/therm_windtunnel.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -481,11 +481,9 @@ static int therm_of_probe(struct platform_device *dev)
481481
return -ENODEV;
482482
}
483483

484-
static int
485-
therm_of_remove( struct platform_device *dev )
484+
static void therm_of_remove(struct platform_device *dev)
486485
{
487486
i2c_del_driver( &g4fan_driver );
488-
return 0;
489487
}
490488

491489
static const struct of_device_id therm_of_match[] = {{
@@ -501,7 +499,7 @@ static struct platform_driver therm_of_driver = {
501499
.of_match_table = therm_of_match,
502500
},
503501
.probe = therm_of_probe,
504-
.remove = therm_of_remove,
502+
.remove_new = therm_of_remove,
505503
};
506504

507505
struct apple_thermal_info {

drivers/macintosh/windfarm_pm112.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -662,16 +662,14 @@ static int wf_pm112_probe(struct platform_device *dev)
662662
return 0;
663663
}
664664

665-
static int wf_pm112_remove(struct platform_device *dev)
665+
static void wf_pm112_remove(struct platform_device *dev)
666666
{
667667
wf_unregister_client(&pm112_events);
668-
/* should release all sensors and controls */
669-
return 0;
670668
}
671669

672670
static struct platform_driver wf_pm112_driver = {
673671
.probe = wf_pm112_probe,
674-
.remove = wf_pm112_remove,
672+
.remove_new = wf_pm112_remove,
675673
.driver = {
676674
.name = "windfarm",
677675
},

drivers/macintosh/windfarm_pm121.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -992,15 +992,14 @@ static int pm121_probe(struct platform_device *ddev)
992992
return 0;
993993
}
994994

995-
static int pm121_remove(struct platform_device *ddev)
995+
static void pm121_remove(struct platform_device *ddev)
996996
{
997997
wf_unregister_client(&pm121_events);
998-
return 0;
999998
}
1000999

10011000
static struct platform_driver pm121_driver = {
10021001
.probe = pm121_probe,
1003-
.remove = pm121_remove,
1002+
.remove_new = pm121_remove,
10041003
.driver = {
10051004
.name = "windfarm",
10061005
.bus = &platform_bus_type,

drivers/macintosh/windfarm_pm72.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -775,17 +775,14 @@ static int wf_pm72_probe(struct platform_device *dev)
775775
return 0;
776776
}
777777

778-
static int wf_pm72_remove(struct platform_device *dev)
778+
static void wf_pm72_remove(struct platform_device *dev)
779779
{
780780
wf_unregister_client(&pm72_events);
781-
782-
/* should release all sensors and controls */
783-
return 0;
784781
}
785782

786783
static struct platform_driver wf_pm72_driver = {
787784
.probe = wf_pm72_probe,
788-
.remove = wf_pm72_remove,
785+
.remove_new = wf_pm72_remove,
789786
.driver = {
790787
.name = "windfarm",
791788
},

drivers/macintosh/windfarm_pm81.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ static int wf_smu_probe(struct platform_device *ddev)
724724
return 0;
725725
}
726726

727-
static int wf_smu_remove(struct platform_device *ddev)
727+
static void wf_smu_remove(struct platform_device *ddev)
728728
{
729729
wf_unregister_client(&wf_smu_events);
730730

@@ -761,13 +761,11 @@ static int wf_smu_remove(struct platform_device *ddev)
761761
/* Destroy control loops state structures */
762762
kfree(wf_smu_sys_fans);
763763
kfree(wf_smu_cpu_fans);
764-
765-
return 0;
766764
}
767765

768766
static struct platform_driver wf_smu_driver = {
769-
.probe = wf_smu_probe,
770-
.remove = wf_smu_remove,
767+
.probe = wf_smu_probe,
768+
.remove_new = wf_smu_remove,
771769
.driver = {
772770
.name = "windfarm",
773771
},

drivers/macintosh/windfarm_pm91.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ static int wf_smu_probe(struct platform_device *ddev)
647647
return 0;
648648
}
649649

650-
static int wf_smu_remove(struct platform_device *ddev)
650+
static void wf_smu_remove(struct platform_device *ddev)
651651
{
652652
wf_unregister_client(&wf_smu_events);
653653

@@ -691,13 +691,11 @@ static int wf_smu_remove(struct platform_device *ddev)
691691
kfree(wf_smu_slots_fans);
692692
kfree(wf_smu_drive_fans);
693693
kfree(wf_smu_cpu_fans);
694-
695-
return 0;
696694
}
697695

698696
static struct platform_driver wf_smu_driver = {
699-
.probe = wf_smu_probe,
700-
.remove = wf_smu_remove,
697+
.probe = wf_smu_probe,
698+
.remove_new = wf_smu_remove,
701699
.driver = {
702700
.name = "windfarm",
703701
},

0 commit comments

Comments
 (0)