Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6c35695 authored by Adrian Hunter's avatar Adrian Hunter Committed by Vegard Nossum
Browse files

perf/x86/intel/pt: Fix a topa_entry base address calculation



[ Upstream commit ad97196379d0b8cb24ef3d5006978a6554e6467f ]

topa_entry->base is a bit-field. Bit-fields are not promoted to a 64-bit
type, even if the underlying type is 64-bit, and so, if necessary, must
be cast to a larger type when calculations are done.

Fix a topa_entry->base address calculation by adding a cast.

Without the cast, the address was limited to 36-bits i.e. 64GiB.

The address calculation is used on systems that do not support Multiple
Entry ToPA (only Broadwell), and affects physical addresses on or above
64GiB. Instead of writing to the correct address, the address comprising
the first 36 bits would be written to.

Intel PT snapshot and sampling modes are not affected.

Fixes: 52ca9ced ("perf/x86/intel/pt: Add Intel PT PMU driver")
Reported-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240624201101.60186-3-adrian.hunter@intel.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit 418f7db13405953c2d9223275d365d9828169076)
Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
parent a87ac310
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment