Skip to contentSkip to conversation

powerpc/book3s32: Only select PPC_HAVE_PMU on e600

PATCH In review Christophe Leroy 4 participants 8 messages Sep 3, 2015 – Sep 10, 2015 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/book3s32: Only select PPC_HAVE_PMU on e600

On PPC832x, perf record/report reports martian addresses

     2.62%  perf_reseau4  libpthread-2.18.so  [.] __libc_send
     2.56%  perf_reseau4  [kernel.kallsyms]   [k] __ip_make_skb
     1.62%  perf_reseau4  [kernel.kallsyms]   [k] __ip_append_data.isra.39
     1.55%  perf_reseau4  [kernel.kallsyms]   [k] ip_finish_output
     1.33%  perf_reseau4  [unknown]           [k] 0x7ffffd94
     1.33%  perf_reseau4  [unknown]           [k] 0x7ffffd95
     1.28%  perf_reseau4  [unknown]           [k] 0x7ffffd97
     1.26%  perf_reseau4  [unknown]           [k] 0x7ffffda3
     1.24%  perf_reseau4  [unknown]           [k] 0x7ffffd98
     1.22%  perf_reseau4  [unknown]           [k] 0x7ffffd92
     1.22%  perf_reseau4  [unknown]           [k] 0x7ffffd9b
     [.....]

This is due to function perf_instruction_pointer() reading SPR SIAR which doesn't exist on e300 core. The perf_instruction_pointer() is redefined in arch/powerpc/perf/core-book3s.c when CONFIG_PPC_PERF_CTRS is selected.

This patch moves the selection of CONFIG_PPC_HAVE_PMU in 86xx section so that CONFIG_PPC_PERF_CTRS won't be selected for other 6xx powerpc

---
 arch/powerpc/platforms/86xx/Kconfig    | 1 +
 arch/powerpc/platforms/Kconfig.cputype | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/86xx/Kconfig +1 -0
index 1afd1e4..bb24d2a 100644
@@ -5,6 +5,7 @@ menuconfig PPC_86xx
 	select FSL_SOC
 	select ALTIVEC
 	select ARCH_WANT_OPTIONAL_GPIOLIB
+	select PPC_HAVE_PMU_SUPPORT
 	help
 	  The Freescale E600 SoCs have 74xx cores.
 
arch/powerpc/platforms/Kconfig.cputype +0 -1
index d642cf9..aa63b12 100644
@@ -143,7 +143,6 @@ config PPC_BOOK3E
 config 6xx
 	def_bool y
 	depends on PPC32 && PPC_BOOK3S
-	select PPC_HAVE_PMU_SUPPORT
 
 config TUNE_CELL
 	bool "Optimize for Cell Broadband Engine"
Signature · 1 line
2.1.0
#1 lore raw
Quoted 15 lines · Christophe Leroy

On PPC832x, perf record/report reports martian addresses

     2.62%  perf_reseau4  libpthread-2.18.so  [.] __libc_send
     2.56%  perf_reseau4  [kernel.kallsyms]   [k] __ip_make_skb
     1.62%  perf_reseau4  [kernel.kallsyms]   [k] __ip_append_data.isra.39
     1.55%  perf_reseau4  [kernel.kallsyms]   [k] ip_finish_output
     1.33%  perf_reseau4  [unknown]           [k] 0x7ffffd94
     1.33%  perf_reseau4  [unknown]           [k] 0x7ffffd95
     1.28%  perf_reseau4  [unknown]           [k] 0x7ffffd97
     1.26%  perf_reseau4  [unknown]           [k] 0x7ffffda3
     1.24%  perf_reseau4  [unknown]           [k] 0x7ffffd98
     1.22%  perf_reseau4  [unknown]           [k] 0x7ffffd92
     1.22%  perf_reseau4  [unknown]           [k] 0x7ffffd9b
     [.....]
Quoted 7 lines

This is due to function perf_instruction_pointer() reading SPR SIAR which doesn't exist on e300 core. The perf_instruction_pointer() is redefined in arch/powerpc/perf/core-book3s.c when CONFIG_PPC_PERF_CTRS is selected.

This patch moves the selection of CONFIG_PPC_HAVE_PMU in 86xx section so that CONFIG_PPC_PERF_CTRS won't be selected for other 6xx powerpc

I don't know much about these old 6xx cpus, deferring to Paul.

cheers

#2 lore raw
In reply to Christophe Leroy
Quoted 20 lines · Christophe Leroy

