[edk2] [PATCH v2 03/17] ArmPkg/Include: Add MM interface SVC return codes.

Supreeth Venkatesh posted 17 patches 6 years, 8 months ago
Only 16 patches received!
There is a newer version of this series
[edk2] [PATCH v2 03/17] ArmPkg/Include: Add MM interface SVC return codes.
Posted by Supreeth Venkatesh 6 years, 8 months ago
This patch adds the Management Mode(MM) - Secure Partition Manager(SPM) SVC return codes.
Also, It corrects SVC ID for retrieving SPM version information.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Achin Gupta <achin.gupta@arm.com>
Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
---
 ArmPkg/Include/IndustryStandard/ArmMmSvc.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
index 4c7b6c3386..a64b9ec23c 100644
--- a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
+++ b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
@@ -20,7 +20,7 @@
  * delegated events and request the Secure partition manager to perform
  * privileged operations on its behalf.
  */
-#define ARM_SVC_ID_SPM_VERSION_AARCH64             0xC4000060
+#define ARM_SVC_ID_SPM_VERSION_AARCH32             0x84000060
 #define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64       0xC4000061
 #define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64   0xC4000064
 #define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64   0xC4000065
@@ -40,4 +40,11 @@
     ((((c_perm) & SET_MEM_ATTR_CODE_PERM_MASK) << SET_MEM_ATTR_CODE_PERM_SHIFT) | \
     (( (d_perm) & SET_MEM_ATTR_DATA_PERM_MASK) << SET_MEM_ATTR_DATA_PERM_SHIFT))
 
+/* MM SVC Return error codes */
+#define ARM_SVC_SPM_RET_SUCCESS               0
+#define ARM_SVC_SPM_RET_NOT_SUPPORTED        -1
+#define ARM_SVC_SPM_RET_INVALID_PARAMS       -2
+#define ARM_SVC_SPM_RET_DENIED               -3
+#define ARM_SVC_SPM_RET_NO_MEMORY            -5
+
 #endif
-- 
2.16.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v2 03/17] ArmPkg/Include: Add MM interface SVC return codes.
Posted by Udit Kumar 6 years, 8 months ago

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Supreeth Venkatesh
> Sent: Saturday, May 5, 2018 2:11 AM
> To: edk2-devel@lists.01.org
> Cc: ard.biesheuvel@linaro.org; leif.lindholm@linaro.org; jiewen.yao@intel.com;
> liming.gao@intel.com; michael.d.kinney@intel.com
> Subject: [edk2] [PATCH v2 03/17] ArmPkg/Include: Add MM interface SVC return
> codes.
> 
> This patch adds the Management Mode(MM) - Secure Partition Manager(SPM)
> SVC return codes.
> Also, It corrects SVC ID for retrieving SPM version information.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Achin Gupta <achin.gupta@arm.com>
> Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> ---
>  ArmPkg/Include/IndustryStandard/ArmMmSvc.h | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
> b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
> index 4c7b6c3386..a64b9ec23c 100644
> --- a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
> +++ b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
> @@ -20,7 +20,7 @@
>   * delegated events and request the Secure partition manager to perform
>   * privileged operations on its behalf.
>   */
> -#define ARM_SVC_ID_SPM_VERSION_AARCH64             0xC4000060
> +#define ARM_SVC_ID_SPM_VERSION_AARCH32             0x84000060
>  #define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64       0xC4000061
>  #define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64   0xC4000064
>  #define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64   0xC4000065
> @@ -40,4 +40,11 @@
>      ((((c_perm) & SET_MEM_ATTR_CODE_PERM_MASK) <<
> SET_MEM_ATTR_CODE_PERM_SHIFT) | \
>      (( (d_perm) & SET_MEM_ATTR_DATA_PERM_MASK) <<
> SET_MEM_ATTR_DATA_PERM_SHIFT))
> 
> +/* MM SVC Return error codes */
> +#define ARM_SVC_SPM_RET_SUCCESS               0
> +#define ARM_SVC_SPM_RET_NOT_SUPPORTED        -1
> +#define ARM_SVC_SPM_RET_INVALID_PARAMS       -2
> +#define ARM_SVC_SPM_RET_DENIED               -3
> +#define ARM_SVC_SPM_RET_NO_MEMORY            -5

Please see if you want to define errors as negative.
AFAIK, in edk2 negative errors are not used 

> +
>  #endif
> --
> 2.16.2
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01
> .org%2Fmailman%2Flistinfo%2Fedk2-
> devel&data=02%7C01%7Cudit.kumar%40nxp.com%7Ca6dc7d4a80e24bad73b80
> 8d5b1ff6f28%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63661063
> 3010245207&sdata=IHWYNFk0W2OKDQ%2BYEkJFmpi14mkXJyhblAdZQK7jM%2
> B0%3D&reserved=0
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH v2 03/17] ArmPkg/Include: Add MM interface SVC return codes.
Posted by Supreeth Venkatesh 6 years, 7 months ago
On Wed, 2018-05-09 at 20:57 +0000, Udit Kumar wrote:
> 
> > 
> > -----Original Message-----
> > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf
> > Of
> > Supreeth Venkatesh
> > Sent: Saturday, May 5, 2018 2:11 AM
> > To: edk2-devel@lists.01.org
> > Cc: ard.biesheuvel@linaro.org; leif.lindholm@linaro.org; jiewen.yao
> > @intel.com;
> > liming.gao@intel.com; michael.d.kinney@intel.com
> > Subject: [edk2] [PATCH v2 03/17] ArmPkg/Include: Add MM interface
> > SVC return
> > codes.
> > 
> > This patch adds the Management Mode(MM) - Secure Partition
> > Manager(SPM)
> > SVC return codes.
> > Also, It corrects SVC ID for retrieving SPM version information.
> > 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Achin Gupta <achin.gupta@arm.com>
> > Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> > ---
> >  ArmPkg/Include/IndustryStandard/ArmMmSvc.h | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > diff --git a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
> > b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
> > index 4c7b6c3386..a64b9ec23c 100644
> > --- a/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
> > +++ b/ArmPkg/Include/IndustryStandard/ArmMmSvc.h
> > @@ -20,7 +20,7 @@
> >   * delegated events and request the Secure partition manager to
> > perform
> >   * privileged operations on its behalf.
> >   */
> > -#define ARM_SVC_ID_SPM_VERSION_AARCH64             0xC4000060
> > +#define ARM_SVC_ID_SPM_VERSION_AARCH32             0x84000060
> >  #define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64       0xC4000061
> >  #define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64   0xC4000064
> >  #define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64   0xC4000065
> > @@ -40,4 +40,11 @@
> >      ((((c_perm) & SET_MEM_ATTR_CODE_PERM_MASK) <<
> > SET_MEM_ATTR_CODE_PERM_SHIFT) | \
> >      (( (d_perm) & SET_MEM_ATTR_DATA_PERM_MASK) <<
> > SET_MEM_ATTR_DATA_PERM_SHIFT))
> > 
> > +/* MM SVC Return error codes */
> > +#define ARM_SVC_SPM_RET_SUCCESS               0
> > +#define ARM_SVC_SPM_RET_NOT_SUPPORTED        -1
> > +#define ARM_SVC_SPM_RET_INVALID_PARAMS       -2
> > +#define ARM_SVC_SPM_RET_DENIED               -3
> > +#define ARM_SVC_SPM_RET_NO_MEMORY            -5
> Please see if you want to define errors as negative.
> AFAIK, in edk2 negative errors are not used 
> 
These defines are for SPM in arm-tf (https://github.com/ARM-software/ar
m-trusted-firmware/blob/master/docs/secure-partition-manager-
design.rst#error-codes) and MM edk2 code converts these error return
codes to standard EFI error codes. 
> > 
> > +
> >  #endif
> > --
> > 2.16.2
> > 
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2F
> > lists.01
> > .org%2Fmailman%2Flistinfo%2Fedk2-
> > devel&data=02%7C01%7Cudit.kumar%40nxp.com%7Ca6dc7d4a80e24bad73b80
> > 8d5b1ff6f28%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63661063
> > 3010245207&sdata=IHWYNFk0W2OKDQ%2BYEkJFmpi14mkXJyhblAdZQK7jM%2
> > B0%3D&reserved=0
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel