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

Add missing commands #7

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

SammyOina
Copy link

@SammyOina SammyOina commented Sep 18, 2024

  • New Features

    • Introduced support for multiple SEV modes.
    • Added command-line options for calculating OVMF hashes and managing SEV guest launch measurements.
    • New functions for calculating launch digests and managing SEV hash tables.
  • Improvements

    • Enhanced memory management in the OVMF module with new fields and methods.
    • Improved error handling and user feedback in command-line interfaces.
  • Bug Fixes

    • Adjusted function signatures for better initialization and configuration of objects.
  • Documentation

    • Added string representations for VMM types to improve usability in logging and debugging.

@derpsteb
Copy link
Member

Nice, thanks for the contribution! I will take a look once you request a review :).

@SammyOina SammyOina changed the title WIP - Add missing commands Add missing commands Nov 7, 2024
@SammyOina
Copy link
Author

Nice, thanks for the contribution! I will take a look once you request a review :).

@derpsteb this is ready for review

@SammyOina SammyOina marked this pull request as draft November 7, 2024 17:42
@SammyOina SammyOina marked this pull request as ready for review November 7, 2024 17:43
@derpsteb
Copy link
Member

Sorry I was away from my laptop for a few weeks. Will pick this up on Monday.

Copy link
Member

@derpsteb derpsteb left a comment

Choose a reason for hiding this comment

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

hey, went over the bigger part, looks great so far! need to finish the rest tomorrow. only some small comments.

one thing missing is some e2e test for the added functionality. but I think this needs to be done in CI because we need to build ovmf and svsm binaries for that. maybe you can have a look at upstream_test.go - if you have a good idea how to build a similar test for some of the new features it would be much appreciated. (the ovmf.New call in upstream_test.go also needs to be fixed.)

one general thing: could you see that the contents of a file are ordered like this?

  • Constants and variables
  • Exported functions
  • Exported types followed by their new funcs, exported methods, and unexported methods, i.e.
  • Unexported functions
  • Unexported types and their methods

I will mention this expectation in the readme for future contributions.

thanks again for your work.

sevsnpmeasure/cmd/root.go Outdated Show resolved Hide resolved
sevsnpmeasure/cmd/root.go Outdated Show resolved Hide resolved
sevsnpmeasure/cmd/root.go Outdated Show resolved Hide resolved
vmsa/vmsa.go Outdated Show resolved Hide resolved
return VMSA_SVSM{SaveArea: saveArea}, nil
}

func BuildSaveAreaSVSM(eip uint32, sevFeatures uint64, vcpuSig uint64, vmmType vmmtypes.VMMType) (SevEsSaveArea, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
func BuildSaveAreaSVSM(eip uint32, sevFeatures uint64, vcpuSig uint64, vmmType vmmtypes.VMMType) (SevEsSaveArea, error) {
func (VMSA_SVSM) BuildSaveArea(eip uint32, sevFeatures uint64, vcpuSig uint64, vmmType vmmtypes.VMMType) (SevEsSaveArea, error) {

the original BuildSaveArea should also be a method of VMSA. but I can do that in a separate PR.

Copy link
Author

Choose a reason for hiding this comment

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

I'll leave that for another PR

SevFeatures: sevFeatures,
Xcr0: 0x1,
Mxcsr: mxcsr,
X87Fcw: fcw,
Copy link
Member

Choose a reason for hiding this comment

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

the original code is referencing a field fcw here. but I can't find it in SevEsSaveArea. Could you make sense of that?

Copy link
Author

Choose a reason for hiding this comment

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

I did not see where it was used outside the package but the value is saved on x87Fcw

Signed-off-by: Sammy Oina <[email protected]>
Signed-off-by: Sammy Oina <[email protected]>
Signed-off-by: Sammy Oina <[email protected]>
Signed-off-by: Sammy Oina <[email protected]>
Signed-off-by: Sammy Oina <[email protected]>
Signed-off-by: Sammy Oina <[email protected]>
Signed-off-by: Sammy Oina <[email protected]>
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.

2 participants