[PATCH v2 0/2] arm64: Implement SMCCC v1.3 SVE register saving hint

Mark Brown broonie at kernel.org
Tue May 18 11:25:47 PDT 2021


SMCCC v1.3 provides support for a flag which allows the caller to say
that there is no state that needs to be preserved in the SVE registers,
meaning that the called code can skip doing this, especially with larger
vector lengths this can save a noticable amount of work in the event
that the state needs to be saved. Implement support for this, using the
TIF_ flags to report if there is live SVE state present.

This overlaps with Sudeep's patch "arm64: smccc: Add support for
SMCCCv1.2 extended input/output registers"[1] although there shouldn't
be any conflicts, that adds some new SMCCC calls for v1.2 - the new
functions for v1.2 calls will need updating to take advantage of the
hint bit.

v2:
 - Use ldr_l rather than adrp/ldr so we load the hint flag rather than
   the start of the 4K block the hint flag happens to be in.
 - Disable the optimisation when running in nVHE so we don't try to jump
   to a function that isn't mapped or look at a current task that isn't
   meaningful.
 - Use _TIF for a bitfield like we should've done first time round.

[1] https://lore.kernel.org/r/20210518163618.43950-1-sudeep.holla@arm.com

Mark Brown (2):
  arm64: asmlinkage: Enable use of BTI_C macro in SYM_CODE
  arm64: smccc: Support SMCCC v1.3 SVE register saving hint

 arch/arm64/include/asm/linkage.h |  4 ++++
 arch/arm64/kernel/smccc-call.S   | 38 ++++++++++++++++++++++++++++++++
 drivers/firmware/smccc/smccc.c   |  4 ++++
 include/linux/arm-smccc.h        | 23 +++++++++++++++++--
 4 files changed, 67 insertions(+), 2 deletions(-)


base-commit: d07f6ca923ea0927a1024dfccafc5b53b61cfecc
-- 
2.20.1




More information about the linux-arm-kernel mailing list