vmm: Update for new acpi_tables version

In particular the Std::write() API requires that the value implements
AsBytes and copies the slice representation into the table data. This
avoids unaligned writes which can cause a panic with the updated
toolchain.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
Rob Bradford 2023-04-26 17:09:07 +01:00 committed by Rob Bradford
parent 71d1296d09
commit d17d70fae1
4 changed files with 4 additions and 4 deletions

2
Cargo.lock generated
View File

@ -5,7 +5,7 @@ version = 3
[[package]] [[package]]
name = "acpi_tables" name = "acpi_tables"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/rust-vmm/acpi_tables?branch=main#0b892e2c2053c4ecfac8d9e5a52babae75114702" source = "git+https://github.com/rust-vmm/acpi_tables?branch=main#98dcb0309d362dd83f6ffcac4f66914a2fbd5a73"
dependencies = [ dependencies = [
"zerocopy", "zerocopy",
] ]

2
fuzz/Cargo.lock generated
View File

@ -5,7 +5,7 @@ version = 3
[[package]] [[package]]
name = "acpi_tables" name = "acpi_tables"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/rust-vmm/acpi_tables?branch=main#0b892e2c2053c4ecfac8d9e5a52babae75114702" source = "git+https://github.com/rust-vmm/acpi_tables?branch=main#98dcb0309d362dd83f6ffcac4f66914a2fbd5a73"
dependencies = [ dependencies = [
"zerocopy", "zerocopy",
] ]

View File

@ -239,7 +239,7 @@ fn create_facp_table(dsdt_offset: GuestAddress, device_manager: &Arc<Mutex<Devic
// X_DSDT // X_DSDT
facp.write(140, dsdt_offset.0); facp.write(140, dsdt_offset.0);
// Hypervisor Vendor Identity // Hypervisor Vendor Identity
facp.write(268, b"CLOUDHYP"); facp.write_bytes(268, b"CLOUDHYP");
facp.update_checksum(); facp.update_checksum();

View File

@ -1274,7 +1274,7 @@ impl CpuManager {
let mut madt = Sdt::new(*b"APIC", 44, 5, *b"CLOUDH", *b"CHMADT ", 1); let mut madt = Sdt::new(*b"APIC", 44, 5, *b"CLOUDH", *b"CHMADT ", 1);
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
{ {
madt.write(36, arch::layout::APIC_START); madt.write(36, arch::layout::APIC_START.0);
for cpu in 0..self.config.max_vcpus { for cpu in 0..self.config.max_vcpus {
let lapic = LocalApic { let lapic = LocalApic {