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

Allow 64-vCPU instances on Helios (stlouis) #478

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/propolis-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ default = []

# When building to be packaged for inclusion in the production ramdisk
# (nominally an Omicron package), certain code is compiled in or out.
omicron-build = []
omicron-build = ["propolis/omicron-build"]

# If selected, only build a mock server which does not actually spawn instances
# (i.e. to test with a facsimile of the API on unsupported platforms)
Expand Down
1 change: 1 addition & 0 deletions lib/propolis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ rand.workspace = true
default = []
crucible-full = ["crucible", "crucible-client-types", "oximeter", "nexus-client"]
falcon = ["libloading", "p9ds", "dlpi", "ispf", "rand", "softnpu-lib"]
omicron-build = []
7 changes: 7 additions & 0 deletions lib/propolis/src/vcpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ mod probes {
fn vm_exit(vcpuid: u32, rip: u64, code: u32) {}
}

#[cfg(not(feature = "omicron-build"))]
pub const MAXCPU: usize = bhyve_api::VM_MAXCPU;

// Helios (stlouis) is built with an expanded limit of 64
#[cfg(feature = "omicron-build")]
pub const MAXCPU: usize = 64;

/// A handle to a virtual CPU.
pub struct Vcpu {
hdl: Arc<VmmHdl>,
Expand Down
4 changes: 2 additions & 2 deletions lib/propolis/src/vmm/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::accessors::*;
use crate::hw;
use crate::mmio::MmioBus;
use crate::pio::PioBus;
use crate::vcpu::Vcpu;
use crate::vcpu::{Vcpu, MAXCPU};
use crate::vmm::{create_vm, CreateOpts, PhysMap, VmmHdl};

/// Arbitrary limit for the top of the physical memory map.
Expand Down Expand Up @@ -249,7 +249,7 @@ impl Builder {
}
/// Sets the maximum number of CPUs for the machine.
pub fn max_cpus(mut self, max: u8) -> Result<Self> {
if max == 0 || max > bhyve_api::VM_MAXCPU as u8 {
if max == 0 || max > MAXCPU as u8 {
Err(Error::new(ErrorKind::InvalidInput, "maxcpu out of range"))
} else {
self.max_cpu = max;
Expand Down
Loading