[PATCH v1 1/6] perf: arm64: Add SVE vector granule register to user regs
Mark Brown
broonie at kernel.org
Mon May 9 08:48:13 PDT 2022
On Mon, May 09, 2022 at 03:42:49PM +0100, James Clark wrote:
> Dwarf based unwinding in a function that pushes SVE registers onto
> the stack requires the unwinder to know the length of the SVE register
> to calculate the stack offsets correctly. This was added to the Arm
> specific Dwarf spec as the VG pseudo register[1].
>
> Add the vector length at position 46 if it's requested by userspace and
> SVE is supported. If it's not supported then fail to open the event.
>
> The vector length must be on each sample because it can be changed
> at runtime via a prctl or ptrace call. Also by adding it as a register
> rather than a separate attribute, minimal changes will be required in an
> unwinder that already indexes into the register list.
> +static u64 perf_ext_regs_value(int idx)
> +{
> + switch (idx) {
> + case PERF_REG_ARM64_VG:
> + if (WARN_ON_ONCE(!system_supports_sve()))
> + return 0;
These WARN_ON_ONCE()s seem a bit loud but I do see they are idiomatic
for this code so
Reviewed-by: Mark Brown <broonie at kernel.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20220509/10b2e7d1/attachment-0001.sig>
More information about the linux-arm-kernel
mailing list