Skip to content

Commit 743c14e

Browse files
committed
tbd(acpi): do not add CPU info in DSDT
In theory that should be ok, since we pass all the required info via MADT. Signed-off-by: Babis Chalios <bchalios@amazon.es>
1 parent 95f3c20 commit 743c14e

File tree

2 files changed

+1
-48
lines changed

2 files changed

+1
-48
lines changed

src/vmm/src/acpi/mod.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
use acpi_tables::fadt::{FADT_F_HW_REDUCED_ACPI, FADT_F_PWR_BUTTON, FADT_F_SLP_BUTTON};
5-
use acpi_tables::{aml, Aml, Dsdt, Fadt, Madt, Rsdp, Sdt, Xsdt};
5+
use acpi_tables::{Aml, Dsdt, Fadt, Madt, Rsdp, Sdt, Xsdt};
66
use log::debug;
77
use vm_allocator::AllocPolicy;
88

@@ -55,16 +55,6 @@ impl Vmm {
5555
debug!("acpi: building DSDT table");
5656
let mut dsdt_data = Vec::new();
5757

58-
// CPU-related Aml data
59-
let hid = aml::Name::new("_HID".into(), &"ACPI0010");
60-
let uid = aml::Name::new("_CID".into(), &aml::EisaName::new("PNP0A05"));
61-
let cpu_methods = aml::Method::new("CSCN".into(), 0, true, vec![]);
62-
let mut cpu_inner_data: Vec<&dyn Aml> = vec![&hid, &uid, &cpu_methods];
63-
for vcpu in vcpus {
64-
cpu_inner_data.push(vcpu);
65-
}
66-
aml::Device::new("_SB_.CPUS".into(), cpu_inner_data).append_aml_bytes(&mut dsdt_data);
67-
6858
// Virtio-devices DSDT data
6959
self.mmio_device_manager.append_aml_bytes(&mut dsdt_data);
7060

src/vmm/src/vstate/vcpu/mod.rs

-37
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ use std::sync::Mutex;
1313
use std::sync::{Arc, Barrier};
1414
use std::{fmt, io, thread};
1515

16-
#[cfg(target_arch = "x86_64")]
17-
use acpi_tables::madt::LocalAPIC;
18-
use acpi_tables::{aml, Aml};
1916
use kvm_bindings::{KVM_SYSTEM_EVENT_RESET, KVM_SYSTEM_EVENT_SHUTDOWN};
2017
use kvm_ioctls::VcpuExit;
2118
use libc::{c_int, c_void, siginfo_t};
@@ -25,8 +22,6 @@ use utils::errno;
2522
use utils::eventfd::EventFd;
2623
use utils::signal::{register_signal_handler, sigrtmin, Killable};
2724
use utils::sm::StateMachine;
28-
#[cfg(target_arch = "x86_64")]
29-
use zerocopy::AsBytes;
3025

3126
use crate::cpu_config::templates::{CpuConfiguration, GuestConfigError};
3227
use crate::logger::{IncMetric, METRICS};
@@ -554,38 +549,6 @@ impl Vcpu {
554549
}
555550
}
556551
}
557-
558-
#[cfg(target_arch = "x86_64")]
559-
fn generate_acpi_mat(&self) -> Vec<u8> {
560-
LocalAPIC::new(self.kvm_vcpu.index).as_bytes().into()
561-
}
562-
563-
#[cfg(target_arch = "aarch64")]
564-
fn generate_acpi_mat(&self) -> Vec<u8> {
565-
unimplemented!()
566-
}
567-
}
568-
569-
impl Aml for Vcpu {
570-
fn append_aml_bytes(&self, bytes: &mut Vec<u8>) {
571-
let mat_data: Vec<u8> = self.generate_acpi_mat();
572-
aml::Device::new(
573-
format!("C{:03}", self.kvm_vcpu.index).as_str().into(),
574-
vec![
575-
&aml::Name::new("_HID".into(), &"ACPI0007"),
576-
&aml::Name::new("_UID".into(), &self.kvm_vcpu.index),
577-
&aml::Method::new(
578-
"_STA".into(),
579-
0,
580-
false,
581-
// Mark CPU present
582-
vec![&aml::Return::new(&0xfu8)],
583-
),
584-
&aml::Name::new("_MAT".into(), &aml::Buffer::new(mat_data)),
585-
],
586-
)
587-
.append_aml_bytes(bytes);
588-
}
589552
}
590553

591554
impl Drop for Vcpu {

0 commit comments

Comments
 (0)