Skip to content
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

tee-supplicant: Allow to control RPMB emulation during runtime #354

Closed
wants to merge 1 commit into from

Conversation

jan-kiszka
Copy link

This permits to build with RPMB_EMU=1 without breaking real usage. Specifically helpful for distros. Closes #353.

Still testing, thus "draft".

Copy link
Contributor

@jforissier jforissier left a comment

Choose a reason for hiding this comment

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

LGTM overall.

The comment in the Makefile should preferably be adjusted because the meaning of RPMB_EMU changes slightlty (from "use RPMB emulation" to "support RPMB emulation and use it when --rpmb-emu is given). The wording in CMakeLists.txt is fine though.

-# Emulate RPMB ioctl's by default
+# Support RPMB emulation by default (--rpmb-emu command line argument)
 RPMB_EMU ?= 1

@@ -890,7 +887,13 @@ static uint32_t rpmb_data_req(int fd, struct rpmb_data_frame *req_frm,
goto out;
}

st = IOCTL(fd, MMC_IOC_MULTI_CMD, mcmd);
if (use_rpmb_emu()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure it is very helpful to modify all the call sites to test for emu enabled. In this particular case we could define a ioctl wrapper for example do_ioctl() which would call either ioctl() or ioctl_emu().

Copy link
Author

Choose a reason for hiding this comment

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

We don't have multiple call sites for those, that's why I left the if-else there and didn't add another level of wrappers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yes, I see what you mean. Please disregard my comment then.

This permits to build with RPMB_EMU=1 without breaking real usage.
Specifically helpful for distros.

Signed-off-by: Jan Kiszka <[email protected]>
@jenswi-linaro
Copy link
Contributor

Please add something about the new --rpmb-emu command line option in the commit message.

@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale label Sep 28, 2023
@jan-kiszka
Copy link
Author

Continued by #355

@jan-kiszka jan-kiszka closed this Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make RPMB_EMU a runtime switch
3 participants