Skip to content

Default psa headers implementation #9661

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

Closed
wants to merge 1 commit into from
Closed

Default psa headers implementation #9661

wants to merge 1 commit into from

Conversation

orenc17
Copy link
Contributor

@orenc17 orenc17 commented Feb 11, 2019

Description

On single core targets a default psa/client.h should be specified
psa/service.h should only be included in secure builds

Pull request type

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

Reviewers

@ARMmbed/mbed-os-psa

@orenc17 orenc17 changed the title Default psa/client.h implementation Default psa headers implementation Feb 11, 2019
#include "TARGET_MBED_SPM/psa_defs.h"
#include "TARGET_MBED_SPM/COMPONENT_SPE/spm_server.h"
#include "TARGET_MBED_SPM/COMPONENT_SPE/spm_panic.h"
#else
#error "Compiling psa service header on non-secure target is not allowed"
Copy link
Contributor

Choose a reason for hiding this comment

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

Not allowed? Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because you are not supposed to use psa/service/h in NSPE builds and non-PSA builds

Copy link
Contributor

Choose a reason for hiding this comment

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

I would call it not expected instead of not allowed. There are no rules about what symbols can be used where.

#define __MBED_OS_DEFAULT_PSA_CLIENT_API_H__

#if !defined(UINT32_MAX)
#define UINT32_MAX ((uint32_t)-1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we duplicating the header file?
Please consider moving spm_client.h and psa_defs.h to this folder instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

spm_client.h and psa_defs.h contains more defines and definitions that are not relevant for non-PSA builds (example K64F)

this "default" implementation holds only what the spec requires.

Copy link
Contributor

Choose a reason for hiding this comment

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

I do not see this default implementation gets removed from the original files. Thus it is a duplication.
Please keep in mind that our divergence from TF-M sources ( spec version) is temporal while single core API compliance is not. Eventually I would not want to duplicate the header files and would prefer adopting TF-M's version.
Please consider moving these files to a common place instead of simbols cherry picking.

@ciarmcom
Copy link
Member

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

@ciarmcom ciarmcom requested a review from a team February 11, 2019 18:00
@ciarmcom

This comment has been minimized.

1 similar comment
@ciarmcom

This comment has been minimized.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 19, 2019

@orenc17 How to progress here? There are no approvals

@orenc17
Copy link
Contributor Author

orenc17 commented Feb 19, 2019

waiting to see if #9708 might fix this

@cmonr
Copy link
Contributor

cmonr commented Feb 22, 2019

@orenc17 @alzix #9708 is now merged.

@cmonr
Copy link
Contributor

cmonr commented Feb 27, 2019

@orenc17 @alzix Any update?

@orenc17
Copy link
Contributor Author

orenc17 commented Feb 27, 2019

Integrating this into #9823

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.

7 participants