Commit adb97f18 authored by Gerald BAEZA's avatar Gerald BAEZA Committed by Greg Kroah-Hartman

libperf: Fix alignment trap with xyarray contents in 'perf stat'

[ Upstream commit d9c5c083 ]

Following the patch 'perf stat: Fix --no-scale', an alignment trap
happens in process_counter_values() on ARMv7 platforms due to the
attempt to copy non 64 bits aligned double words (pointed by 'count')
via a NEON vectored instruction ('vld1' with 64 bits alignment
constraint).

This patch sets a 64 bits alignment constraint on 'contents[]' field in
'struct xyarray' since the 'count' pointer used above points to such a
structure.
Signed-off-by: default avatarGerald Baeza <gerald.baeza@st.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1566464769-16374-1-git-send-email-gerald.baeza@st.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4df2427a
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#ifndef _PERF_XYARRAY_H_ #ifndef _PERF_XYARRAY_H_
#define _PERF_XYARRAY_H_ 1 #define _PERF_XYARRAY_H_ 1
#include <linux/compiler.h>
#include <sys/types.h> #include <sys/types.h>
struct xyarray { struct xyarray {
...@@ -10,7 +11,7 @@ struct xyarray { ...@@ -10,7 +11,7 @@ struct xyarray {
size_t entries; size_t entries;
size_t max_x; size_t max_x;
size_t max_y; size_t max_y;
char contents[]; char contents[] __aligned(8);
}; };
struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size); struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment