[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3e56e2f1-42bd-45e6-90a7-4105386d63ed@amd.com>
Date: Wed, 24 Dec 2025 11:15:30 +0530
From: Ravi Bangoria <ravi.bangoria@....com>
To: Dapeng Mi <dapeng1.mi@...ux.intel.com>
CC: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim
<namhyung@...nel.org>, Thomas Gleixner <tglx@...utronix.de>, Dave Hansen
<dave.hansen@...ux.intel.com>, Ian Rogers <irogers@...gle.com>, Adrian Hunter
<adrian.hunter@...el.com>, Jiri Olsa <jolsa@...nel.org>, Alexander Shishkin
<alexander.shishkin@...ux.intel.com>, Andi Kleen <ak@...ux.intel.com>,
Eranian Stephane <eranian@...gle.com>, Mark Rutland <mark.rutland@....com>,
<broonie@...nel.org>, <linux-kernel@...r.kernel.org>,
<linux-perf-users@...r.kernel.org>, Zide Chen <zide.chen@...el.com>, "Falcon
Thomas" <thomas.falcon@...el.com>, Dapeng Mi <dapeng1.mi@...el.com>, "Xudong
Hao" <xudong.hao@...el.com>, Kan Liang <kan.liang@...ux.intel.com>, "Ravi
Bangoria" <ravi.bangoria@....com>
Subject: Re: [Patch v5 13/19] perf/x86: Enable SSP sampling using
sample_regs_* fields
Hi Dapeng,
> This patch enables sampling of CET SSP register via the sample_regs_*
> fields.
>
> To sample SSP, the sample_simd_regs_enabled field must be set. This
> allows the spare space (reclaimed from the original XMM space) in the
> sample_regs_* fields to be used for representing SSP.
>
> Similar with eGPRs sampling, the perf_reg_value() function needs to
> check if the PERF_SAMPLE_REGS_ABI_SIMD flag is set first, and then
> determine whether to output SSP or legacy XMM registers to userspace.
1. The userspace SSP is saved in REGS_INTR even though interrupt regs
are of kernel context. Would it be better to pass 0 instead (see the
_untested_ patch below).
--- a/arch/x86/kernel/perf_regs.c
+++ b/arch/x86/kernel/perf_regs.c
@@ -71,7 +71,7 @@ u64 perf_reg_value(struct pt_regs *regs, int idx)
return perf_regs->egpr_regs[idx - PERF_REG_X86_R16];
}
if (idx == PERF_REG_X86_SSP) {
- if (!perf_regs->cet)
+ if (!perf_regs->cet || !user_mode(regs))
return 0;
return perf_regs->cet->user_ssp;
}
2. Could a simple "--user-regs=ssp / --intr-regs=ssp" (without SIMD/eGPR
regs) fallback to an RDMSR instead of XSAVE? Possibly as a future
enhancement if the current patches are already upstream ready.
Thanks,
Ravi
Powered by blists - more mailing lists