提交 5d7ead00 编写于 作者: M Michael Ellerman 提交者: Benjamin Herrenschmidt

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: NMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 97645154
...@@ -621,10 +621,19 @@ static struct power_pmu power8_pmu = { ...@@ -621,10 +621,19 @@ static struct power_pmu power8_pmu = {
static int __init init_power8_pmu(void) static int __init init_power8_pmu(void)
{ {
int rc;
if (!cur_cpu_spec->oprofile_cpu_type || if (!cur_cpu_spec->oprofile_cpu_type ||
strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power8")) strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power8"))
return -ENODEV; return -ENODEV;
return register_power_pmu(&power8_pmu); rc = register_power_pmu(&power8_pmu);
if (rc)
return rc;
/* Tell userspace that EBB is supported */
cur_cpu_spec->cpu_user_features2 |= PPC_FEATURE2_EBB;
return 0;
} }
early_initcall(init_power8_pmu); early_initcall(init_power8_pmu);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册