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

Move ResetVector to a dedicated crate #73

Draft
wants to merge 4 commits into
base: staging
Choose a base branch
from

Conversation

jiangliu
Copy link
Member

@jiangliu jiangliu commented Feb 5, 2022

Move ResetVector to a dedicated crate

@jyao1
Copy link
Member

jyao1 commented Feb 5, 2022

Any special reason to introduce a new crate?

I have concern because then we need document multiple interfaces, such as BSP->C code, mailbox wakeup etc.

Separate TDX ResetVector into a dedicate crate tdx-bootstrap, so the
td-shim could be platform indenpendent.

Signed-off-by: Liu Jiang <[email protected]>
Move code from rust-tdshim/ResetVector into tdx-bootstrap.

Signed-off-by: Liu Jiang <[email protected]>
Minor doc and syntax changes.

Signed-off-by: Liu Jiang <[email protected]>
Define constants which may used by td-shim.

Signed-off-by: Liu Jiang <[email protected]>
@jiangliu
Copy link
Member Author

jiangliu commented Feb 5, 2022

Any special reason to introduce a new crate?

I have concern because then we need document multiple interfaces, such as BSP->C code, mailbox wakeup etc.

The idea is to isolate platform dependent code from platform independent code.
We have three major td modules: bootstrap, shim and payload.
The payload should be platform independent, logically.
By splitting bootstrap from td-shim, the td-shim may become platform independent too.

So the tdx-bootstrap will host ResetVector and other TDX specific code, and we may use feature to control platform dependent code in td-shim:)

@jyao1
Copy link
Member

jyao1 commented Feb 5, 2022

td-shim may become platform independent too.

Personally, I feel it is an overdesign and I am not sure if it is feasible.
For example, the ParkAp code in reset vector is bound to tdshim mp.rs.

I am OK to rename and refactoring.

But I don't think we need create a dedicated crate - at least not at this moment.

@jiangliu jiangliu marked this pull request as draft February 6, 2022 14:39
@jyao1
Copy link
Member

jyao1 commented Feb 10, 2022

@jiangliu , Do you want to keep the refactoring work, just drop the standalone crate?

I do see the value for the refactoring work.

@jiangliu
Copy link
Member Author

@jiangliu , Do you want to keep the refactoring work, just drop the standalone crate?

I do see the value for the refactoring work.

I still hope to split out the reset vector as td-bootstrap or tdx-bootstrap:)
What's your thoughts here?

@jyao1
Copy link
Member

jyao1 commented Feb 11, 2022

I think we can isolate the code. Or any refactoring/rename is welcome.

My concern is to create a standalone crate, because a standalone crate means a clear interface.

If we really really want to create a standalone crate, I think we must document in td-bootstrap clearly, including but not limited to:

  1. MP wakeup API
  2. memory usage and readiness
  3. stack/heap state
  4. TD-SHIM spec dependency

That becomes a mini Td-Shim spec ...

@jodh-intel
Copy link
Member

Hi @jiangliu - what do we need to do to progress this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants