Skip to content

Add PSA build components to build configuration for non-PSA targets #8680

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

Merged
merged 1 commit into from
Nov 15, 2018
Merged

Add PSA build components to build configuration for non-PSA targets #8680

merged 1 commit into from
Nov 15, 2018

Conversation

orenc17
Copy link
Contributor

@orenc17 orenc17 commented Nov 8, 2018

Description

  • Added PSA components to base Target in targets.json
  • This is the first PR in a series of PSA related PR's
  • The main purpose of this PR is to allow integration with PSA-Crypto

Full list of components and assignment to targets is listed below:

Label \ Core V7-single
[Target]
V7-dual NSPE
[NSPE_Target]
V7-dual SPE
[SPE_Target]
V8-NS
[NSPE_Target]
V8-S
[SPE_Target]
PSA_SRV_IMPL V V V
PSA_SRV_EMUL V
PSA_SRV_IPC V V V V
SPE V V
NSPE V V V
SPM_MAILBOX V V
SPM_MAILBOX/NSPE V
SPM_MAILBOX/SPE V
  • PSA_SRV_IMPL - include secure service business logic implementation code. For example mbedCrytpo or secure time core logic
  • PSA_SRV_EMUL - include a wrapper code for non-PSA platforms, that provides PSA API compliance, by directly invoking code from PSA_SRV_IMPL
  • PSA_SRV_IPC - include a wrapper code for PSA platforms that calls IPC PSA API for invoking PSA_SRV_IMPL in SPE
  • SPE - include code that compiles ONLY to secure image and never compiles to non-secure image
  • NSPE - include code that compiles ONLY to snon-secure image and never compiles to secure image
  • SPM_MAILBOX - include mailbox driver implementation code for multicore targets

Pull request type

[ ] Fix
[ ] Refactor
[X] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@theotherjimmy @Patater @alzix

Copy link
Contributor

@Patater Patater left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks okay, but the commit message should explain how this works and why the default target gets the values it does.

Are any tests needed to check this is working as expected? What if someone adds a new target and they use "components" instead of "components_add"? It seems a bit fragile in that regard.

@alzix
Copy link
Contributor

alzix commented Nov 9, 2018

@Patater, components_add is the best we came up with with current configuration system. If onyobe have better ideas, please do share, we are open for suggestions.

Regarding tests, it was tested manually. I do not see how you can we test configuration changes automatically. The changes are in configuration and not in the parser code.

Regarding the commit message, @orenc17, can you please reword commit message.

Copy link
Contributor

@alzix alzix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mikisch81
Copy link
Contributor

