Commit 212a1e05 authored by Will Deacon's avatar Will Deacon Committed by Greg Kroah-Hartman

drivers/perf: arm_spe: Don't error on high-order pages for aux buf

[ Upstream commit 14ae42a6 ]

Since commit 5768402f ("perf/ring_buffer: Use high order allocations
for AUX buffers optimistically"), the perf core tends to back aux buffer
allocations with high-order pages with the order encoded in the
PagePrivate data. The Arm SPE driver explicitly rejects such pages,
causing the perf tool to fail with:

  | failed to mmap with 12 (Cannot allocate memory)

In actual fact, we can simply treat these pages just like any other
since the perf core takes care to populate the page array appropriately.
In theory we could try to map with PMDs where possible, but for now,
let's just get things working again.

Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Fixes: 5768402f ("perf/ring_buffer: Use high order allocations for AUX buffers optimistically")
Reported-by: default avatarHanjun Guo <guohanjun@huawei.com>
Tested-by: default avatarHanjun Guo <guohanjun@huawei.com>
Tested-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 980628e3
......@@ -855,16 +855,8 @@ static void *arm_spe_pmu_setup_aux(struct perf_event *event, void **pages,
if (!pglist)
goto out_free_buf;
for (i = 0; i < nr_pages; ++i) {
struct page *page = virt_to_page(pages[i]);
if (PagePrivate(page)) {
pr_warn("unexpected high-order page for auxbuf!");
goto out_free_pglist;
}
for (i = 0; i < nr_pages; ++i)
pglist[i] = virt_to_page(pages[i]);
}
buf->base = vmap(pglist, nr_pages, VM_MAP, PAGE_KERNEL);
if (!buf->base)
......
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