[ Sasha's backport helper bot ] Hi, The upstream commit SHA1 provided is correct: 8c462d56487e3abdbf8a61cedfe7c795a54f4a78 Status in newer kernel trees: 6.12.y | Present (exact SHA1) 6.6.y | Present (different SHA1: 701fae8dce72) 6.1.y | Not found 5.15.y | Not found Note: The patch differs from the upstream commit: --- 1: 8c462d56487e3 ! 1: b6e0debc41724 arm64: smccc: Remove broken support for SMCCCv1.3 SVE discard hint @@ Metadata ## Commit message ## arm64: smccc: Remove broken support for SMCCCv1.3 SVE discard hint + [ Upstream commit 8c462d56487e3abdbf8a61cedfe7c795a54f4a78 ] + SMCCCv1.3 added a hint bit which callers can set in an SMCCC function ID (AKA "FID") to indicate that it is acceptable for the SMCCC implementation to discard SVE and/or SME state over a specific SMCCC @@ Commit message Reviewed-by: Mark Brown <broonie@xxxxxxxxxx> Link: https://lore.kernel.org/r/20241106160448.2712997-1-mark.rutland@xxxxxxx Signed-off-by: Will Deacon <will@xxxxxxxxxx> + [ Mark: fix conflicts in <linux/arm-smccc.h> and drivers/firmware/smccc/smccc.c ] + Signed-off-by: Mark Rutland <mark.rutland@xxxxxxx> ## arch/arm64/kernel/smccc-call.S ## @@ @@ drivers/firmware/smccc/smccc.c: static u32 smccc_version = ARM_SMCCC_VERSION_1_0 bool __ro_after_init smccc_trng_available = false; -u64 __ro_after_init smccc_has_sve_hint = false; - s32 __ro_after_init smccc_soc_id_version = SMCCC_RET_NOT_SUPPORTED; - s32 __ro_after_init smccc_soc_id_revision = SMCCC_RET_NOT_SUPPORTED; + void __init arm_smccc_version_init(u32 version, enum arm_smccc_conduit conduit) + { @@ drivers/firmware/smccc/smccc.c: void __init arm_smccc_version_init(u32 version, enum arm_smccc_conduit conduit) smccc_conduit = conduit; @@ drivers/firmware/smccc/smccc.c: void __init arm_smccc_version_init(u32 version, - if (IS_ENABLED(CONFIG_ARM64_SVE) && - smccc_version >= ARM_SMCCC_VERSION_1_3) - smccc_has_sve_hint = true; + } - if ((smccc_version >= ARM_SMCCC_VERSION_1_2) && - (smccc_conduit != SMCCC_CONDUIT_NONE)) { + enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void) ## include/linux/arm-smccc.h ## @@ include/linux/arm-smccc.h: u32 arm_smccc_get_version(void); @@ include/linux/arm-smccc.h: u32 arm_smccc_get_version(void); -extern u64 smccc_has_sve_hint; - /** - * arm_smccc_get_soc_id_version() - * + * struct arm_smccc_res - Result from SMC/HVC call + * @a0-a3 result values from registers 0 to 3 @@ include/linux/arm-smccc.h: struct arm_smccc_quirk { } state; }; @@ include/linux/arm-smccc.h: asmlinkage void __arm_smccc_hvc(unsigned long a0, uns - -#endif - - #define __constraint_read_2 "r" (arg0) - #define __constraint_read_3 __constraint_read_2, "r" (arg1) - #define __constraint_read_4 __constraint_read_3, "r" (arg2) + #define ___count_args(_0, _1, _2, _3, _4, _5, _6, _7, _8, x, ...) x + + #define __count_args(...) \ @@ include/linux/arm-smccc.h: asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1, + + #define ___constraints(count) \ + : __constraint_read_ ## count \ +- : smccc_sve_clobbers "memory" ++ : "memory" + #define __constraints(count) ___constraints(count) + + /* +@@ include/linux/arm-smccc.h: asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1, + register unsigned long r2 asm("r2"); \ register unsigned long r3 asm("r3"); \ - CONCATENATE(__declare_arg_, \ - COUNT_ARGS(__VA_ARGS__))(__VA_ARGS__); \ + __declare_args(__count_args(__VA_ARGS__), __VA_ARGS__); \ - asm volatile(SMCCC_SVE_CHECK \ - inst "\n" : \ + asm volatile(inst "\n" : \ "=r" (r0), "=r" (r1), "=r" (r2), "=r" (r3) \ - : CONCATENATE(__constraint_read_, \ - COUNT_ARGS(__VA_ARGS__)) \ -- : smccc_sve_clobbers "memory"); \ -+ : "memory"); \ - if (___res) \ - *___res = (typeof(*___res)){r0, r1, r2, r3}; \ - } while (0) -@@ include/linux/arm-smccc.h: asmlinkage void __arm_smccc_hvc(unsigned long a0, unsigned long a1, - asm ("" : \ - : CONCATENATE(__constraint_read_, \ - COUNT_ARGS(__VA_ARGS__)) \ -- : smccc_sve_clobbers "memory"); \ -+ : "memory"); \ + __constraints(__count_args(__VA_ARGS__))); \ if (___res) \ - ___res->a0 = SMCCC_RET_NOT_SUPPORTED; \ - } while (0) --- Results of testing on various branches: | Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-5.15.y | Success | Success |