Skip to contentSkip to conversation

arm64: smccc: Add support for SMCCCv1.2 extended input/output registers

PATCH Applied Sudeep Holla 3 participants 6 messages May 18, 2021 – May 26, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm64: smccc: Add support for SMCCCv1.2 extended input/output registers

SMCCC v1.2 allows x8-x17 to be used as parameter registers and x4—x17 to be used as result registers in SMC64/HVC64. Arm Firmware Framework for Armv8-A specification makes use of x0-x7 as parameter and result registers. There are other users like Hyper-V who intend to use beyond x0-x7 as well.

Current SMCCC interface in the kernel just use x0-x7 as parameter and x0-x3 as result registers as required by SMCCCv1.0. Let us add new interface to support this extended set of input/output registers namely x0-x17 as both parameter and result registers.

---

Hi Will,

As mentioned in my previous email[1], I posting this independent of FF-A series so that you can pick this up(if you have no issues with the patch itself) and share me a branch based on v5.13-rc1 so that I can get the FF-A driver merged via arm-soc.

v1[0]->v2:
- Added const for regs arguments as suggested by Mark
- Added review/ack/tested tags provided so far

Regards,
Sudeep

[0] https://lore.kernel.org/r/[email protected]
[1] https://lore.kernel.org/r/20210513131705.uuaz3mmp2xaacxw3@bogus/

 arch/arm64/kernel/asm-offsets.c |  9 ++++++
 arch/arm64/kernel/smccc-call.S  | 57 +++++++++++++++++++++++++++++++++
 include/linux/arm-smccc.h       | 55 +++++++++++++++++++++++++++++++
 3 files changed, 121 insertions(+)
arch/arm64/kernel/asm-offsets.c +9 -0
index 0cb34ccb6e73..74321bc9a459 100644
@@ -138,6 +138,15 @@ int main(void)
   DEFINE(ARM_SMCCC_RES_X2_OFFS,		offsetof(struct arm_smccc_res, a2));
   DEFINE(ARM_SMCCC_QUIRK_ID_OFFS,	offsetof(struct arm_smccc_quirk, id));
   DEFINE(ARM_SMCCC_QUIRK_STATE_OFFS,	offsetof(struct arm_smccc_quirk, state));
+  DEFINE(ARM_SMCCC_1_2_REGS_X0_OFFS,	offsetof(struct arm_smccc_1_2_regs, a0));
+  DEFINE(ARM_SMCCC_1_2_REGS_X2_OFFS,	offsetof(struct arm_smccc_1_2_regs, a2));
+  DEFINE(ARM_SMCCC_1_2_REGS_X4_OFFS,	offsetof(struct arm_smccc_1_2_regs, a4));
+  DEFINE(ARM_SMCCC_1_2_REGS_X6_OFFS,	offsetof(struct arm_smccc_1_2_regs, a6));
+  DEFINE(ARM_SMCCC_1_2_REGS_X8_OFFS,	offsetof(struct arm_smccc_1_2_regs, a8));
+  DEFINE(ARM_SMCCC_1_2_REGS_X10_OFFS,	offsetof(struct arm_smccc_1_2_regs, a10));
+  DEFINE(ARM_SMCCC_1_2_REGS_X12_OFFS,	offsetof(struct arm_smccc_1_2_regs, a12));
+  DEFINE(ARM_SMCCC_1_2_REGS_X14_OFFS,	offsetof(struct arm_smccc_1_2_regs, a14));
+  DEFINE(ARM_SMCCC_1_2_REGS_X16_OFFS,	offsetof(struct arm_smccc_1_2_regs, a16));
   BLANK();
   DEFINE(HIBERN_PBE_ORIG,	offsetof(struct pbe, orig_address));
   DEFINE(HIBERN_PBE_ADDR,	offsetof(struct pbe, address));
arch/arm64/kernel/smccc-call.S +57 -0

60 lines not on this page · raw message

include/linux/arm-smccc.h +55 -0

61 lines not on this page · raw message

Signature · 7 lines
2.25.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v2 1/1
#1 lore raw
Quoted 5 lines · Sudeep Holla

SMCCC v1.2 allows x8-x17 to be used as parameter registers and x4—x17 to be used as result registers in SMC64/HVC64. Arm Firmware Framework for Armv8-A specification makes use of x0-x7 as parameter and result registers. There are other users like Hyper-V who intend to use beyond x0-x7 as well.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer Applied
#2 lore raw
In reply to Sudeep Holla
Quoted 10 lines · Sudeep Holla

