microsoft / microsoft/igvm

igvm: move VMSA & other arch-only definitions outside of crate

Open
#116 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
155
Forks
42
Avg merge
23h 53m
Merged PRs (30d)
3

Description

Architectural definitions should not live in this crate unless they're necessary, to avoid needing to update them as new hardware/capabilities arrive. For the most part, only the raw binary data is needed. This applies to VMSA and potentially other things inside this crate.

Jon and I discussed this offline that I think it might make more sense to move away from defining some of these architectural definitions in the igvm and igvm_defs crate themselves, and defer to just being an opaque type outside of bits we need within IGVM itself. For example, we think that we might need sev_features for some CoRIM validation in the future, but we'd mark the rest of the fields as reserved, and leave it as convertible to a 4K u8 slice via IntoBytes/FromBytes.

I think this would apply to quite a few things in this crate so I need to sit down and find some time to refactor this, but would mean every time hardware changes/adds a new feature, we're not required to add all these definitions because IGVM shouldn't be the authoritative definition for specific hardware.

This does mean consumers of this crate will need to carry their own definition of hardware specific fields, but I think that's fine. I wonder if we should have a snp_defs crate in this case that consumers can use?

Thoughts?

See #109 for initial discussion.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the initial discussion in #109 and auditing the VMSA and other architecture-specific definitions in the igvm and igvm_defs crates. Identify which raw fields IGVM needs, including possible sev_features data and IntoBytes/FromBytes handling; done means the unnecessary hardware definitions are no longer authoritative crate definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.