* [PATCH v2] powerpc: Add POWER10 raw mode cputable entry
@ 2020-08-14 7:45 Madhavan Srinivasan
2020-08-14 9:14 ` Christophe Leroy
0 siblings, 1 reply; 2+ messages in thread
From: Madhavan Srinivasan @ 2020-08-14 7:45 UTC (permalink / raw)
To: mpe; +Cc: Madhavan Srinivasan, linuxppc-dev
Add a raw mode cputable entry for POWER10. Copies most of the fields
from commit a3ea40d5c736 ("powerpc: Add POWER10 architected mode")
except for oprofile_cpu_type, machine_check_early, pvr_mask and pvr_mask
fields. On bare metal systems we use DT CPU features, which doesn't need a
cputable entry. But in VMs we still rely on the raw cputable entry to
set the correct values for the PMU related fields.
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
Changelog v1:
- Fixed function undeclared compiler error.
arch/powerpc/kernel/cputable.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index b4066354f0730..bb0c7f43a8283 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -75,6 +75,7 @@ extern void __restore_cpu_power10(void);
extern long __machine_check_early_realmode_p7(struct pt_regs *regs);
extern long __machine_check_early_realmode_p8(struct pt_regs *regs);
extern long __machine_check_early_realmode_p9(struct pt_regs *regs);
+extern long __machine_check_early_realmode_p10(struct pt_regs *regs);
#endif /* CONFIG_PPC64 */
#if defined(CONFIG_E500)
extern void __setup_cpu_e5500(unsigned long offset, struct cpu_spec* spec);
@@ -541,6 +542,25 @@ static struct cpu_spec __initdata cpu_specs[] = {
.machine_check_early = __machine_check_early_realmode_p9,
.platform = "power9",
},
+ { /* Power10 */
+ .pvr_mask = 0xffff0000,
+ .pvr_value = 0x00800000,
+ .cpu_name = "POWER10 (raw)",
+ .cpu_features = CPU_FTRS_POWER10,
+ .cpu_user_features = COMMON_USER_POWER10,
+ .cpu_user_features2 = COMMON_USER2_POWER10,
+ .mmu_features = MMU_FTRS_POWER10,
+ .icache_bsize = 128,
+ .dcache_bsize = 128,
+ .num_pmcs = 6,
+ .pmc_type = PPC_PMC_IBM,
+ .oprofile_cpu_type = "ppc64/power10",
+ .oprofile_type = PPC_OPROFILE_INVALID,
+ .cpu_setup = __setup_cpu_power10,
+ .cpu_restore = __restore_cpu_power10,
+ .machine_check_early = __machine_check_early_realmode_p10,
+ .platform = "power10",
+ },
{ /* Cell Broadband Engine */
.pvr_mask = 0xffff0000,
.pvr_value = 0x00700000,
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] powerpc: Add POWER10 raw mode cputable entry
2020-08-14 7:45 [PATCH v2] powerpc: Add POWER10 raw mode cputable entry Madhavan Srinivasan
@ 2020-08-14 9:14 ` Christophe Leroy
0 siblings, 0 replies; 2+ messages in thread
From: Christophe Leroy @ 2020-08-14 9:14 UTC (permalink / raw)
To: Madhavan Srinivasan, mpe; +Cc: linuxppc-dev
Le 14/08/2020 à 09:45, Madhavan Srinivasan a écrit :
> Add a raw mode cputable entry for POWER10. Copies most of the fields
> from commit a3ea40d5c736 ("powerpc: Add POWER10 architected mode")
> except for oprofile_cpu_type, machine_check_early, pvr_mask and pvr_mask
> fields. On bare metal systems we use DT CPU features, which doesn't need a
> cputable entry. But in VMs we still rely on the raw cputable entry to
> set the correct values for the PMU related fields.
>
> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
> ---
> Changelog v1:
> - Fixed function undeclared compiler error.
>
> arch/powerpc/kernel/cputable.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
> index b4066354f0730..bb0c7f43a8283 100644
> --- a/arch/powerpc/kernel/cputable.c
> +++ b/arch/powerpc/kernel/cputable.c
> @@ -75,6 +75,7 @@ extern void __restore_cpu_power10(void);
> extern long __machine_check_early_realmode_p7(struct pt_regs *regs);
> extern long __machine_check_early_realmode_p8(struct pt_regs *regs);
> extern long __machine_check_early_realmode_p9(struct pt_regs *regs);
> +extern long __machine_check_early_realmode_p10(struct pt_regs *regs);
'extern' keyword is useless and deprecated for function declaration.
Please don't add new prototypes with that keyword.
Also, when you check arch/powerpc/kernel/mce_power.o with sparse, you
get the following issues:
CHECK arch/powerpc/kernel/mce_power.c
arch/powerpc/kernel/mce_power.c:709:6: warning: symbol
'__machine_check_early_realmode_p7' was not declared. Should it be static?
arch/powerpc/kernel/mce_power.c:717:6: warning: symbol
'__machine_check_early_realmode_p8' was not declared. Should it be static?
arch/powerpc/kernel/mce_power.c:722:6: warning: symbol
'__machine_check_early_realmode_p9' was not declared. Should it be static?
arch/powerpc/kernel/mce_power.c:740:6: warning: symbol
'__machine_check_early_realmode_p10' was not declared. Should it be static?
This needs to be fixed by declaring the functions in a .h file that you
include in both arch/powerpc/kernel/mce_power.c and
arch/powerpc/kernel/cputable.c
Christophe
> #endif /* CONFIG_PPC64 */
> #if defined(CONFIG_E500)
> extern void __setup_cpu_e5500(unsigned long offset, struct cpu_spec* spec);
> @@ -541,6 +542,25 @@ static struct cpu_spec __initdata cpu_specs[] = {
> .machine_check_early = __machine_check_early_realmode_p9,
> .platform = "power9",
> },
> + { /* Power10 */
> + .pvr_mask = 0xffff0000,
> + .pvr_value = 0x00800000,
> + .cpu_name = "POWER10 (raw)",
> + .cpu_features = CPU_FTRS_POWER10,
> + .cpu_user_features = COMMON_USER_POWER10,
> + .cpu_user_features2 = COMMON_USER2_POWER10,
> + .mmu_features = MMU_FTRS_POWER10,
> + .icache_bsize = 128,
> + .dcache_bsize = 128,
> + .num_pmcs = 6,
> + .pmc_type = PPC_PMC_IBM,
> + .oprofile_cpu_type = "ppc64/power10",
> + .oprofile_type = PPC_OPROFILE_INVALID,
> + .cpu_setup = __setup_cpu_power10,
> + .cpu_restore = __restore_cpu_power10,
> + .machine_check_early = __machine_check_early_realmode_p10,
> + .platform = "power10",
> + },
> { /* Cell Broadband Engine */
> .pvr_mask = 0xffff0000,
> .pvr_value = 0x00700000,
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-14 9:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-14 7:45 [PATCH v2] powerpc: Add POWER10 raw mode cputable entry Madhavan Srinivasan
2020-08-14 9:14 ` Christophe Leroy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).