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

fix: make aarch64_with_sve_and_pac template example work with >=2 vcpus #4925

Merged
merged 3 commits into from
Nov 25, 2024
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 src/vmm/src/devices/virtio/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pub trait VirtioDevice: AsAny + Send {
let avail_features = self.avail_features();
let unrequested_features = v & !avail_features;
if unrequested_features != 0 {
warn!("Received acknowledge request for unknown feature: {:x}", v);
warn!("Received acknowledge request for unknown feature: {:#x}", v);
// Don't count these features as acked.
v &= !unrequested_features;
}
Expand Down
22 changes: 7 additions & 15 deletions src/vmm/src/devices/virtio/mmio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
self.with_queue_mut(f);
} else {
warn!(
"update virtio queue in invalid state 0x{:x}",
"update virtio queue in invalid state {:#x}",

Check warning on line 141 in src/vmm/src/devices/virtio/mmio.rs

View check run for this annotation

Codecov / codecov/patch

src/vmm/src/devices/virtio/mmio.rs#L141

Added line #L141 was not covered by tests
self.device_status
);
}
Expand Down Expand Up @@ -227,7 +227,7 @@
}
_ => {
warn!(
"invalid virtio driver status transition: 0x{:x} -> 0x{:x}",
"invalid virtio driver status transition: {:#x} -> {:#x}",

Check warning on line 230 in src/vmm/src/devices/virtio/mmio.rs

View check run for this annotation

Codecov / codecov/patch

src/vmm/src/devices/virtio/mmio.rs#L230

Added line #L230 was not covered by tests
self.device_status, status
);
}
Expand Down Expand Up @@ -282,19 +282,15 @@
0x70 => self.device_status,
0xfc => self.config_generation,
_ => {
warn!("unknown virtio mmio register read: 0x{:x}", offset);
warn!("unknown virtio mmio register read: {:#x}", offset);
return;
}
};
byte_order::write_le_u32(data, v);
}
0x100..=0xfff => self.locked_device().read_config(offset - 0x100, data),
_ => {
warn!(
"invalid virtio mmio read: 0x{:x}:0x{:x}",
offset,
data.len()
);
warn!("invalid virtio mmio read: {:#x}:{:#x}", offset, data.len());
}
};
}
Expand Down Expand Up @@ -324,7 +320,7 @@
.ack_features_by_page(self.acked_features_select, v);
} else {
warn!(
"ack virtio features in invalid state 0x{:x}",
"ack virtio features in invalid state {:#x}",

Check warning on line 323 in src/vmm/src/devices/virtio/mmio.rs

View check run for this annotation

Codecov / codecov/patch

src/vmm/src/devices/virtio/mmio.rs#L323

Added line #L323 was not covered by tests
self.device_status
);
}
Expand All @@ -346,7 +342,7 @@
0xa0 => self.update_queue_field(|q| lo(&mut q.used_ring_address, v)),
0xa4 => self.update_queue_field(|q| hi(&mut q.used_ring_address, v)),
_ => {
warn!("unknown virtio mmio register write: 0x{:x}", offset);
warn!("unknown virtio mmio register write: {:#x}", offset);
}
}
}
Expand All @@ -361,11 +357,7 @@
}
}
_ => {
warn!(
"invalid virtio mmio write: 0x{:x}:0x{:x}",
offset,
data.len()
);
warn!("invalid virtio mmio write: {:#x}:{:#x}", offset, data.len());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/vmm/src/devices/virtio/vsock/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
fn write_config(&mut self, offset: u64, data: &[u8]) {
METRICS.cfg_fails.inc();
warn!(
"vsock: guest driver attempted to write device config (offset={:x}, len={:x})",
"vsock: guest driver attempted to write device config (offset={:#x}, len={:#x})",

Check warning on line 325 in src/vmm/src/devices/virtio/vsock/device.rs

View check run for this annotation

Codecov / codecov/patch

src/vmm/src/devices/virtio/vsock/device.rs#L325

Added line #L325 was not covered by tests
offset,
data.len()
);
Expand Down
6 changes: 3 additions & 3 deletions src/vmm/src/gdb/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ impl MultiThreadBase for FirecrackerTarget {

while !data.is_empty() {
let gpa = arch::translate_gva(&vcpu_state.vcpu_fd, gva, &vmm).map_err(|e| {
error!("Error {e:?} translating gva on read address: {gva:X}");
error!("Error {e:?} translating gva on read address: {gva:#X}");
})?;

// Compute the amount space left in the page after the gpa
Expand Down Expand Up @@ -424,7 +424,7 @@ impl MultiThreadBase for FirecrackerTarget {

while !data.is_empty() {
let gpa = arch::translate_gva(&vcpu_state.vcpu_fd, gva, &vmm).map_err(|e| {
error!("Error {e:?} translating gva on read address: {gva:X}");
error!("Error {e:?} translating gva on read address: {gva:#X}");
})?;

// Compute the amount space left in the page after the gpa
Expand All @@ -436,7 +436,7 @@ impl MultiThreadBase for FirecrackerTarget {
vmm.guest_memory()
.write(&data[..write_len], GuestAddress(gpa))
.map_err(|e| {
error!("Error {e:?} writing memory at {gpa:X}");
error!("Error {e:?} writing memory at {gpa:#X}");
})?;

data = &data[write_len..];
Expand Down
4 changes: 2 additions & 2 deletions src/vmm/src/vstate/vcpu/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub enum KvmVcpuError {
VcpuGetLapic(kvm_ioctls::Error),
/// Failed to get KVM vcpu mp state: {0}
VcpuGetMpState(kvm_ioctls::Error),
/// Failed to get KVM vcpu msr: 0x{0:x}
/// Failed to get KVM vcpu msr: {0:#x}
VcpuGetMsr(u32),
/// Failed to get KVM vcpu msrs: {0}
VcpuGetMsrs(kvm_ioctls::Error),
Expand Down Expand Up @@ -321,7 +321,7 @@ impl KvmVcpu {
.filter(|msr| msr.index == MSR_IA32_TSC_DEADLINE && msr.data == 0)
.for_each(|msr| {
warn!(
"MSR_IA32_TSC_DEADLINE is 0, replacing with {:x}.",
"MSR_IA32_TSC_DEADLINE is 0, replacing with {:#x}.",
tsc_value
);
msr.data = tsc_value;
Expand Down
2 changes: 1 addition & 1 deletion src/vmm/src/vstate/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use crate::vstate::memory::{Address, GuestMemory, GuestMemoryMmap, GuestMemoryRe
pub enum VmError {
/// The host kernel reports an invalid KVM API version: {0}
ApiVersion(i32),
/// Missing KVM capabilities: {0:x?}
/// Missing KVM capabilities: {0:#x?}
Capabilities(u32),
/** Error creating KVM object: {0} Make sure the user launching the firecracker process is \
configured on the /dev/kvm file's ACL. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"kvm_capabilities": ["170", "171", "172"],
"vcpu_features": [{ "index": 0, "bitmap": "0b1110000" }]
"vcpu_features": [{ "index": 0, "bitmap": "0b111xxxx" }]
}
2 changes: 1 addition & 1 deletion tests/framework/utils_cpu_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_supported_cpu_templates():
match get_cpu_vendor(), global_props.cpu_codename:
# T2CL template is only supported on Cascade Lake and newer CPUs.
case CpuVendor.INTEL, CpuModel.INTEL_SKYLAKE:
return sorted(set(INTEL_TEMPLATES) - set(["T2CL"]))
return sorted(set(INTEL_TEMPLATES) - {"T2CL"})
case CpuVendor.INTEL, _:
return INTEL_TEMPLATES
case CpuVendor.AMD, _:
Expand Down
Loading