mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-23 21:44:15 +00:00
SMCCC: Hoist SMC_32 sanitization
The SMCCC, part 3 indicates that only the bottom 32-bits of a 32-bit SMC call are valid. The upper bits must be zero. Lets enforce that so standard service code can assume its been called that way. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Change-Id: I1bac50fbdc3b6ddca5fe2d1d1f96166a65ac4eb4
This commit is contained in:
parent
09e153a9a8
commit
475333c8a9
1 changed files with 9 additions and 0 deletions
|
@ -82,6 +82,15 @@ static uintptr_t std_svc_smc_handler(uint32_t smc_fid,
|
||||||
void *handle,
|
void *handle,
|
||||||
u_register_t flags)
|
u_register_t flags)
|
||||||
{
|
{
|
||||||
|
if (((smc_fid >> FUNCID_CC_SHIFT) & FUNCID_CC_MASK) == SMC_32) {
|
||||||
|
/* 32-bit SMC function, clear top parameter bits */
|
||||||
|
|
||||||
|
x1 &= UINT32_MAX;
|
||||||
|
x2 &= UINT32_MAX;
|
||||||
|
x3 &= UINT32_MAX;
|
||||||
|
x4 &= UINT32_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dispatch PSCI calls to PSCI SMC handler and return its return
|
* Dispatch PSCI calls to PSCI SMC handler and return its return
|
||||||
* value
|
* value
|
||||||
|
|
Loading…
Add table
Reference in a new issue