Closed jiameixie closed 1 year ago
By adding log in optee-os, I found it enters into the below if block in ffa_handle_sp_direct_req .
if (args->a2 != FFA_PARAM_MBZ) {
ffa_set_error(args, FFA_INVALID_PARAMETERS);
return NULL;
}
What does args->a2 represent in this context? why does it must be zero?
I think you should ask the one providing the configuration you're using these questions. It seems to have something to do with a Trusted Service configuration so perhaps someone from that team.
There are some descriptions about CPU_OFF and CPU_SUSPEND on page 52 of https://developer.arm.com/documentation/den0022/latest/ . Something like below.
5.4.7 Implementation responsibilities: Interaction with a Trusted OS or SP When a caller requests a power state, the PSCI implementation in the privileged platform firmware might need to communicate with a Trusted OS or SP. A method for interfacing between PPF and a Trusted OS or SP is specified by Firmware Framework for Arm v8-A [10]. However, the specification requires the Trusted OS or SP to always comply with CPU_SUSPEND requests. The PPF can inform the Trusted OS or SP that a power state needs to be entered, and the Trusted OS or SP can use this information to take any preparatory actions. For example, it might have to save its context. However, this communication must not allow the Trusted OS or SP to modify or prevent the power state requested. The Trusted OS or SP might not be able to tolerate a particular state, for latency or other reasons. In this case, Arm recommends that the Trusted OS or SP uses an IMPLEMENTATION DEFINED mechanism to communicate with the Normal world to ensure its constraints are considered in the power requests originating from the Normal world.
I think you should ask the one providing the configuration you're using these questions. It seems to have something to do with a Trusted Service configuration so perhaps someone from that team.
@jenswi-linaro Do you mean Trusted Service team?
Yes, https://github.com/OP-TEE/optee_os/blame/a8719249e3e260f172ab11c35314b068c5f25257/core/arch/arm/kernel/spmc_sp_handler.c#L824 should give a few names if you don't know where to start.
@jenswi-linaro Thanks.
Hi,
Is this OP-TEE SPMC without secure virtualization?
In which case it might not support FF-A v1.1 power management messages. https://developer.arm.com/documentation/den0077/e/?lang=en section 18.3.4
The SPMD sends a PSCI framework message to the SPMC on a CPU off event: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/services/std_svc/spmd/spmd_pm.c#n124
It is received by OP-TEE but it doesn't support the framework message bit 31 passed in w2.
We could filter this out in the SPMD if the SPMC is declared as FF-A v1.0 in the SPMC manifest attributes.
@odeprez Thanks for your answer.
Hi,
Is this OP-TEE SPMC without secure virtualization? This OP-TEE SPMC is without secure virtualization.
In which case it might not support FF-A v1.1 power management messages. https://developer.arm.com/documentation/den0077/e/?lang=en section 18.3.4
The SPMD sends a PSCI framework message to the SPMC on a CPU off event: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/services/std_svc/spmd/spmd_pm.c#n124
It is received by OP-TEE but it doesn't support the framework message bit 31 passed in w2.
We could filter this out in the SPMD if the SPMC is declared as FF-A v1.0 in the SPMC manifest attributes.
The SPMC is declared as FF-A v1.0 in the SPMC manifest attributes.
I have the below questions:
What does "We could filter this out in the SPMD " mean?
Does it mean not handling the power management messages and ignore it so that OP-TEE will not enter ffa_handle_sp_direct_req ?
And does it also mean CPU_OFF operation is not supported? The below command should fail
echo 0 > /sys/devices/system/cpu/cpu0/online
Hi, What does "We could filter this out in the SPMD " mean? I suggested a change similar to this: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/22025 It is yet to be fully tested, but you could try on your platform.
_Does it mean not handling the power management messages and ignore it so that OP-TEE will not enter ffa_handle_sp_directreq Yes.
_And does it also mean CPUOFF operation is not supported? The below command should fail After a fix similar to the above, CPU_OFF emitted from normal should be restored back to functional.
Hi all,
In Linux, run the below command to disable a CPU core and the kernel panic.
I added some log to debug and find the below things:
This above code is in link, which will call spmd_cpu_off_handler.
If removing the above
if block
, the kernel will not panic and the CPU core can be successfully offline.In optee-os, It calls thread_spmc_msg_recv. Below is the log, it seems it has an error(smc_id: 0x84000060)
I noticed some platforms implemented with psci_cpu_off.
Is that mandatory to add this function when adding a new platform for supporting SMP? What will happen in optee-os when disable a cpu core in linux? Could someone please give me some clue? Thanks.