On 2018-08-20 15:31, Giovani Gracioli wrote:
Hello all,

I tracked the calls in the zynqmp_r5_remoteproc driver. It is not using hvc, 
but smc instead.

The driver ended up calling do_fw_call_smc (in 
drivers/firmware/xilinx/zynqmp/firmware.c), which then calls the assembly code 
I posted before but with another parameter:

/*
  * void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,
  *               unsigned long a3, unsigned long a4, unsigned long a5,
  *               unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
  *               struct arm_smccc_quirk *quirk)
  */
ENTRY(__arm_smccc_smc)
        SMCCC   smc
ENDPROC(__arm_smccc_smc)

This is handled in Jailhouse by handle_smc in hypervisor/arch/arm64/traps.c. In 
that function, the request is not handled in this else if statement:

} else if (IS_SIP_32(regs[0]) || IS_SIP_64(regs[0])) {
        /* This can be ignored */
        printk("handle_smc() 3 - regs[0] = %d\n", regs[0]);
        regs[0] = SIP_NOT_SUPPORTED;
} else {

I added the printk to check the function call flow.

So my question to the main developers is how can I integrate the handling of 
this call in Jailhouse? What would be the best way to proceed?

Ad-hoc: Look at master, hypervisor/arch/arm-common/smccc.c. We started to handle some calls, though we currently do not forward any. We could hack yours in there, but make sure that you know which registers needs to be forwarded and which get clobbered so that you do not destroy the execution context of the hypervisor.

If that invoked services is safe (side-effect free for other cells) and a common standard, we could add just forwarding on a whitelist basis to the core. But as the driver is apparently not upstream yet, that may likely already fail the "standard" requirement.

Do you happend to have some pointer to doc that describes the call?

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

--
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to