-
Notifications
You must be signed in to change notification settings - Fork 237
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
libteec: Move OP-TEE defined fields into an imp struct #349
libteec: Move OP-TEE defined fields into an imp struct #349
Conversation
The automatic tests fail but that has been solved in the following pull request OP-TEE/optee_test#684 |
This LGTM, but as mentioned in #348, it changes the layout of |
This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time. |
This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time. |
@JLLinaro would you mind updating this PR so we can merge it? |
@jenswi-linaro version is now updated to 2.0.0 |
We need |
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.
Acked-by: Etienne Carriere <[email protected]>
for commit
"libteec: Move OP-TEE defined fields into an imp struct"
(with indentation issue fixed)
public/tee_client_api.h
Outdated
bool dummy; | ||
uint8_t flags; | ||
} internal; | ||
} imp; |
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.
fix indentation
Please squash the second commit into the first one (and keep subject "libteec: Move OP-TEE defined fields into an imp struct"). |
dbe8282
to
c004dbb
Compare
There is a conflict, would you please rebase onto master, and also add the Acked-by: tags from Etienne and me? |
c004dbb
to
b3c0606
Compare
libteec/include/tee_client_api.h
Outdated
@@ -384,8 +388,10 @@ typedef union { | |||
*/ | |||
typedef struct { | |||
/* Implementation defined */ | |||
TEEC_Context *ctx; | |||
uint32_t session_id; | |||
struct{ |
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.
Please add a space (
), between struct
and {
.
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.
@JLLinaro comment not addressed
Ping @JLLinaro |
libteec/include/tee_client_api.h
Outdated
union { | ||
bool dummy; | ||
uint8_t flags; | ||
} internal; |
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.
Is the dummy
field still needed following this change? dummy
was introduced in 4f3d4cb not to break the ABI. Here we are breaking it anyway, so while at it, I suggest some clean up:
union { | |
bool dummy; | |
uint8_t flags; | |
} internal; | |
uint32_t flags; |
N.B.: If there is a wish to keep more flag bits for future use, then just declare flags
as uint32_t
(the structure will be padded anyway, so you will not make it any bigger).
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 agree. uint32_t flags;
LGTM.
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.
@JLLinaro comment not addressed
This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time. |
@JLLinaro any chance this could make it into the next release? (-rc1 is in 3 days). On the other hand, I am now wondering if this is a good idea. Who cares about this? Sure it is in the spec, but what difference does it make? Apps are not supposed to manipulate the |
The answer to your question is in #348 |
Ah, yes. It would be nice to mention in the commit description that the |
This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time. |
I think we need to explain to @JLLinaro that it's going to cost him a beer each time github reminds us that it's not done yet. :-) |
This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time. |
6e9f710
to
7d2763f
Compare
libteec/include/tee_client_api.h
Outdated
union { | ||
uint32_t flags; | ||
} internal; |
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.
The union should not be needed, just make this uint32_t flags;
.
GlobalPlatform TEE Client API Specification v1.0 specifies that the structs TEEC_Context, TEEC_Session, TEEC_SharedMemory, and TEEC_Operation shall have a user defined struct named imp. In OP-TEE the struct is not there and instead the user defined fields are declared directly in the top structs. This commit introduces the imp struct to better support using different implementations. The imp fields now represent the implementation defined parts of the structs that was previously declared directly in the top struct. All previously available parameters are preserved in the imp struct. The updated version of the imp structure makes it easier to create a binding for Rust. Adding the missing imp struct to the structs in OP-TEE is an ABI breakage which requires a version major update of libteec as explained by Jerome Forissier. Link: OP-TEE#348 Reported-by: Tom Hebb <[email protected]> Signed-off-by: Julianus Larson <[email protected]> Acked-by: Etienne Carriere <[email protected]> Acked-by: Jerome Forissier <[email protected]> Fixed spacing Signed-off-by: Julianus Larson <[email protected]>
7d2763f
to
ea8d960
Compare
Merged manually (with commit message slightly edited). |
GlobalPlatform TEE Client API Specification v1.0 specifies that the structs TEEC_Context, TEEC_Session, TEEC_SharedMemory, and TEEC_Operation shall have a user defined struct named imp. In OP-TEE the struct is not there and instead the user defined fields are declared directly in the top structs.
This commit introduces the imp struct to better support using different implementations. The imp fields now represent the implementation defined parts of the structs that was previously declared directly in the top struct. All previously available parameters are preserved in the imp struct.
Link: #348
Reported-by: Tom Hebb [email protected]