On PPC832x, perf record/report reports martian addresses

     2.62%  perf_reseau4  libpthread-2.18.so  [.] __libc_send
     2.56%  perf_reseau4  [kernel.kallsyms]   [k] __ip_make_skb
     1.62%  perf_reseau4  [kernel.kallsyms]   [k] __ip_append_data.isra.39
     1.55%  perf_reseau4  [kernel.kallsyms]   [k] ip_finish_output
     1.33%  perf_reseau4  [unknown]           [k] 0x7ffffd94
     1.33%  perf_reseau4  [unknown]           [k] 0x7ffffd95
     1.28%  perf_reseau4  [unknown]           [k] 0x7ffffd97
     1.26%  perf_reseau4  [unknown]           [k] 0x7ffffda3
     1.24%  perf_reseau4  [unknown]           [k] 0x7ffffd98
     1.22%  perf_reseau4  [unknown]           [k] 0x7ffffd92
     1.22%  perf_reseau4  [unknown]           [k] 0x7ffffd9b
     [.....]

This is due to function perf_instruction_pointer() reading SPR SIAR which doesn't exist on e300 core. The perf_instruction_pointer() is redefined in arch/powerpc/perf/core-book3s.c when CONFIG_PPC_PERF_CTRS is selected.

Quoted 4 lines

This patch moves the selection of CONFIG_PPC_HAVE_PMU in 86xx section so that CONFIG_PPC_PERF_CTRS won't be selected for other 6xx powerpc

So, what happens when a kernel is built that supports both 83xx and 86xx? Plus, it's e300, not e600, that is the exception among 6xx-style cores.

-Scott

#3 lore raw
Quoted 21 lines · Scott Wood
Quoted 20 lines · Christophe Leroy

On PPC832x, perf record/report reports martian addresses

      2.62%  perf_reseau4  libpthread-2.18.so  [.] __libc_send
      2.56%  perf_reseau4  [kernel.kallsyms]   [k] __ip_make_skb
      1.62%  perf_reseau4  [kernel.kallsyms]   [k] __ip_append_data.isra.39
      1.55%  perf_reseau4  [kernel.kallsyms]   [k] ip_finish_output
      1.33%  perf_reseau4  [unknown]           [k] 0x7ffffd94
      1.33%  perf_reseau4  [unknown]           [k] 0x7ffffd95
      1.28%  perf_reseau4  [unknown]           [k] 0x7ffffd97
      1.26%  perf_reseau4  [unknown]           [k] 0x7ffffda3
      1.24%  perf_reseau4  [unknown]           [k] 0x7ffffd98
      1.22%  perf_reseau4  [unknown]           [k] 0x7ffffd92
      1.22%  perf_reseau4  [unknown]           [k] 0x7ffffd9b
      [.....]

This is due to function perf_instruction_pointer() reading SPR SIAR which doesn't exist on e300 core. The perf_instruction_pointer() is redefined in arch/powerpc/perf/core-book3s.c when CONFIG_PPC_PERF_CTRS is selected.

Quoted 5 lines
Quoted 4 lines

This patch moves the selection of CONFIG_PPC_HAVE_PMU in 86xx section so that CONFIG_PPC_PERF_CTRS won't be selected for other 6xx powerpc

So, what happens when a kernel is built that supports both 83xx and 86xx?

Right, so should we define a processor feature for it ?

Quoted 1 line

Plus, it's e300, not e600, that is the exception among 6xx-style cores.

Is it ? I've been looking for special register SIAR (spr 955) in several 6xx reference manuals. 82xx doesn't have it, 52xx and 512x don't have it.
I found it only in the 86xx
Which other family has it ?

Christophe

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#4 lore raw
Quoted 6 lines · christophe leroy
Quoted 1 line

Plus, it's e300, not e600, that is the exception among 6xx-style cores.

Is it ? I've been looking for special register SIAR (spr 955) in several 6xx reference manuals.
82xx doesn't have it, 52xx and 512x don't have it.
I found it only in the 86xx
Which other family has it ?

7xx, 7xxx have it. I don't think any 603 or 604 have it.

Segher

#5 lore raw
In reply to christophe leroy

[ it seems my previous mail disappeared down the void ]

Quoted 6 lines · christophe leroy
Quoted 1 line

Plus, it's e300, not e600, that is the exception among 6xx-style cores.

Is it ? I've been looking for special register SIAR (spr 955) in several 6xx reference manuals.
82xx doesn't have it, 52xx and 512x don't have it.
I found it only in the 86xx
Which other family has it ?

All 7xx and 7xxx have it. No 603 or 604 does afaik.