@Patater, the problem you raise can already happen with this inheritance scheme, take for example the FAMILY_STM32 target, it defines 'extra_labels': ["STM'], any target which inherits FAMILY_STM32 might override it if it does 'extra_labels' instead of'extra_labels_add'. So as Alex pointed out this is the best (and least invasive) solution we found for integrating PSA with the mbed black-list approach.

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me.

@Patater
Copy link
Contributor

Patater commented Nov 9, 2018

My testing concern is not about testing this as-is, but testing for regressions introduced by new targets that don't know they shouldn't use "components".

As @mikisch81 points out, it seems we also need a test for extra_labels regressions as well, but that's out of scope of this PR.

Another issue is that the commit message isn't up to our standards (https://os.mbed.com/docs/latest/reference/workflow.html#guidelines-for-github-pull-requests)

@cmonr cmonr requested a review from a team November 9, 2018 23:52
@cmonr
Copy link
Contributor

cmonr commented Nov 9, 2018

I too am confused by the difference between components vs ``components_add`.

Would it be possible to clarify?

@alzix
Copy link
Contributor

alzix commented Nov 10, 2018

@cmonr,
We have sort of inheritance of configurations in our targets.json
Descendents can either override parent values or extend it.

  • "components" are the property name. Thus using it will override the set specified by parent.
  • "components_add" used to extend the list specified by parent by appending new values to it.

@alzix
Copy link
Contributor

alzix commented Nov 10, 2018

I want to emphasize that the PR only configures targets slightly different ba adding PSA related components to default target. This may seem unclear for now, as this is a initial commit for allowing integration with other modules. You can take a look at https://github.com/kfnta/mbed-os/tree/feature-psa for more details.
The idea to provide an infrastructure for partitioning mbed-os sources for building different set of sources for secure and non-secure core images.

@NirSonnenschein
Copy link
Contributor

Work seems to have been addressed:
/morph build

@mbed-ci
Copy link

mbed-ci commented Nov 11, 2018

Build : SUCCESS

Build number : 3597
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8680/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Nov 11, 2018

@mbed-ci
Copy link

mbed-ci commented Nov 11, 2018

@NirSonnenschein
Copy link
Contributor

re-try for seemingly unrelated network issue:
/morph build

@mikisch81
Copy link
Contributor

re-try for seemingly unrelated network issue:

I checked locally and network-interface test also fails on mbed-os master branch.

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 12, 2018

restarting the build

/morph build

@mbed-ci
Copy link

mbed-ci commented Nov 12, 2018

Build : SUCCESS

Build number : 3600
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8680/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Nov 12, 2018

@mikisch81
Copy link
Contributor

@0xc0170 @NirSonnenschein guys is it safe now to re-trigger the tests?

@NirSonnenschein
Copy link
Contributor

@mikisch81 unfortunately CI is still not stable yet, we will try to re-run as soon as it is working as expected.

@cmonr
Copy link
Contributor

cmonr commented Nov 13, 2018

/morph build

@cmonr
Copy link
Contributor

cmonr commented Nov 13, 2018

@Patater

As @mikisch81 points out, it seems we also need a test for extra_labels regressions as well, but that's out of scope of this PR.

This would make for a good issue topic so that we can track and assign work to it.
Also, if that's you're last witholding, could you mark your review as good?

@alzix Thanks for the clarification on the difference between labels. Should we expect any kind of documentation around the new label?

@mbed-ci
Copy link

mbed-ci commented Nov 14, 2018

Build : SUCCESS

Build number : 3614
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8680/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Nov 14, 2018

@cmonr
Copy link
Contributor

cmonr commented Nov 14, 2018

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Nov 14, 2018

@mbed-ci
Copy link

mbed-ci commented Nov 14, 2018

* Added PSA components to base Target in targets.json
* Fix all targets declaring components
@mikisch81
Copy link
Contributor

Rebased on top of master branch

@NirSonnenschein
Copy link
Contributor

/morph build

@mbed-ci
Copy link

mbed-ci commented Nov 14, 2018

Build : SUCCESS

Build number : 3617
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8680/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@adbridge
Copy link
Contributor

@Patater Could you please check if you are now happy with these changes ?

@mbed-ci
Copy link

mbed-ci commented Nov 14, 2018

@mbed-ci
Copy link

mbed-ci commented Nov 14, 2018

@mikisch81
Copy link
Contributor

@cmonr So it can be merged, there are a couple of PRs dependent on this PR.

Copy link
Contributor

@alzix alzix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@0xc0170 0xc0170 merged commit 1ac4d9b into ARMmbed:master Nov 15, 2018
@cmonr
Copy link
Contributor

cmonr commented Nov 20, 2018

#8730 (comment)

@ARMmbed/mbed-os-maintainers According to this description, this appears like it came in too soon?

Fingers crossed that's not the case.

@mikisch81
Copy link
Contributor

mikisch81 commented Nov 20, 2018

#8730 (comment)

@ARMmbed/mbed-os-maintainers According to this description, this appears like it came in too soon?

Fingers crossed that's not the case.

That's not the case, the 2 PRs are not dependent, the kvstore PR has nothing to do with this PR.

@mikisch81 mikisch81 deleted the initial_components branch December 2, 2018 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants