Skip to content

Commit 3520b25

Browse files
ahunter6Peter Zijlstra
authored andcommitted
perf/x86/intel/pt: Fix pt_topa_entry_for_page() address calculation
Currently, perf allocates an array of page pointers which is limited in size by MAX_PAGE_ORDER. That in turn limits the maximum Intel PT buffer size to 2GiB. Should that limitation be lifted, the Intel PT driver can support larger sizes, except for one calculation in pt_topa_entry_for_page(), which is limited to 32-bits. Fix pt_topa_entry_for_page() address calculation by adding a cast. Fixes: 39152ee ("perf/x86/intel/pt: Get rid of reverse lookup table for ToPA") Signed-off-by: Adrian Hunter <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ad97196 commit 3520b25

File tree

1 file changed

+1
-1
lines changed
  • arch/x86/events/intel

1 file changed

+1
-1
lines changed

arch/x86/events/intel/pt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ pt_topa_entry_for_page(struct pt_buffer *buf, unsigned int pg)
990990
* order allocations, there shouldn't be many of these.
991991
*/
992992
list_for_each_entry(topa, &buf->tables, list) {
993-
if (topa->offset + topa->size > pg << PAGE_SHIFT)
993+
if (topa->offset + topa->size > (unsigned long)pg << PAGE_SHIFT)
994994
goto found;
995995
}
996996

0 commit comments

Comments
 (0)