Skip to content

virt_mshv_vtl: add inspection support for cvm cpuid tables #1048

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

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

Conversation

chris-oo
Copy link
Member

These weren't inspectable before.

I think though, that there's probably some more to do here - the raw value themselves aren't always what the guest will see since there's some runtime state that gets modified with the table. This is at least a starting point though.

@chris-oo chris-oo requested a review from a team as a code owner March 17, 2025 20:59
@chris-oo chris-oo changed the title virt_mshv_vtl: add inspection support for cpuid tables virt_mshv_vtl: add inspection support for cvm cpuid tables Mar 17, 2025
inspect::iter_by_key(
table
.iter()
.map(|(key, value)| (format!("{:?} ({:x})", key, key.0), value)),
Copy link
Member

Choose a reason for hiding this comment

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

Can we just make the key the hex value in both cases? I don't want spaces and parens and open_enum identifiers in keys.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah we can just make it the hex key, i found it useful to have both (but that's because i just started looking at cpuid so i don't have the idents memorized)

@@ -178,8 +179,11 @@ pub struct ParsedCpuidEntry {
}

/// Prepares and caches the results that should be returned for hardware CVMs.
#[derive(Inspect)]
pub struct CpuidResults {
Copy link
Member

Choose a reason for hiding this comment

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

I still want this whole thing merged with the non-CVM cpuid handling. We shouldn't have two completely different table formats.

But anyway, that's certainly out of scope for this change.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree - it's really annoying that they're completely different.

inspect::iter_by_key(
table
.iter()
.map(|(key, value)| (format!("{:x?}", key), cpuid_result(value))),
Copy link
Member

Choose a reason for hiding this comment

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

Seems like it should be :#x and not :x?

@chris-oo
Copy link
Member Author

I'm going to hold of updating this until John's refactor PR is in - I don't know if we still need it?

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