Skip to content

Commit 8c16dc0

Browse files
Andi KleenPeter Zijlstra
authored andcommitted
x86/perf: Avoid warning for Arch LBR without XSAVE
Some hypervisors support Arch LBR, but without the LBR XSAVE support. The current Arch LBR init code prints a warning when the xsave size (0) is unexpected. Avoid printing the warning for the "no LBR XSAVE" case. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20211215204029.150686-1-ak@linux.intel.com
1 parent 5a4487f commit 8c16dc0

File tree

1 file changed

+3
-0
lines changed
  • arch/x86/events/intel

1 file changed

+3
-0
lines changed

arch/x86/events/intel/lbr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,6 +1751,9 @@ static bool is_arch_lbr_xsave_available(void)
17511751
* Check the LBR state with the corresponding software structure.
17521752
* Disable LBR XSAVES support if the size doesn't match.
17531753
*/
1754+
if (xfeature_size(XFEATURE_LBR) == 0)
1755+
return false;
1756+
17541757
if (WARN_ON(xfeature_size(XFEATURE_LBR) != get_lbr_state_size()))
17551758
return false;
17561759

0 commit comments

Comments
 (0)