Segher

#6 lore raw
In reply to christophe leroy
Quoted 23 lines · christophe leroy
Quoted 22 lines · Scott Wood
Quoted 21 lines · Christophe Leroy

On PPC832x, perf record/report reports martian addresses

      2.62%  perf_reseau4  libpthread-2.18.so  [.] __libc_send
      2.56%  perf_reseau4  [kernel.kallsyms]   [k] __ip_make_skb
      1.62%  perf_reseau4  [kernel.kallsyms]   [k] 
__ip_append_data.isra.39
      1.55%  perf_reseau4  [kernel.kallsyms]   [k] ip_finish_output
      1.33%  perf_reseau4  [unknown]           [k] 0x7ffffd94
      1.33%  perf_reseau4  [unknown]           [k] 0x7ffffd95
      1.28%  perf_reseau4  [unknown]           [k] 0x7ffffd97
      1.26%  perf_reseau4  [unknown]           [k] 0x7ffffda3
      1.24%  perf_reseau4  [unknown]           [k] 0x7ffffd98
      1.22%  perf_reseau4  [unknown]           [k] 0x7ffffd92
      1.22%  perf_reseau4  [unknown]           [k] 0x7ffffd9b
      [.....]

This is due to function perf_instruction_pointer() reading SPR SIAR which doesn't exist on e300 core. The perf_instruction_pointer() is redefined in arch/powerpc/perf/core-book3s.c when CONFIG_PPC_PERF_CTRS is selected.

Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

This patch moves the selection of CONFIG_PPC_HAVE_PMU in 86xx section so that CONFIG_PPC_PERF_CTRS won't be selected for other 6xx powerpc

So, what happens when a kernel is built that supports both 83xx and 86xx?

Right, so should we define a processor feature for it ?

There aren't many CPU feature flags left (without changing the mechanism to make more available), and runtime patching shouldn't be necessary. Instead, use the existing oprofile_type field. BTW, I don't know why we have pmc_type in addition to that -- the hardware only needs to be described once, regardless of how many subsystems care about it.

Note that this will only address the case of failing gracefully when the running hardware doesn't support the compiled-in perf mechanism. Actually supporting both mechanisms in the same kernel (some e300 cores support fsl- emb) would require a new indirection layer.

-Scott

#7 lore raw
Quoted 27 lines · Scott Wood
Quoted 26 lines · christophe leroy
Quoted 25 lines · Scott Wood
Quoted 24 lines · Christophe Leroy

On PPC832x, perf record/report reports martian addresses

      2.62%  perf_reseau4  libpthread-2.18.so  [.] __libc_send
      2.56%  perf_reseau4  [kernel.kallsyms]   [k] __ip_make_skb
      1.62%  perf_reseau4  [kernel.kallsyms]   [k] 
__ip_append_data.isra.39
      1.55%  perf_reseau4  [kernel.kallsyms]   [k] ip_finish_output
      1.33%  perf_reseau4  [unknown]           [k] 0x7ffffd94
      1.33%  perf_reseau4  [unknown]           [k] 0x7ffffd95
      1.28%  perf_reseau4  [unknown]           [k] 0x7ffffd97
      1.26%  perf_reseau4  [unknown]           [k] 0x7ffffda3
      1.24%  perf_reseau4  [unknown]           [k] 0x7ffffd98
      1.22%  perf_reseau4  [unknown]           [k] 0x7ffffd92
      1.22%  perf_reseau4  [unknown]           [k] 0x7ffffd9b
      [.....]

This is due to function perf_instruction_pointer() reading SPR SIAR which doesn't exist on e300 core. The perf_instruction_pointer() is redefined in arch/powerpc/perf/core-book3s.c when CONFIG_PPC_PERF_CTRS is selected.

This patch moves the selection of CONFIG_PPC_HAVE_PMU in 86xx section so that CONFIG_PPC_PERF_CTRS won't be selected for other 6xx powerpc

Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line

So, what happens when a kernel is built that supports both 83xx and 86xx?

Right, so should we define a processor feature for it ?

There aren't many CPU feature flags left (without changing the mechanism to make more available), and runtime patching shouldn't be necessary. Instead, use the existing oprofile_type field.

Yep, +1. Only add new cpu feature flags if you really need them please.

Quoted 3 lines

BTW, I don't know why we have pmc_type in addition to that -- the hardware only needs to be described once, regardless of how many subsystems care about it.

Right, I think that's all just accreted over the years, and predates perf. We could probably consolidate some of it.

cheers