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

Wire up bits for CPUID customization #524

Closed
wants to merge 1 commit into from

Conversation

pfmooney
Copy link
Collaborator

This is a first cut at making CPUID information customizable, rather than using the in-kernel vmm logic which applies limited transformations to the data exposed by the host CPU. Basic plumbing in propolis-lib is provided, which is wired into propolis-standalone. The same configuration syntax is defined for propolis-server, but it is going unused for now until some internal structure is hammered out.

@pfmooney pfmooney requested a review from gjcolombo September 15, 2023 19:53
crates/bhyve-api/sys/src/structs.rs Outdated Show resolved Hide resolved
crates/cpuid-profile-config/src/lib.rs Outdated Show resolved Hide resolved
bin/propolis-standalone/src/config.rs Outdated Show resolved Hide resolved
lib/propolis/src/vcpu.rs Show resolved Hide resolved
lib/propolis/src/cpuid.rs Outdated Show resolved Hide resolved
lib/propolis/src/cpuid.rs Show resolved Hide resolved
lib/propolis/src/cpuid.rs Show resolved Hide resolved
TopoKind::StdB => {
// Queries with invalid ecx will get all-zeroes
set.insert(Ident(leaf, None), Entry::zero());
if self.has_smt {
Copy link
Contributor

Choose a reason for hiding this comment

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

Related to the above: if I want to test a guest OS with a zany set of outputs from a topology leaf, and I write a config file accordingly, and Propolis runs this logic, my settings will be silently overwritten. Should this return an error instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've tweaked the leaf clearing behavior. LMK if that's fine for now.

lib/propolis/src/cpuid.rs Outdated Show resolved Hide resolved
lib/propolis/src/cpuid.rs Show resolved Hide resolved
Copy link
Contributor

@gjcolombo gjcolombo left a comment

Choose a reason for hiding this comment

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

Looking good, just a couple of things I want to make absolutely sure I'm grokking.

lib/propolis/src/cpuid.rs Show resolved Hide resolved
lib/propolis/src/cpuid.rs Show resolved Hide resolved
lib/propolis/src/cpuid.rs Show resolved Hide resolved
Copy link
Contributor

@gjcolombo gjcolombo left a comment

Choose a reason for hiding this comment

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

Let's roll!

This is a first cut at making CPUID information customizable, rather
than using the in-kernel vmm logic which applies limited transformations
to the data exposed by the host CPU.  Basic plumbing in propolis-lib is
provided, which is wired into propolis-standalone.  The same
configuration syntax is defined for propolis-server, but it is going
unused for now until some internal structure is hammered out.
@pfmooney
Copy link
Collaborator Author

Merged in c996261

@pfmooney pfmooney closed this Sep 27, 2023
@pfmooney pfmooney deleted the cpuid branch September 27, 2023 19:58
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