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

Bump VCPU from u8 to u32 #6446

Closed

Conversation

KshitijKapoor8
Copy link

Bumped related information to u32 data type to support more vcpu's

#5345

Modified vcpu related information to support
more vcpu's.

Signed-off-by: Kshitij Kapoor <kshitij@utexas.edu>
Modified vcpu related information to support
more vcpu's.

Signed-off-by: Kshitij Kapoor <kshitij@utexas.edu>
The new vcpu size is an unsigned int of 32 bits,
modified the docs to reflect this

Signed-off-by: Kshitij Kapoor <kshitij@utexas.edu>
Modified vcpu related information to support
more vcpu's

Signed-off-by: Kshitij Kapoor <kshitij@utexas.edu>
Modified vcpu related information to support
more vcpu's

Signed-off-by: Kshitij Kapoor <kshitij@utexas.edu>
Modified vcpu related information to support
more vcpu's, mostly in the vmm package

Signed-off-by: Kshitij Kapoor <kshitij@utexas.edu>
@KshitijKapoor8 KshitijKapoor8 requested a review from a team as a code owner May 6, 2024 20:44
@@ -1213,7 +1213,7 @@ impl CpuManager {

// This reuses any inactive vCPUs as well as any that were newly created
for vcpu_id in self.present_vcpus()..desired_vcpus {
let vcpu = Arc::clone(&self.vcpus[vcpu_id as usize]);
let vcpu = Arc::clone(&self.vcpus[vcpu_id as u32]);
Copy link
Member

Choose a reason for hiding this comment

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

This won't work - you can't subscript with u32. Did you run clippy over all the commits? (or better - set up the pre-commit hook from CONTRIBUTING.md to do it for you.)

@liuw
Copy link
Member

liuw commented May 9, 2024

The old issue implies that it is more complicated than just changing the type. Has the underlying issue been resolved?

@up2wing
Copy link
Contributor

up2wing commented May 10, 2024

I noticed that Rob did some work before: #5600.

Would you like to tell about underlying issue you encountered? @rbradford

@thomasbarrett
Copy link
Contributor

thomasbarrett commented May 10, 2024

I looked into this at one point when doing some CPU topology work. At least on x86_64, when we go above 254 vCPUs (the current max on x86_64 cloud-hypervisor), we may run into issues related to (io/x2/x)apic configuration.

From what I remember:

  1. Each cpu is assigned an x2apic id. The x2apic id encodes the CPU topology (e.g. bit 0 represents the thread ID, bits 1-4 represent the core ID, bits 5+ represent the socket ID, etc). We assign the ioapic an apic id of (ncpus + 1). The ioapic cannot be assigned an x2apic, so it must be assigned an apic id in the 0-255 range. As far as I can tell, a cpu would needs to share an x2apic id with the ioapic. From what I remember, qemu just assigns the ioapic an apic id of 0.

  2. Certain ACPI tables must be different for cpus have an x2apic id below 255 and above 255.

I don't think that we are that far off of support for >255 cpus on x86_64, but it requires some Intel doc reading to make sure we aren't doing anything evil.

@rbradford
Copy link
Member

I noticed that Rob did some work before: #5600.

Would you like to tell about underlying issue you encountered? @rbradford

I think @thomasbarrett covered it well - there is also the issue of the mptable becoming too large and overwriting other in memory structures.

Correctly addressing this issue requires cultivating a good understanding of the appropriate x86 quirks - other architectures may be significantly simpler. Either way this is much more complicated than just bumping some data types. I'm going to close this PR because it doesn't even do the data type bump correctly (doesn't compile).

@rbradford rbradford closed this May 14, 2024
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.

None yet

5 participants