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

SNP Guest VSM: Start VP hypercall handling #634

Merged
merged 5 commits into from
Feb 26, 2025

Conversation

sluck-msft
Copy link
Contributor

Start VP hypercall handling for SNP Guest VSM support.

Tested:

  • SNP + Guest VSM boots 8 VPs
  • SNP without Guest VSM boots
  • non-isolated VM still boots

@sluck-msft sluck-msft requested a review from a team as a code owner January 8, 2025 22:52
@sluck-msft sluck-msft force-pushed the gvsm/start-vp branch 2 times, most recently from 88a2f71 to b6b0a88 Compare February 25, 2025 23:06
@@ -420,6 +420,8 @@ pub struct UhCvmVpInner {
tlb_lock_info: VtlArray<TlbLockInfo, 2>,
/// Whether VTL 1 has been enabled on the vp
vtl1_enabled: Mutex<bool>,
/// Whether the VP has been started via the StartVp hypercall.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense for vtl1_enabled to be a ReadWriteLock instead of a Mutex? It seems like we have a lot of paths that read it, but only one that needs to write to it and have exclusive access.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jstarks I think in the past you've said that RwLocks don't scale to a large number of processors, so I interpreted that as be careful when using them. Do you have general guidelines for when you would choose to use or not use a RwLock? Beyond basing it off the ratio of expected readers to writers?

@sluck-msft sluck-msft enabled auto-merge (squash) February 26, 2025 23:02
@sluck-msft sluck-msft merged commit e05da3a into microsoft:main Feb 26, 2025
25 checks passed
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