diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2013-07-12 22:53:40 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-07-24 00:18:45 -0400 |
commit | 5d7ead0039b0c9500825b46997896352810efb0b (patch) | |
tree | 98acff96a45beaf80c065ad519df4b2672b28785 | |
parent | 97645154a9056106a957905c7836a016e5c89b3b (diff) |
powerpc/perf: Set PPC_FEATURE2_EBB when we register the power8 PMU
The presence or absence of EBB is advertised to userspace via the presence
or absence of PPC_FEATURE2_EBB in cpu_user_features2.
Because the kernel can be built without PMU support, we should only add
PPC_FEATURE2_EBB to cpu_user_features2 when we successfully register the
power8 PMU support.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/perf/power8-pmu.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c index 96a64d6a8bdf..09def196f5c4 100644 --- a/arch/powerpc/perf/power8-pmu.c +++ b/arch/powerpc/perf/power8-pmu.c | |||
@@ -621,10 +621,19 @@ static struct power_pmu power8_pmu = { | |||
621 | 621 | ||
622 | static int __init init_power8_pmu(void) | 622 | static int __init init_power8_pmu(void) |
623 | { | 623 | { |
624 | int rc; | ||
625 | |||
624 | if (!cur_cpu_spec->oprofile_cpu_type || | 626 | if (!cur_cpu_spec->oprofile_cpu_type || |
625 | strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power8")) | 627 | strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power8")) |
626 | return -ENODEV; | 628 | return -ENODEV; |
627 | 629 | ||
628 | return register_power_pmu(&power8_pmu); | 630 | rc = register_power_pmu(&power8_pmu); |
631 | if (rc) | ||
632 | return rc; | ||
633 | |||
634 | /* Tell userspace that EBB is supported */ | ||
635 | cur_cpu_spec->cpu_user_features2 |= PPC_FEATURE2_EBB; | ||
636 | |||
637 | return 0; | ||
629 | } | 638 | } |
630 | early_initcall(init_power8_pmu); | 639 | early_initcall(init_power8_pmu); |