Rework smc_unknown return code path in smc_handler
authorMadhukar Pappireddy <madhukar.pappireddy@arm.com>
Wed, 8 May 2019 20:41:41 +0000 (15:41 -0500)
committerSandrine Bailleux <sandrine.bailleux@arm.com>
Tue, 21 May 2019 08:19:37 +0000 (08:19 +0000)
commitcc485e27acdcc237718d0c10efd0526b2cf2513a
tree24f725114735b0959cdea0e200a96cadae7faa0e
parentaf9ae7cfa169e8c2e812f07014144fe247378ead
Rework smc_unknown return code path in smc_handler

The intention of this patch is to leverage the existing el3_exit() return
routine for smc_unknown return path rather than a custom set of instructions.
In order to leverage el3_exit(), the necessary counteraction (i.e., saving the
system registers apart from GP registers) must be performed. Hence a series of
instructions which save system registers( like SPSR_EL3, SCR_EL3 etc) to stack
are moved to the top of group of instructions which essentially decode the OEN
from the smc function identifier and obtain the specific service handler in
rt_svc_descs_array. This ensures that the control flow for both known and
unknown smc calls will be similar.

Change-Id: I67f94cfcba176bf8aee1a446fb58a4e383905a87
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
bl31/aarch64/runtime_exceptions.S