Re: [PATCH 6/8] perf/x86/rapl: Get msr values from new probe framework

Peter Zijlstra
2019-06-17T11:42:53Z

On Sun, Jun 16, 2019 at 04:03:56PM +0200, Jiri Olsa wrote:

> + cfg = array_index_nospec(cfg, NR_RAPL_DOMAINS + 1);

This one fails to build on i386. Istr we had issues like that before.
This makes it build.

diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c
index ddad45ef8757..64ab51ffdf06 100644
--- a/arch/x86/events/intel/rapl.c
+++ b/arch/x86/events/intel/rapl.c
@@ -349,7 +349,7 @@ static int rapl_pmu_event_init(struct perf_event *event)
if (!cfg || cfg >= NR_RAPL_DOMAINS + 1)
return -EINVAL;

- cfg = array_index_nospec(cfg, NR_RAPL_DOMAINS + 1);
+ cfg = array_index_nospec((long)cfg, NR_RAPL_DOMAINS + 1);
bit = cfg - 1;

/* check event supported */