Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.rhelver
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RHEL_MINOR = 10
#
# Use this spot to avoid future merge conflicts.
# Do not trim this comment.
RHEL_RELEASE = 553.85.1
RHEL_RELEASE = 553.87.1

#
# ZSTREAM
Expand Down
3 changes: 3 additions & 0 deletions arch/powerpc/include/asm/cputable.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,9 @@ static inline void cpu_feature_keys_init(void) { }
CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_ARCH_207S | \
CPU_FTR_ARCH_300 | CPU_FTR_PKEY | \
CPU_FTR_ARCH_31 | CPU_FTR_DAWR | CPU_FTR_DAWR1)

#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 @@ -125,6 +125,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
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/perf_event_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct power_pmu {
#define PPMU_LIMITED_PMC_REQD 2 /* have to put this on a limited PMC */
#define PPMU_ONLY_COUNT_RUN 4 /* only counting in run state */

extern int register_power_pmu(struct power_pmu *);
int __init register_power_pmu(struct power_pmu *pmu);

struct pt_regs;
extern unsigned long perf_misc_flags(struct pt_regs *regs);
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 @@ -1346,6 +1346,7 @@
#define PVR_POWER8 0x004D
#define PVR_POWER9 0x004E
#define PVR_POWER10 0x0080
#define PVR_POWER11 0x0082
#define PVR_BE 0x0070
#define PVR_PA6T 0x0090

Expand All @@ -1357,6 +1358,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
35 changes: 35 additions & 0 deletions arch/powerpc/kernel/cputable.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ extern void __restore_cpu_e6500(void);
PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | \
PPC_FEATURE2_VEC_CRYPTO)

#define COMMON_USER_POWER11 COMMON_USER_POWER10
#define COMMON_USER2_POWER11 COMMON_USER2_POWER10


