diff options
author | sukadev@linux.vnet.ibm.com <sukadev@linux.vnet.ibm.com> | 2012-09-18 16:56:11 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-26 22:51:05 -0400 |
commit | e6878835ac4794f25385522d29c634b7bbb7cca9 (patch) | |
tree | 31abcefb32c9388588b176bbca8709d97c5d3559 /arch/powerpc/include/asm | |
parent | e8294de53bb788b3a6f7c09d143c7cdc60b65753 (diff) |
powerpc/perf: Sample only if SIAR-Valid bit is set in P7+
powerpc/perf: Sample only if SIAR-Valid bit is set in P7+
On POWER7+ two new bits (mmcra[35] and mmcra[36]) indicate whether the
contents of SIAR and SDAR are valid.
For marked instructions on P7+, we must save the contents of SIAR and
SDAR registers only if these new bits are set.
This code/check for the SIAR-Valid bit is specific to P7+, so rather than
waste a CPU-feature bit use the PVR flag.
Note that Carl Love proposed a similar change for oprofile:
https://lkml.org/lkml/2012/6/22/309
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r-- | arch/powerpc/include/asm/perf_event_server.h | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/reg.h | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/perf_event_server.h b/arch/powerpc/include/asm/perf_event_server.h index 078019b5b353..9710be3a2d17 100644 --- a/arch/powerpc/include/asm/perf_event_server.h +++ b/arch/powerpc/include/asm/perf_event_server.h | |||
@@ -49,6 +49,7 @@ struct power_pmu { | |||
49 | #define PPMU_ALT_SIPR 2 /* uses alternate posn for SIPR/HV */ | 49 | #define PPMU_ALT_SIPR 2 /* uses alternate posn for SIPR/HV */ |
50 | #define PPMU_NO_SIPR 4 /* no SIPR/HV in MMCRA at all */ | 50 | #define PPMU_NO_SIPR 4 /* no SIPR/HV in MMCRA at all */ |
51 | #define PPMU_NO_CONT_SAMPLING 8 /* no continuous sampling */ | 51 | #define PPMU_NO_CONT_SAMPLING 8 /* no continuous sampling */ |
52 | #define PPMU_SIAR_VALID 16 /* Processor has SIAR Valid bit */ | ||
52 | 53 | ||
53 | /* | 54 | /* |
54 | * Values for flags to get_alternatives() | 55 | * Values for flags to get_alternatives() |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index a1096fb62816..d24c14163966 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -606,6 +606,10 @@ | |||
606 | #define POWER6_MMCRA_SIPR 0x0000020000000000ULL | 606 | #define POWER6_MMCRA_SIPR 0x0000020000000000ULL |
607 | #define POWER6_MMCRA_THRM 0x00000020UL | 607 | #define POWER6_MMCRA_THRM 0x00000020UL |
608 | #define POWER6_MMCRA_OTHER 0x0000000EUL | 608 | #define POWER6_MMCRA_OTHER 0x0000000EUL |
609 | |||
610 | #define POWER7P_MMCRA_SIAR_VALID 0x10000000 /* P7+ SIAR contents valid */ | ||
611 | #define POWER7P_MMCRA_SDAR_VALID 0x08000000 /* P7+ SDAR contents valid */ | ||
612 | |||
609 | #define SPRN_PMC1 787 | 613 | #define SPRN_PMC1 787 |
610 | #define SPRN_PMC2 788 | 614 | #define SPRN_PMC2 788 |
611 | #define SPRN_PMC3 789 | 615 | #define SPRN_PMC3 789 |