Skip to content

Commit

Permalink
Automatic merge of 'next' into merge (2024-02-25 10:38)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpe committed Feb 24, 2024
2 parents 27441de + b22ea62 commit 84d8002
Show file tree
Hide file tree
Showing 23 changed files with 108 additions and 43 deletions.
3 changes: 3 additions & 0 deletions arch/powerpc/include/asm/cputable.h
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,9 @@ static inline void cpu_feature_keys_init(void) { }
CPU_FTR_ARCH_300 | CPU_FTR_ARCH_31 | \
CPU_FTR_DAWR | CPU_FTR_DAWR1 | \
CPU_FTR_DEXCR_NPHIE)

#define CPU_FTRS_POWER11 CPU_FTRS_POWER10

#define CPU_FTRS_CELL (CPU_FTR_LWSYNC | \
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/include/asm/mmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
#define MMU_FTRS_POWER8 MMU_FTRS_POWER6
#define MMU_FTRS_POWER9 MMU_FTRS_POWER6
#define MMU_FTRS_POWER10 MMU_FTRS_POWER6
#define MMU_FTRS_POWER11 MMU_FTRS_POWER6
#define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
MMU_FTR_CI_LARGE_PAGE
#define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/include/asm/paca.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ struct paca_struct {
u64 kstack; /* Saved Kernel stack addr */
u64 saved_r1; /* r1 save for RTAS calls or PM or EE=0 */
u64 saved_msr; /* MSR saved here by enter_rtas */
#ifdef CONFIG_PPC64
u64 exit_save_r1; /* Syscall/interrupt R1 save */
#endif
#ifdef CONFIG_PPC_BOOK3E_64
u16 trap_save; /* Used when bad stack is encountered */
#endif
Expand Down Expand Up @@ -214,8 +212,6 @@ struct paca_struct {
/* Non-maskable exceptions that are not performance critical */
u64 exnmi[EX_SIZE]; /* used for system reset (nmi) */
u64 exmc[EX_SIZE]; /* used for machine checks */
#endif
#ifdef CONFIG_PPC_BOOK3S_64
/* Exclusive stacks for system reset and machine check exception. */
void *nmi_emergency_sp;
void *mc_emergency_sp;
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,7 @@
#define PVR_HX_C2000 0x0066
#define PVR_POWER9 0x004E
#define PVR_POWER10 0x0080
#define PVR_POWER11 0x0082
#define PVR_BE 0x0070
#define PVR_PA6T 0x0090

Expand All @@ -1377,6 +1378,7 @@
#define PVR_ARCH_207 0x0f000004
#define PVR_ARCH_300 0x0f000005
#define PVR_ARCH_31 0x0f000006
#define PVR_ARCH_31_P11 0x0f000007

/* Macros for setting and retrieving special purpose registers */
#ifndef __ASSEMBLY__
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ CFLAGS_btext.o += -DDISABLE_BRANCH_PROFILING
endif

KCSAN_SANITIZE_early_32.o := n
KCSAN_SANITIZE_early_64.o := n
KCSAN_SANITIZE_cputable.o := n
KCSAN_SANITIZE_btext.o := n
KCSAN_SANITIZE_paca.o := n
Expand Down
2 changes: 0 additions & 2 deletions arch/powerpc/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,7 @@ int main(void)
OFFSET(PACAHWCPUID, paca_struct, hw_cpu_id);
OFFSET(PACAKEXECSTATE, paca_struct, kexec_state);
OFFSET(PACA_DSCR_DEFAULT, paca_struct, dscr_default);
#ifdef CONFIG_PPC64
OFFSET(PACA_EXIT_SAVE_R1, paca_struct, exit_save_r1);
#endif
#ifdef CONFIG_PPC_BOOK3E_64
OFFSET(PACA_TRAP_SAVE, paca_struct, trap_save);
#endif
Expand Down
34 changes: 34 additions & 0 deletions arch/powerpc/kernel/cpu_specs_book3s_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | \
PPC_FEATURE2_VEC_CRYPTO)

#define COMMON_USER_POWER11 COMMON_USER_POWER10
#define COMMON_USER2_POWER11 COMMON_USER2_POWER10

static struct cpu_spec cpu_specs[] __initdata = {
{ /* PPC970 */
.pvr_mask = 0xffff0000,
Expand Down Expand Up @@ -281,6 +284,20 @@ static struct cpu_spec cpu_specs[] __initdata = {
.cpu_restore = __restore_cpu_power10,
.platform = "power10",
},
{ /* 3.1-compliant processor, i.e. Power11 "architected" mode */
.pvr_mask = 0xffffffff,
.pvr_value = 0x0f000007,
.cpu_name = "Power11 (architected)",
.cpu_features = CPU_FTRS_POWER11,
.cpu_user_features = COMMON_USER_POWER11,
.cpu_user_features2 = COMMON_USER2_POWER11,
.mmu_features = MMU_FTRS_POWER11,
.icache_bsize = 128,
.dcache_bsize = 128,
.cpu_setup = __setup_cpu_power10,
.cpu_restore = __restore_cpu_power10,
.platform = "power11",
},
{ /* Power7 */
.pvr_mask = 0xffff0000,
.pvr_value = 0x003f0000,
Expand Down Expand Up @@ -451,6 +468,23 @@ static struct cpu_spec cpu_specs[] __initdata = {
.machine_check_early = __machine_check_early_realmode_p10,
.platform = "power10",
},
{ /* Power11 */
.pvr_mask = 0xffff0000,
.pvr_value = 0x00820000,
.cpu_name = "Power11 (raw)",
.cpu_features = CPU_FTRS_POWER11,
.cpu_user_features = COMMON_USER_POWER11,
.cpu_user_features2 = COMMON_USER2_POWER11,
.mmu_features = MMU_FTRS_POWER11,
.icache_bsize = 128,
.dcache_bsize = 128,
.num_pmcs = 6,
.pmc_type = PPC_PMC_IBM,
.cpu_setup = __setup_cpu_power10,
.cpu_restore = __restore_cpu_power10,
.machine_check_early = __machine_check_early_realmode_p10,
.platform = "power11",
},
{ /* Cell Broadband Engine */
.pvr_mask = 0xffff0000,
.pvr_value = 0x00700000,
Expand Down
10 changes: 10 additions & 0 deletions arch/powerpc/kernel/dt_cpu_ftrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,14 @@ static int __init feat_enable_mce_power10(struct dt_cpu_feature *f)
return 1;
}

static int __init feat_enable_mce_power11(struct dt_cpu_feature *f)
{
cur_cpu_spec->platform = "power11";
cur_cpu_spec->machine_check_early = __machine_check_early_realmode_p10;

return 1;
}

static int __init feat_enable_tm(struct dt_cpu_feature *f)
{
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
Expand Down Expand Up @@ -648,8 +656,10 @@ static struct dt_cpu_feature_match __initdata
{"pc-relative-addressing", feat_enable, 0},
{"machine-check-power9", feat_enable_mce_power9, 0},
{"machine-check-power10", feat_enable_mce_power10, 0},
{"machine-check-power11", feat_enable_mce_power11, 0},
{"performance-monitor-power9", feat_enable_pmu_power9, 0},
{"performance-monitor-power10", feat_enable_pmu_power10, 0},
{"performance-monitor-power11", feat_enable_pmu_power10, 0},
{"event-based-branch-v3", feat_enable, 0},
{"random-number-generator", feat_enable, 0},
{"system-call-vectored", feat_disable, 0},
Expand Down
10 changes: 9 additions & 1 deletion arch/powerpc/kernel/prom_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ struct option_vector7 {
} __packed;

struct ibm_arch_vec {
struct { __be32 mask, val; } pvrs[14];
struct { __be32 mask, val; } pvrs[16];

u8 num_vectors;

Expand Down Expand Up @@ -1007,6 +1007,14 @@ static const struct ibm_arch_vec ibm_architecture_vec_template __initconst = {
.mask = cpu_to_be32(0xffff0000), /* POWER10 */
.val = cpu_to_be32(0x00800000),
},
{
.mask = cpu_to_be32(0xffff0000), /* POWER11 */
.val = cpu_to_be32(0x00820000),
},
{
.mask = cpu_to_be32(0xffffffff), /* P11 compliant */
.val = cpu_to_be32(0x0f000007),
},
{
.mask = cpu_to_be32(0xffffffff), /* all 3.1-compliant */
.val = cpu_to_be32(0x0f000006),
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kvm/book3s_hv.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ static int kvmppc_set_arch_compat(struct kvm_vcpu *vcpu, u32 arch_compat)
guest_pcr_bit = PCR_ARCH_300;
break;
case PVR_ARCH_31:
case PVR_ARCH_31_P11:
guest_pcr_bit = PCR_ARCH_31;
break;
default:
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/perf/core-book3s.c
Original file line number Diff line number Diff line change
Expand Up @@ -2593,6 +2593,8 @@ static int __init init_ppc64_pmu(void)
return 0;
else if (!init_power10_pmu())
return 0;
else if (!init_power11_pmu())
return 0;
else if (!init_ppc970_pmu())
return 0;
else
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/perf/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ int __init init_power7_pmu(void);
int __init init_power8_pmu(void);
int __init init_power9_pmu(void);
int __init init_power10_pmu(void);
int __init init_power11_pmu(void);
int __init init_generic_compat_pmu(void);
27 changes: 27 additions & 0 deletions arch/powerpc/perf/power10-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,3 +634,30 @@ int __init init_power10_pmu(void)

return 0;
}

static struct power_pmu power11_pmu;

int __init init_power11_pmu(void)
{
unsigned int pvr;
int rc;

pvr = mfspr(SPRN_PVR);
if (PVR_VER(pvr) != PVR_POWER11)
return -ENODEV;

/* Set the PERF_REG_EXTENDED_MASK here */
PERF_REG_EXTENDED_MASK = PERF_REG_PMU_MASK_31;

power11_pmu = power10_pmu;
power11_pmu.name = "Power11";

rc = register_power_pmu(&power11_pmu);
if (rc)
return rc;

/* Tell userspace that EBB is supported */
cur_cpu_spec->cpu_user_features2 |= PPC_FEATURE2_EBB;

return 0;
}
2 changes: 0 additions & 2 deletions arch/powerpc/platforms/powermac/feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -2333,7 +2333,6 @@ static struct pmac_mb_def pmac_mb_defs[] = {
PMAC_TYPE_POWERMAC_G5, g5_features,
0,
},
#ifdef CONFIG_PPC64
{ "PowerMac7,3", "PowerMac G5",
PMAC_TYPE_POWERMAC_G5, g5_features,
0,
Expand All @@ -2359,7 +2358,6 @@ static struct pmac_mb_def pmac_mb_defs[] = {
0,
},
#endif /* CONFIG_PPC64 */
#endif /* CONFIG_PPC64 */
};

/*
Expand Down
2 changes: 0 additions & 2 deletions arch/powerpc/xmon/xmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,8 @@ static int xmon_core(struct pt_regs *regs, volatile int fromipi)
touch_nmi_watchdog();
} else {
cmd = 1;
#ifdef CONFIG_SMP
if (xmon_batch)
cmd = batch_cmds(regs);
#endif
if (!locked_down && cmd)
cmd = cmds(regs);
if (locked_down || cmd != 0) {
Expand Down
6 changes: 2 additions & 4 deletions drivers/macintosh/therm_windtunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,9 @@ static int therm_of_probe(struct platform_device *dev)
return -ENODEV;
}

static int
therm_of_remove( struct platform_device *dev )
static void therm_of_remove(struct platform_device *dev)
{
i2c_del_driver( &g4fan_driver );
return 0;
}

static const struct of_device_id therm_of_match[] = {{
Expand All @@ -501,7 +499,7 @@ static struct platform_driver therm_of_driver = {
.of_match_table = therm_of_match,
},
.probe = therm_of_probe,
.remove = therm_of_remove,
.remove_new = therm_of_remove,
};

struct apple_thermal_info {
Expand Down
6 changes: 2 additions & 4 deletions drivers/macintosh/windfarm_pm112.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,16 +662,14 @@ static int wf_pm112_probe(struct platform_device *dev)
return 0;
}

static int wf_pm112_remove(struct platform_device *dev)
static void wf_pm112_remove(struct platform_device *dev)
{
wf_unregister_client(&pm112_events);
/* should release all sensors and controls */
return 0;
}

static struct platform_driver wf_pm112_driver = {
.probe = wf_pm112_probe,
.remove = wf_pm112_remove,
.remove_new = wf_pm112_remove,
.driver = {
.name = "windfarm",
},
Expand Down
5 changes: 2 additions & 3 deletions drivers/macintosh/windfarm_pm121.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,15 +992,14 @@ static int pm121_probe(struct platform_device *ddev)
return 0;
}

static int pm121_remove(struct platform_device *ddev)
static void pm121_remove(struct platform_device *ddev)
{
wf_unregister_client(&pm121_events);
return 0;
}

static struct platform_driver pm121_driver = {
.probe = pm121_probe,
.remove = pm121_remove,
.remove_new = pm121_remove,
.driver = {
.name = "windfarm",
.bus = &platform_bus_type,
Expand Down
7 changes: 2 additions & 5 deletions drivers/macintosh/windfarm_pm72.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,17 +775,14 @@ static int wf_pm72_probe(struct platform_device *dev)
return 0;
}

static int wf_pm72_remove(struct platform_device *dev)
static void wf_pm72_remove(struct platform_device *dev)
{
wf_unregister_client(&pm72_events);

/* should release all sensors and controls */
return 0;
}

static struct platform_driver wf_pm72_driver = {
.probe = wf_pm72_probe,
.remove = wf_pm72_remove,
.remove_new = wf_pm72_remove,
.driver = {
.name = "windfarm",
},
Expand Down
8 changes: 3 additions & 5 deletions drivers/macintosh/windfarm_pm81.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ static int wf_smu_probe(struct platform_device *ddev)
return 0;
}

static int wf_smu_remove(struct platform_device *ddev)
static void wf_smu_remove(struct platform_device *ddev)
{
wf_unregister_client(&wf_smu_events);

Expand Down Expand Up @@ -761,13 +761,11 @@ static int wf_smu_remove(struct platform_device *ddev)
/* Destroy control loops state structures */
kfree(wf_smu_sys_fans);
kfree(wf_smu_cpu_fans);

return 0;
}

static struct platform_driver wf_smu_driver = {
.probe = wf_smu_probe,
.remove = wf_smu_remove,
.probe = wf_smu_probe,
.remove_new = wf_smu_remove,
.driver = {
.name = "windfarm",
},
Expand Down
8 changes: 3 additions & 5 deletions drivers/macintosh/windfarm_pm91.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ static int wf_smu_probe(struct platform_device *ddev)
return 0;
}

static int wf_smu_remove(struct platform_device *ddev)
static void wf_smu_remove(struct platform_device *ddev)
{
wf_unregister_client(&wf_smu_events);

Expand Down Expand Up @@ -691,13 +691,11 @@ static int wf_smu_remove(struct platform_device *ddev)
kfree(wf_smu_slots_fans);
kfree(wf_smu_drive_fans);
kfree(wf_smu_cpu_fans);

return 0;
}

static struct platform_driver wf_smu_driver = {
.probe = wf_smu_probe,
.remove = wf_smu_remove,
.probe = wf_smu_probe,
.remove_new = wf_smu_remove,
.driver = {
.name = "windfarm",
},
Expand Down
Loading

0 comments on commit 84d8002

Please sign in to comment.