Skip to content

Commit 75be992

Browse files
authored
Merge branch 'main' into allow-snapshot-tap-changes
2 parents 0818b99 + e7f6051 commit 75be992

File tree

223 files changed

+3467
-5668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+3467
-5668
lines changed

.buildkite/pipeline_pr.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
if not pipeline.args.no_kani and (
5252
not changed_files
5353
or any(x.suffix in [".rs", ".toml", ".lock"] for x in changed_files)
54+
or any(x.parent.name == "devctr" for x in changed_files)
5455
):
5556
kani_grp = pipeline.build_group(
5657
"🔍 Kani",

.cargo/audit.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
[advisories]
2+
# The `paste` dependency is transitively included via `gdbstub`.
3+
# While the crate is archived/unmaintained, the author considers it feature-complete
4+
# and functionally stable. gdbstub will be update once they migrate
5+
# to an alternative solution.
6+
# See https://github.com/daniel5151/gdbstub/issues/168
7+
ignore = ["RUSTSEC-2024-0436"]

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ and this project adheres to
2323

2424
### Fixed
2525

26+
- #\[[5074](https://github.com/firecracker-microvm/firecracker/pull/5074)\] Fix
27+
the `SendCtrlAltDel` command not working for ACPI-enabled guest kernels, by
28+
dropping the i8042.nopnp argument from the default kernel command line
29+
Firecracker constructs.
30+
2631
## [1.11.0]
2732

2833
### Added

docs/tracing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ clippy-tracing \
4646
--action fix \
4747
--path ./src \
4848
--exclude benches \
49-
--exclude virtio/gen,bindings.rs,net/gen \
49+
--exclude virtio/generated,bindings.rs,net/generated \
5050
--exclude log-instrument-macros/,log-instrument/,clippy-tracing/ \
5151
--exclude vmm_config/logger.rs,logger/,signal_handler.rs,time.rs
5252
```

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# allowlisted using a toolchain that requires it, causing the A/B-test to
1212
# always fail.
1313
[toolchain]
14-
channel = "1.83.0"
14+
channel = "1.85.0"
1515
targets = ["x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl"]
1616
profile = "minimal"
1717

src/acpi-tables/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "acpi_tables"
33
version = "0.1.0"
44
authors = ["The Cloud Hypervisor Authors", "Amazon Firecracker team <[email protected]>"]
5-
edition = "2021"
5+
edition = "2024"
66
license = "Apache-2.0"
77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88

src/acpi-tables/src/aml.rs

Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,12 @@ impl EisaName {
265265

266266
let data = name.as_bytes();
267267

268-
let value: u32 = (u32::from(data[0] - 0x40) << 26
269-
| u32::from(data[1] - 0x40) << 21
270-
| u32::from(data[2] - 0x40) << 16
271-
| name.chars().nth(3).unwrap().to_digit(16).unwrap() << 12
272-
| name.chars().nth(4).unwrap().to_digit(16).unwrap() << 8
273-
| name.chars().nth(5).unwrap().to_digit(16).unwrap() << 4
268+
let value: u32 = ((u32::from(data[0] - 0x40) << 26)
269+
| (u32::from(data[1] - 0x40) << 21)
270+
| (u32::from(data[2] - 0x40) << 16)
271+
| (name.chars().nth(3).unwrap().to_digit(16).unwrap() << 12)
272+
| (name.chars().nth(4).unwrap().to_digit(16).unwrap() << 8)
273+
| (name.chars().nth(5).unwrap().to_digit(16).unwrap() << 4)
274274
| name.chars().nth(6).unwrap().to_digit(16).unwrap())
275275
.swap_bytes();
276276

@@ -439,7 +439,7 @@ where
439439
r#type: AddressSpaceType::Memory,
440440
min,
441441
max,
442-
type_flags: (cacheable as u8) << 1 | u8::from(read_write),
442+
type_flags: ((cacheable as u8) << 1) | u8::from(read_write),
443443
})
444444
}
445445

@@ -471,7 +471,7 @@ where
471471
bytes.push(descriptor); // Word Address Space Descriptor
472472
bytes.extend_from_slice(&(TryInto::<u16>::try_into(length).unwrap()).to_le_bytes());
473473
bytes.push(self.r#type as u8); // type
474-
let generic_flags = 1 << 2 /* Min Fixed */ | 1 << 3; // Max Fixed
474+
let generic_flags = (1 << 2) /* Min Fixed */ | (1 << 3); // Max Fixed
475475
bytes.push(generic_flags);
476476
bytes.push(self.type_flags);
477477
}
@@ -591,9 +591,9 @@ impl Aml for Interrupt {
591591
fn append_aml_bytes(&self, bytes: &mut Vec<u8>) -> Result<(), AmlError> {
592592
bytes.push(0x89); // Extended IRQ Descriptor
593593
bytes.extend_from_slice(&6u16.to_le_bytes());
594-
let flags = u8::from(self.shared) << 3
595-
| u8::from(self.active_low) << 2
596-
| u8::from(self.edge_triggered) << 1
594+
let flags = (u8::from(self.shared) << 3)
595+
| (u8::from(self.active_low) << 2)
596+
| (u8::from(self.edge_triggered) << 1)
597597
| u8::from(self.consumer);
598598
bytes.push(flags);
599599
bytes.push(1u8); // count
@@ -682,7 +682,7 @@ impl Aml for Method<'_> {
682682
fn append_aml_bytes(&self, bytes: &mut Vec<u8>) -> Result<(), AmlError> {
683683
let mut tmp = Vec::new();
684684
self.path.append_aml_bytes(&mut tmp)?;
685-
let flags: u8 = (self.args & 0x7) | u8::from(self.serialized) << 3;
685+
let flags: u8 = (self.args & 0x7) | (u8::from(self.serialized) << 3);
686686
tmp.push(flags);
687687
for child in &self.children {
688688
child.append_aml_bytes(&mut tmp)?;
@@ -766,7 +766,7 @@ impl Aml for Field {
766766
let mut tmp = Vec::new();
767767
self.path.append_aml_bytes(&mut tmp)?;
768768

769-
let flags: u8 = self.access_type as u8 | (self.update_rule as u8) << 5;
769+
let flags: u8 = self.access_type as u8 | ((self.update_rule as u8) << 5);
770770
tmp.push(flags);
771771

772772
for field in self.fields.iter() {
@@ -1263,15 +1263,17 @@ mod tests {
12631263
assert_eq!(
12641264
Scope::new(
12651265
"_SB_.MBRD".try_into().unwrap(),
1266-
vec![&Name::new(
1267-
"_CRS".try_into().unwrap(),
1268-
&ResourceTemplate::new(vec![&Memory32Fixed::new(
1269-
true,
1270-
0xE800_0000,
1271-
0x1000_0000
1272-
)])
1273-
)
1274-
.unwrap()]
1266+
vec![
1267+
&Name::new(
1268+
"_CRS".try_into().unwrap(),
1269+
&ResourceTemplate::new(vec![&Memory32Fixed::new(
1270+
true,
1271+
0xE800_0000,
1272+
0x1000_0000
1273+
)])
1274+
)
1275+
.unwrap()
1276+
]
12751277
)
12761278
.to_aml_bytes()
12771279
.unwrap(),
@@ -1438,13 +1440,15 @@ mod tests {
14381440
assert_eq!(
14391441
Name::new(
14401442
"_CRS".try_into().unwrap(),
1441-
&ResourceTemplate::new(vec![&AddressSpace::new_memory(
1442-
AddressSpaceCacheable::Cacheable,
1443-
true,
1444-
0x8_0000_0000u64,
1445-
0xf_ffff_ffffu64
1446-
)
1447-
.unwrap()])
1443+
&ResourceTemplate::new(vec![
1444+
&AddressSpace::new_memory(
1445+
AddressSpaceCacheable::Cacheable,
1446+
true,
1447+
0x8_0000_0000u64,
1448+
0xf_ffff_ffffu64
1449+
)
1450+
.unwrap()
1451+
])
14481452
)
14491453
.unwrap()
14501454
.to_aml_bytes()
@@ -1491,12 +1495,12 @@ mod tests {
14911495
assert_eq!(create_pkg_length(&[0u8; 62], true), vec![63]);
14921496
assert_eq!(
14931497
create_pkg_length(&[0u8; 64], true),
1494-
vec![1 << 6 | (66 & 0xf), 66 >> 4]
1498+
vec![(1 << 6) | (66 & 0xf), 66 >> 4]
14951499
);
14961500
assert_eq!(
14971501
create_pkg_length(&[0u8; 4096], true),
14981502
vec![
1499-
2 << 6 | (4099 & 0xf) as u8,
1503+
(2 << 6) | (4099 & 0xf) as u8,
15001504
((4099 >> 4) & 0xff).try_into().unwrap(),
15011505
((4099 >> 12) & 0xff).try_into().unwrap()
15021506
]
@@ -1553,7 +1557,9 @@ mod tests {
15531557
(&"_SB_.PCI0._HID".try_into().unwrap() as &Path)
15541558
.to_aml_bytes()
15551559
.unwrap(),
1556-
[0x2F, 0x03, 0x5F, 0x53, 0x42, 0x5F, 0x50, 0x43, 0x49, 0x30, 0x5F, 0x48, 0x49, 0x44]
1560+
[
1561+
0x2F, 0x03, 0x5F, 0x53, 0x42, 0x5F, 0x50, 0x43, 0x49, 0x30, 0x5F, 0x48, 0x49, 0x44
1562+
]
15571563
);
15581564
}
15591565

@@ -2007,13 +2013,15 @@ mod tests {
20072013
vec![
20082014
&Name::new(
20092015
"MR64".try_into().unwrap(),
2010-
&ResourceTemplate::new(vec![&AddressSpace::new_memory(
2011-
AddressSpaceCacheable::Cacheable,
2012-
true,
2013-
0x0000_0000_0000_0000u64,
2014-
0xFFFF_FFFF_FFFF_FFFEu64
2015-
)
2016-
.unwrap()])
2016+
&ResourceTemplate::new(vec![
2017+
&AddressSpace::new_memory(
2018+
AddressSpaceCacheable::Cacheable,
2019+
true,
2020+
0x0000_0000_0000_0000u64,
2021+
0xFFFF_FFFF_FFFF_FFFEu64
2022+
)
2023+
.unwrap()
2024+
])
20172025
)
20182026
.unwrap(),
20192027
&CreateField::<u64>::new(

src/acpi-tables/src/dsdt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::mem::size_of;
66
use vm_memory::{Address, Bytes, GuestAddress, GuestMemory};
77
use zerocopy::IntoBytes;
88

9-
use crate::{checksum, AcpiError, Result, Sdt, SdtHeader};
9+
use crate::{AcpiError, Result, Sdt, SdtHeader, checksum};
1010

1111
/// Differentiated System Description Table (DSDT)
1212
///

src/acpi-tables/src/fadt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use vm_memory::{Bytes, GuestAddress, GuestMemory};
77
use zerocopy::little_endian::{U16, U32, U64};
88
use zerocopy::{Immutable, IntoBytes};
99

10-
use crate::{checksum, GenericAddressStructure, Result, Sdt, SdtHeader};
10+
use crate::{GenericAddressStructure, Result, Sdt, SdtHeader, checksum};
1111

1212
#[cfg(target_arch = "x86_64")]
1313
pub const IAPC_BOOT_ARG_FLAGS_VGA_NOT_PRESENT: u16 = 2;
@@ -41,7 +41,7 @@ pub const FADT_F_HW_REDUCED_ACPI: u8 = 20;
4141
/// the pointer to the DSDT table.
4242
/// More information about this table can be found in the ACPI specification:
4343
/// https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#fixed-acpi-description-table-fadt
44-
#[repr(packed)]
44+
#[repr(C, packed)]
4545
#[derive(Debug, Copy, Clone, Default, IntoBytes, Immutable)]
4646
pub struct Fadt {
4747
header: SdtHeader,

src/acpi-tables/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub enum AcpiError {
4949
pub type Result<T> = std::result::Result<T, AcpiError>;
5050

5151
/// ACPI type representing memory addresses
52-
#[repr(packed)]
52+
#[repr(C, packed)]
5353
#[derive(IntoBytes, Immutable, Clone, Copy, Debug, Default)]
5454
pub struct GenericAddressStructure {
5555
pub address_space_id: u8,
@@ -78,7 +78,7 @@ impl GenericAddressStructure {
7878
}
7979

8080
/// Header included in all System Descriptor Tables
81-
#[repr(packed)]
81+
#[repr(C, packed)]
8282
#[derive(Clone, Debug, Copy, Default, IntoBytes, Immutable)]
8383
pub struct SdtHeader {
8484
pub signature: [u8; 4],

0 commit comments

Comments
 (0)