Skip to content

Additions to TF-M source integration #9772

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 4 commits into from
Feb 21, 2019
Merged

Additions to TF-M source integration #9772

merged 4 commits into from
Feb 21, 2019

Conversation

mikisch81
Copy link
Contributor

@mikisch81 mikisch81 commented Feb 20, 2019

Description

  • Add common TF-M mbed_lib.json in addition to the secure-side mbed_lib.json.
  • Add TF-M defines to mbed_app.json.
  • Update list of SHAs in TF-M importer json.
  • Add image signing scripts from TF-M bl2 library, which is used by targets ported to TF-M
    • These scripts are used by Musca_a1 (and probably) more targets which will use TF-M as their Secure Kernel.

Pull request type

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

Reviewers

@orenc17

Release Notes

@mikisch81 mikisch81 changed the title Tfm extras Additions to TF-M source integration Feb 20, 2019
@ciarmcom ciarmcom requested review from orenc17 and a team February 20, 2019 12:00
@ciarmcom
Copy link
Member

@mikisch81, thank you for your changes.
@orenc17 @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

"value": 20
},
"message_pool_size": {
"help": "maximum number of RoT services allowed",
Copy link
Contributor

Choose a reason for hiding this comment

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

help - typo? same as previous one

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed

}
}
"name": "tfm-s",
"macros": ["MBED_FAULT_HANDLER_DISABLED", "BYPASS_NVSTORE_CHECK=1"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it appropriate to disable the fault handler in a library? I looked for a justification for this change in the commit message but I didn't find one.

Copy link
Contributor

Choose a reason for hiding this comment

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

when building TFM we are not using parts of mbed-os
Some of those parts are the fault handlers, and this is because TFM implements their own

Copy link
Contributor

Choose a reason for hiding this comment

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

Good enough for me!

@orenc17
Copy link
Contributor

orenc17 commented Feb 20, 2019

@ARMmbed/mbed-os-maintainers can this start CI please ?

@mikisch81
Copy link
Contributor Author

@orenc17 let's wait for @bridadan approval

}
}
"name": "tfm-s",
"macros": ["MBED_FAULT_HANDLER_DISABLED", "BYPASS_NVSTORE_CHECK=1"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Good enough for me!

@cmonr
Copy link
Contributor

cmonr commented Feb 20, 2019

CI started

@cmonr cmonr dismissed 0xc0170’s stale review February 20, 2019 19:17

Please rereview. Changes applied.

@mbed-ci
Copy link

mbed-ci commented Feb 20, 2019

Test run: SUCCESS

Summary: 12 of 12 test jobs passed
Build number : 1
Build artifacts

@NirSonnenschein
Copy link
Contributor

@0xc0170 , this has now passed CI, please re-review the fix for your comments so this can be "ready"

@orenc17
Copy link
Contributor

orenc17 commented Feb 20, 2019

@0xc0170 , this has now passed CI, please re-review the fix for your comments so this can be "ready"

@cmonr i think you got competition for the MOTR award

],
"config": {
"level": {
"help": "TFM security level",
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this suppose to mean?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is one TFM properties
security level is corresponding with PSA memory separation level desired

This is an internal TFM config, and a prep for the future when we will have a greater level of memory separation.

@mikisch81
Copy link
Contributor Author

Added another commit which was cherry-picked from #9221.
It adds image signing scripts from TF-M bl2 library which are used by Musca_a1 post-build hook.
Because more targets which will use TF-M as their Secure Kernel may use these scripts I moved the commit here in order to remove dependency on the Musca PR.
@bridadan can you re-review?

Copy link
Contributor

@bridadan bridadan left a comment

Choose a reason for hiding this comment

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

It's generally ok since I've already reviewed these files. However, my understanding is these scripts are scraping addresses from a flash_layout.h file. We do not scrape info from source files in Mbed OS. We use the configuration system for this and then generate the macros that can be used in the code base. If the intention is to reuse these scripts across targets, I think this needs to be revisited in the future.

if m is not None:
ramLoadAddress = int(m.group(1), 0)
print("**[INFO]** Writing load address from the macro in "
"flash_layout.h to the image header.. "
Copy link
Contributor

Choose a reason for hiding this comment

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

In the future, if this script is going to be reused by other targets, we should be moving "configuration" into the targets.json/mbed_lib.json, not scraping it from the flash_layout.h file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I absolutely agree, this is something we are aware of and will try to use this in the Musca PR

Copy link
Contributor

Choose a reason for hiding this comment

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

@mikisch81 @orenc17 Can y'all make and link a Jira issue so that we don't lose this conversation?

We'll start CI in the meanwhile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cmonr
Copy link
Contributor

cmonr commented Feb 21, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 21, 2019

Test run: SUCCESS

Summary: 12 of 12 test jobs passed
Build number : 2
Build artifacts

@cmonr cmonr merged commit 77591fb into ARMmbed:master Feb 21, 2019
@cmonr cmonr removed the needs: CI label Feb 21, 2019
@mikisch81 mikisch81 deleted the tfm_extras branch February 25, 2019 15:38
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.

8 participants