Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45942 )
Change subject: vc/amd/fsp: Update the svc call header for the Mod Exp SVC ......................................................................
vc/amd/fsp: Update the svc call header for the Mod Exp SVC
The PSP bootloader version 0.08.0B.7B added support for the Mod Exp svc call.
BUG=b:169157796 TEST=Build BRANCH=Zork
Signed-off-by: Martin Roth martinroth@chromium.org Change-Id: I1ce69c80cec77e1692cf9713a739cc4da4677da6 --- M src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h 1 file changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/45942/1
diff --git a/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h b/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h index 7cc9fd4..09100a3 100644 --- a/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h +++ b/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h @@ -35,6 +35,7 @@ #define SVC_EXIT 0x00 #define SVC_MAP_USER_STACK 0x01 #define SVC_DEBUG_PRINT 0x06 +#define SVC_MODEXP 0x0C #define SVC_RSAPSS_VERIFY 0x0D #define SVC_DEBUG_PRINT_EX 0x1A #define SVC_WAIT_10NS_MULTIPLE 0x1B @@ -59,6 +60,17 @@ #define PSP_INFO_PRODUCTION_SILICON 0x00000002UL #define PSP_INFO_VALID 0x80000000UL
+typedef struct MOD_EXP_PARAMS_T +{ + char *pExponent; // Exponent address + unsigned int ExpSize; // Exponent size in bytes + char *pModulus; // Modulus address + unsigned int ModulusSize; // Modulus size in bytes + char *pMessage; // Message address, same size as ModulusSize + char *pOuput; // Output address; Must be big enough to hold the + // data of ModulusSize +} MOD_EXP_PARAMS; + typedef struct _RSAPSS_VERIFY_PARAMS_T { char *pHash; // Message digest to verify the RSA signature @@ -384,6 +396,15 @@ */ uint32_t svc_rsa_pkcs_verify(const RSAPKCS_VERIFY_PARAMS *params);
+/* Calculate ModEx + * + * Parameters: + * mod_exp_param - ModExp parameters + * + * Return value: BL_OK or error code + */ +unsigned int svc_modexp(MOD_EXP_PARAMS *mod_exp_param); + /* C entry point for the Bootloader Userspace Application */ void Main(void);
Kangheui Won has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45942 )
Change subject: vc/amd/fsp: Update the svc call header for the Mod Exp SVC ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45942/1/src/vendorcode/amd/fsp/pica... File src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h:
https://review.coreboot.org/c/coreboot/+/45942/1/src/vendorcode/amd/fsp/pica... PS1, Line 70: char *pOuput; // Output address; Must be big enough to hold the pOutput?
Kangheui Won has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45942 )
Change subject: vc/amd/fsp: Update the svc call header for the Mod Exp SVC ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45942/1/src/vendorcode/amd/fsp/pica... File src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h:
https://review.coreboot.org/c/coreboot/+/45942/1/src/vendorcode/amd/fsp/pica... PS1, Line 406: unsigned int svc_modexp(MOD_EXP_PARAMS *mod_exp_param); Wouldn't it be better to use "uint32_t" instead of "unsigned int" for return type to match other svc APIs?
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45942 )
Change subject: vc/amd/fsp: Update the svc call header for the Mod Exp SVC ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/45942/1/src/vendorcode/amd/fsp/pica... File src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h:
https://review.coreboot.org/c/coreboot/+/45942/1/src/vendorcode/amd/fsp/pica... PS1, Line 70: char *pOuput; // Output address; Must be big enough to hold the
pOutput?
Ha. Missed that. Fixed.
https://review.coreboot.org/c/coreboot/+/45942/1/src/vendorcode/amd/fsp/pica... PS1, Line 406: unsigned int svc_modexp(MOD_EXP_PARAMS *mod_exp_param);
Wouldn't it be better to use "uint32_t" instead of "unsigned int" for return type to match other svc […]
Yes, thanks. Updated.
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45942
to look at the new patch set (#2).
Change subject: vc/amd/fsp: Update the svc call header for the Mod Exp SVC ......................................................................
vc/amd/fsp: Update the svc call header for the Mod Exp SVC
The PSP bootloader version 0.08.0B.7B added support for the Mod Exp svc call.
BUG=b:169157796 TEST=Build BRANCH=Zork
Signed-off-by: Martin Roth martinroth@chromium.org Change-Id: I1ce69c80cec77e1692cf9713a739cc4da4677da6 --- M src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h 1 file changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/45942/2
Kangheui Won has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45942 )
Change subject: vc/amd/fsp: Update the svc call header for the Mod Exp SVC ......................................................................
Patch Set 2: Code-Review+1
Eric Peers has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45942 )
Change subject: vc/amd/fsp: Update the svc call header for the Mod Exp SVC ......................................................................
Patch Set 3: Code-Review+1
LGTM. I assume actual test happens when we swap RSA for modexp
Marshall Dawson has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45942 )
Change subject: vc/amd/fsp: Update the svc call header for the Mod Exp SVC ......................................................................
Patch Set 3: Code-Review+2
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45942 )
Change subject: vc/amd/fsp: Update the svc call header for the Mod Exp SVC ......................................................................
Patch Set 3: Code-Review+2
Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/coreboot/+/45942 )
Change subject: vc/amd/fsp: Update the svc call header for the Mod Exp SVC ......................................................................
vc/amd/fsp: Update the svc call header for the Mod Exp SVC
The PSP bootloader version 0.08.0B.7B added support for the Mod Exp svc call.
BUG=b:169157796 TEST=Build BRANCH=Zork
Signed-off-by: Martin Roth martinroth@chromium.org Change-Id: I1ce69c80cec77e1692cf9713a739cc4da4677da6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/45942 Reviewed-by: Eric Peers epeers@google.com Reviewed-by: Marshall Dawson marshalldawson3rd@gmail.com Reviewed-by: Edward O'Callaghan quasisec@chromium.org Reviewed-by: Kangheui Won khwon@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h 1 file changed, 21 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Marshall Dawson: Looks good to me, approved Edward O'Callaghan: Looks good to me, approved Kangheui Won: Looks good to me, but someone else must approve Eric Peers: Looks good to me, but someone else must approve
diff --git a/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h b/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h index 7cc9fd4..93f987b 100644 --- a/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h +++ b/src/vendorcode/amd/fsp/picasso/include/bl_uapp/bl_syscall_public.h @@ -35,6 +35,7 @@ #define SVC_EXIT 0x00 #define SVC_MAP_USER_STACK 0x01 #define SVC_DEBUG_PRINT 0x06 +#define SVC_MODEXP 0x0C #define SVC_RSAPSS_VERIFY 0x0D #define SVC_DEBUG_PRINT_EX 0x1A #define SVC_WAIT_10NS_MULTIPLE 0x1B @@ -59,6 +60,17 @@ #define PSP_INFO_PRODUCTION_SILICON 0x00000002UL #define PSP_INFO_VALID 0x80000000UL
+typedef struct MOD_EXP_PARAMS_T +{ + char *pExponent; // Exponent address + unsigned int ExpSize; // Exponent size in bytes + char *pModulus; // Modulus address + unsigned int ModulusSize; // Modulus size in bytes + char *pMessage; // Message address, same size as ModulusSize + char *pOutput; // Output address; Must be big enough to hold the + // data of ModulusSize +} MOD_EXP_PARAMS; + typedef struct _RSAPSS_VERIFY_PARAMS_T { char *pHash; // Message digest to verify the RSA signature @@ -384,6 +396,15 @@ */ uint32_t svc_rsa_pkcs_verify(const RSAPKCS_VERIFY_PARAMS *params);
+/* Calculate ModEx + * + * Parameters: + * mod_exp_param - ModExp parameters + * + * Return value: BL_OK or error code + */ +uint32_t svc_modexp(MOD_EXP_PARAMS *mod_exp_param); + /* C entry point for the Bootloader Userspace Application */ void Main(void);