linux/arch/x86/events/intel
Thomas Gleixner 7f049fbdd5 perf/x86/intel/lbr: Zero the xstate buffer on allocation
XRSTORS requires a valid xstate buffer to work correctly. XSAVES does not
guarantee to write a fully valid buffer according to the SDM:

  "XSAVES does not write to any parts of the XSAVE header other than the
   XSTATE_BV and XCOMP_BV fields."

XRSTORS triggers a #GP:

  "If bytes 63:16 of the XSAVE header are not all zero."

It's dubious at best how this can work at all when the buffer is not zeroed
before use.

Allocate the buffers with __GFP_ZERO to prevent XRSTORS failure.

Fixes: ce711ea3ca ("perf/x86/intel/lbr: Support XSAVES/XRSTORS for LBR context switch")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/87wnr0wo2z.ffs@nanos.tec.linutronix.de
2021-06-24 08:49:03 +02:00
..
bts.c x86: Fix various typos in comments, take #2 2021-03-21 23:50:28 +01:00
core.c perf/x86: Avoid touching LBR_TOS MSR for Arch LBR 2021-05-18 12:53:47 +02:00
cstate.c perf/x86/cstate: Add Alder Lake CPU support 2021-04-19 20:03:29 +02:00
ds.c Perf events changes in this cycle were: 2021-04-28 13:03:44 -07:00
knc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lbr.c perf/x86/intel/lbr: Zero the xstate buffer on allocation 2021-06-24 08:49:03 +02:00
Makefile perf/x86/intel/uncore: Parse uncore discovery tables 2021-04-02 10:04:54 +02:00
p4.c Perf events changes in this cycle were: 2021-04-28 13:03:44 -07:00
p6.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-15 01:15:52 +01:00
pt.c x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
pt.h perf/x86/intel/pt: Prevent redundant WRMSRs 2019-11-13 11:06:18 +01:00
uncore_discovery.c perf/x86/intel/uncore: Generic support for the MMIO type of uncore blocks 2021-04-02 10:04:55 +02:00
uncore_discovery.h perf/x86/intel/uncore: Generic support for the MMIO type of uncore blocks 2021-04-02 10:04:55 +02:00
uncore_nhmex.c perf/x86/intel/uncore: Correct fixed counter index check for NHM 2018-05-31 12:36:28 +02:00
uncore_snb.c perf/x86/intel/uncore: Add Alder Lake support 2021-04-19 20:03:29 +02:00
uncore_snbep.c perf/x86/intel/uncore: Fix M2M event umask for Ice Lake server 2021-06-01 16:00:05 +02:00
uncore.c perf/x86/intel/uncore: Add Alder Lake support 2021-04-19 20:03:29 +02:00
uncore.h perf/x86/intel/uncore: Add Alder Lake support 2021-04-19 20:03:29 +02:00