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

Sudeep Holla sudeep.holla at arm.com
Thu May 6 03:30:04 PDT 2021


On Wed, May 05, 2021 at 02:49:14PM +0100, Mark Rutland wrote:
> Hi Sudeep,
> 
> On Wed, May 05, 2021 at 10:38:38AM +0100, Sudeep Holla wrote:
> > 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.
> > 
> > Cc: Michael Kelley <mikelley at microsoft.com>
> > Cc: Will Deacon <will at kernel.org>
> > Cc: Mark Rutland <mark.rutland at arm.com>
> > Cc:Catalin Marinas <catalin.marinas at arm.com>
> > Signed-off-by: Sudeep Holla <sudeep.holla at arm.com>
> 
> I have one minor comment below, otherwise this looks good to me, and
> regardless:
> 
> Acked-by: Mark Rutland <mark.rutland at arm.com>
> 
> [...]
> 
> > +/**
> > + * arm_smccc_1_2_hvc() - make HVC calls
> > + * @args: arguments passed via struct arm_smccc_1_2_regs
> > + * @res: result values via struct arm_smccc_1_2_regs
> > + *
> > + * This function is used to make HVC calls following SMC Calling Convention
> > + * v1.2 or above. The content of the supplied param are copied from the
> > + * structure to registers prior to the HVC instruction. The return values
> > + * are updated with the content from registers on return from the HVC
> > + * instruction.
> > + */
> > +asmlinkage void arm_smccc_1_2_hvc(struct arm_smccc_1_2_regs *args,
> > +				  struct arm_smccc_1_2_regs *res);
> > +
> > +/**
> > + * arm_smccc_1_2_smc() - make SMC calls
> > + * @args: arguments passed via struct arm_smccc_1_2_regs
> > + * @res: result values via struct arm_smccc_1_2_regs
> > + *
> > + * This function is used to make SMC calls following SMC Calling Convention
> > + * v1.2 or above. The content of the supplied param are copied from the
> > + * structure to registers prior to the SMC instruction. The return values
> > + * are updated with the content from registers on return from the SMC
> > + * instruction.
> > + */
> > +asmlinkage void arm_smccc_1_2_smc(struct arm_smccc_1_2_regs *args,
> > +				  struct arm_smccc_1_2_regs *res);
> > +#endif
> 
> It might be worth making the args parameter to these const, since we
> never write to it in the asm.
>

Makes sense, will fix it. Thanks for the review.

-- 
Regards,
Sudeep



More information about the linux-arm-kernel mailing list