-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plat-nuvoton: configuration change #6181
Conversation
Please rebase this on the upstream master branch to resolve the conflicts. |
Done |
fa24cfc
to
fc9c8e5
Compare
@rutigl you really need to learn how to use Git, GitHub and write proper commit subjects and descriptions. Otherwise your pull requests will take a long time to get reviewed and merged. |
5f9c304
to
2a45dab
Compare
Agree, I have not a big experience in GitHub PRs. Please tell me what to improve in current commits and I'll fix it |
dbe2106
to
8c26f4f
Compare
I had other comments but you force pushed new commits while I was reviewing so I lost them. As mentioned in the documentation, the preferred way to address comments is to push fixup commits that are squashed in the end. And before squashing/force pushing, write a comment asking if it is OK to do so. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments on "plat-nuvoton: add HUK reading"
core/arch/arm/plat-nuvoton/main.c
Outdated
|
||
TEE_Result tee_otp_get_hw_unique_key(struct tee_hw_unique_key *hwkey) | ||
{ | ||
void *vaddr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
= NULL;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
core/arch/arm/plat-nuvoton/main.c
Outdated
{ | ||
void *vaddr; | ||
TEE_Result res = TEE_SUCCESS; | ||
uint8_t buf[NPCM_MEASURE_SIZE] = {0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
= { };
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
core/arch/arm/plat-nuvoton/main.c
Outdated
return TEE_ERROR_SECURITY; | ||
} | ||
|
||
memcpy(buf, vaddr, NPCM_MEASURE_SIZE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this memcpy()
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, could be copied directly from vaddr
core/arch/arm/plat-nuvoton/main.c
Outdated
void *vaddr; | ||
TEE_Result res = TEE_SUCCESS; | ||
uint8_t buf[NPCM_MEASURE_SIZE] = {0}; | ||
uint32_t bin[1 + HW_UNIQUE_KEY_LENGTH / sizeof(uint32_t)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
= { };
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
core/arch/arm/plat-nuvoton/main.c
Outdated
return TEE_ERROR_SECURITY; | ||
} | ||
|
||
memcpy(&hwkey->data[0], bin, HW_UNIQUE_KEY_LENGTH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bin[0]
is garbage at this point, isn't it? (well it will be 0 if you initialize bin[]
properly as requested above, but is this intended?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, fixed
|
||
memcpy(&hwkey->data[0], bin, HW_UNIQUE_KEY_LENGTH); | ||
|
||
IMSG("HUK Initialized"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Initialized" sounds like this is something done only once but it isn't the case because tee_otp_get_hw_unique_key()
may be called multiple times in case huk_subkey_derive()
is called several times. So either this message has to be removed, or the HUK should be made static and computed only once (which might be the better option since it should not change anyways).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know, that this function is called several times, so I have changed the logic accordingly.
The subject of the second "plat-nuvoton: configuration change" commit should be "platf-nuvoton: force CFG_EXTERNAL_DT=n". With that it is: |
The subject of the first "plat-nuvoton: configuration change" commit should be more precise: |
Changes load address of OPTEE-OS from 0x36000000 to 0x02100000 Moves shared memory to 0x06000000 Moves SDP memory to 0x05F00000 Co-developed-by: Hila Miranda-Kuzi <hila.miranda.kuzi1@gmail.com> Signed-off-by: Hila Miranda-Kuzi <hila.miranda.kuzi1@gmail.com> Signed-off-by: Margarita Glushkin <rutigl@gmail.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Implements HUK reading from DME PCR0 located in the PCI mailbox Co-developed-by: Hila Miranda-Kuzi <hila.miranda.kuzi1@gmail.com> Signed-off-by: Hila Miranda-Kuzi <hila.miranda.kuzi1@gmail.com> Signed-off-by: Margarita Glushkin <rutigl@gmail.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Disables DT insecure warning Co-developed-by: Hila Miranda-Kuzi <hila.miranda.kuzi1@gmail.com> Signed-off-by: Hila Miranda-Kuzi <hila.miranda.kuzi1@gmail.com> Signed-off-by: Margarita Glushkin <rutigl@gmail.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
It looks like this is ready to be merged. |
Indeed! |
Changes load address of OPTEE-OS from 0x36000000 to 0x02100000
Implements HUK reading from DME PCR0 located in PCI mailbox
Disables DT insecure warning