#ifdef CONFIG_PPC_BOOK3E_64
#define COMMON_USER_BOOKE (COMMON_USER_PPC64 | PPC_FEATURE_BOOKE)
#else
Expand Down Expand Up @@ -393,6 +397,20 @@ static struct cpu_spec __initdata cpu_specs[] = {
.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 @@ -583,6 +601,23 @@ static struct cpu_spec __initdata cpu_specs[] = {
.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 @@ -484,6 +484,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 @@ -673,8 +681,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
29 changes: 28 additions & 1 deletion arch/powerpc/kernel/prom_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ static int __prombss mem_reserve_cnt;
static cell_t __prombss regbuf[1024];

static bool __prombss rtas_has_query_cpu_stopped;
static int __prombss enable_p11_val;


/*
Expand Down Expand Up @@ -816,6 +817,15 @@ static void __init early_cmdline_parse(void)
} else
prom_radix_disable = true;
}

opt = prom_strstr(prom_cmd_line, "enable_p11");
if (opt) {
opt += 12;
enable_p11_val = 1;
} else {
enable_p11_val = 0;
}

if (prom_radix_disable)
prom_debug("Radix disabled from cmdline\n");

Expand Down Expand Up @@ -922,7 +932,7 @@ struct option_vector6 {
} __packed;

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

u8 num_vectors;

Expand Down Expand Up @@ -979,6 +989,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 Expand Up @@ -1308,10 +1326,19 @@ static void __init prom_check_platform_support(void)
};
int prop_len = prom_getproplen(prom.chosen,
"ibm,arch-vec-5-platform-support");
int i;

/* First copy the architecture vec template */
ibm_architecture_vec = ibm_architecture_vec_template;

if (!enable_p11_val) {
for (i=0;i<16; i++) {
if ((ibm_architecture_vec.pvrs[i].val == cpu_to_be32(0x0f000007)) ||
(ibm_architecture_vec.pvrs[i].val == cpu_to_be32(0x00820000)))
ibm_architecture_vec.pvrs[i].val = 0x0;
}
}

if (prop_len > 1) {
int i;
u8 vec[prop_len];
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 @@ -389,6 +389,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
4 changes: 3 additions & 1 deletion arch/powerpc/perf/core-book3s.c
Original file line number Diff line number Diff line change
Expand Up @@ -2510,7 +2510,7 @@ static int power_pmu_prepare_cpu(unsigned int cpu)
return 0;
}

int register_power_pmu(struct power_pmu *pmu)
int __init register_power_pmu(struct power_pmu *pmu)
{
if (ppmu)
return -EBUSY; /* something's already registered */
Expand Down Expand Up @@ -2554,6 +2554,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
2 changes: 1 addition & 1 deletion arch/powerpc/perf/generic-compat-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ static struct power_pmu generic_compat_pmu = {
.attr_groups = generic_compat_pmu_attr_groups,
};

int init_generic_compat_pmu(void)
int __init init_generic_compat_pmu(void)
{
int rc = 0;

Expand Down
19 changes: 10 additions & 9 deletions arch/powerpc/perf/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
//
// Copyright 2019 Madhavan Srinivasan, IBM Corporation.

extern int init_ppc970_pmu(void);
extern int init_power5_pmu(void);
extern int init_power5p_pmu(void);
extern int init_power6_pmu(void);
extern int init_power7_pmu(void);
extern int init_power8_pmu(void);
extern int init_power9_pmu(void);
extern int init_power10_pmu(void);
extern int init_generic_compat_pmu(void);
int __init init_ppc970_pmu(void);
int __init init_power5_pmu(void);
int __init init_power5p_pmu(void);
int __init init_power6_pmu(void);
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);
29 changes: 28 additions & 1 deletion arch/powerpc/perf/power10-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ static struct power_pmu power10_pmu = {
.check_attr_config = power10_check_attr_config,
};

int init_power10_pmu(void)
int __init init_power10_pmu(void)
{
unsigned int pvr;
int rc;
Expand Down Expand Up @@ -626,3 +626,30 @@ int 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: 1 addition & 1 deletion arch/powerpc/perf/power5+-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ static struct power_pmu power5p_pmu = {
.cache_events = &power5p_cache_events,
};

int init_power5p_pmu(void)
int __init init_power5p_pmu(void)
{
if (!cur_cpu_spec->oprofile_cpu_type ||
(strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5+")
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/perf/power5-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ static struct power_pmu power5_pmu = {
.flags = PPMU_HAS_SSLOT,
};

int init_power5_pmu(void)
int __init init_power5_pmu(void)
{
if (!cur_cpu_spec->oprofile_cpu_type ||
strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5"))
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/perf/power6-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ static struct power_pmu power6_pmu = {
.cache_events = &power6_cache_events,
};

int init_power6_pmu(void)
int __init init_power6_pmu(void)
{
if (!cur_cpu_spec->oprofile_cpu_type ||
strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power6"))
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/perf/power7-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ static struct power_pmu power7_pmu = {
.cache_events = &power7_cache_events,
};

int init_power7_pmu(void)
int __init init_power7_pmu(void)
{
if (!cur_cpu_spec->oprofile_cpu_type ||
strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power7"))
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/perf/power8-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ static struct power_pmu power8_pmu = {
.bhrb_nr = 32,
};

int init_power8_pmu(void)
int __init init_power8_pmu(void)
{
int rc;

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/perf/power9-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ static struct power_pmu power9_pmu = {
.check_attr_config = power9_check_attr_config,
};

int init_power9_pmu(void)
int __init init_power9_pmu(void)
{
int rc = 0;
unsigned int pvr = mfspr(SPRN_PVR);
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/perf/ppc970-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ static struct power_pmu ppc970_pmu = {
.flags = PPMU_NO_SIPR | PPMU_NO_CONT_SAMPLING,
};

int init_ppc970_pmu(void)
int __init init_ppc970_pmu(void)
{
if (!cur_cpu_spec->oprofile_cpu_type ||
(strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/970")
Expand Down
Loading