SPM: Fix MM_COMMUNICATE_AARCH32/64 parameters
authorSandrine Bailleux <sandrine.bailleux@arm.com>
Thu, 7 Dec 2017 09:48:56 +0000 (09:48 +0000)
committerSandrine Bailleux <sandrine.bailleux@arm.com>
Tue, 12 Dec 2017 15:05:21 +0000 (15:05 +0000)
commit4d2787cead7f46f3cbf6a2c4fd691c97a8195235
tree8030ef2f7740d9283440bd952e738a3577769362
parent211d307c6bfadbe44aa27998e105436143e1b147
SPM: Fix MM_COMMUNICATE_AARCH32/64 parameters

This partially reverts commit d6b532b50f8, keeping only the fixes to
the assertions. The changes related to the order of arguments passed
to the secure partition were not correct and violated the
specification of the SP_EVENT_COMPLETE SMC.

This patch also improves the MM_COMMUNICATE argument validation.  The
cookie argument, as it comes from normal world, can't be trusted and thus
needs to always be validated at run time rather than using an assertion.

Also validate the communication buffer address and return
INVALID_PARAMETER if it is zero, as per the MM specification.

Fix a few typos in comments and use the "secure partition" terminology
rather than "secure payload".

Change-Id: Ice6b7b5494b729dd44611f9a93d362c55ab244f7
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
services/std_svc/spm/spm_main.c