SMCCC v1.2 allows x8-x17 to be used as parameter registers and x4—x17 to be used as result registers in SMC64/HVC64. Arm Firmware Framework for Armv8-A specification makes use of x0-x7 as parameter and result registers. There are other users like Hyper-V who intend to use beyond x0-x7 as well.

Current SMCCC interface in the kernel just use x0-x7 as parameter and x0-x3 as result registers as required by SMCCCv1.0. Let us add new interface to support this extended set of input/output registers namely x0-x17 as both parameter and result registers.

Applied to arm64 (for-next/smccc), thanks!

[1/1] arm64: smccc: Add support for SMCCCv1.2 extended input/output registers

      https://git.kernel.org/arm64/c/8ebe486de71a

Cheers,

Signature · 10 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#3 lore raw

Hi Will,

Sorry to bother again.

Quoted 12 lines · Will Deacon
Quoted 10 lines · Sudeep Holla

SMCCC v1.2 allows x8-x17 to be used as parameter registers and x4—x17 to be used as result registers in SMC64/HVC64. Arm Firmware Framework for Armv8-A specification makes use of x0-x7 as parameter and result registers. There are other users like Hyper-V who intend to use beyond x0-x7 as well.

Current SMCCC interface in the kernel just use x0-x7 as parameter and x0-x3 as result registers as required by SMCCCv1.0. Let us add new interface to support this extended set of input/output registers namely x0-x17 as both parameter and result registers.

Quoted 5 lines

Applied to arm64 (for-next/smccc), thanks!

[1/1] arm64: smccc: Add support for SMCCCv1.2 extended input/output registers

      https://git.kernel.org/arm64/c/8ebe486de71a

I see this is based on v5.13-rc3. As I mentioned earlier, I need to base FF-A driver on this and arm-soc team always expects to send pull request based on -rc1. Is it possible to have this based on -rc1 instead so that I can base FF-A driver based on that ?

--
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#4 lore raw
Quoted 15 lines · Sudeep Holla
Quoted 14 lines · Will Deacon
Quoted 10 lines · Sudeep Holla

SMCCC v1.2 allows x8-x17 to be used as parameter registers and x4—x17 to be used as result registers in SMC64/HVC64. Arm Firmware Framework for Armv8-A specification makes use of x0-x7 as parameter and result registers. There are other users like Hyper-V who intend to use beyond x0-x7 as well.

Current SMCCC interface in the kernel just use x0-x7 as parameter and x0-x3 as result registers as required by SMCCCv1.0. Let us add new interface to support this extended set of input/output registers namely x0-x17 as both parameter and result registers.

Applied to arm64 (for-next/smccc), thanks!

Quoted 8 lines
Quoted 3 lines

[1/1] arm64: smccc: Add support for SMCCCv1.2 extended input/output registers

      https://git.kernel.org/arm64/c/8ebe486de71a

I see this is based on v5.13-rc3. As I mentioned earlier, I need to base FF-A driver on this and arm-soc team always expects to send pull request based on -rc1. Is it possible to have this based on -rc1 instead so that I can base FF-A driver based on that ?

Sorry, I forgot about that requirement. I've pushed a new branch (for-next/ffa) for you to use instead.

Will

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#5 lore raw
Quoted 20 lines · Will Deacon
Quoted 19 lines · Sudeep Holla
Quoted 17 lines · Will Deacon
Quoted 10 lines · Sudeep Holla

SMCCC v1.2 allows x8-x17 to be used as parameter registers and x4—x17 to be used as result registers in SMC64/HVC64. Arm Firmware Framework for Armv8-A specification makes use of x0-x7 as parameter and result registers. There are other users like Hyper-V who intend to use beyond x0-x7 as well.

Current SMCCC interface in the kernel just use x0-x7 as parameter and x0-x3 as result registers as required by SMCCCv1.0. Let us add new interface to support this extended set of input/output registers namely x0-x17 as both parameter and result registers.

Applied to arm64 (for-next/smccc), thanks!

[1/1] arm64: smccc: Add support for SMCCCv1.2 extended input/output registers

      https://git.kernel.org/arm64/c/8ebe486de71a
Quoted 8 lines
Quoted 4 lines

I see this is based on v5.13-rc3. As I mentioned earlier, I need to base FF-A driver on this and arm-soc team always expects to send pull request based on -rc1. Is it possible to have this based on -rc1 instead so that I can base FF-A driver based on that ?

Sorry, I forgot about that requirement. I've pushed a new branch (for-next/ffa) for you to use instead.

No worries, thanks for the branch.

Signature · 7 lines
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel