summary refs log tree commit diff
path: root/acpi_tables
diff options
context:
space:
mode:
authorChuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com>2020-02-27 13:58:26 +0800
committerCommit Bot <commit-bot@chromium.org>2020-02-28 00:11:19 +0000
commit020fbf04c2ac112f34b87306b5fbb75e7a02a81a (patch)
tree127111f64edbb95d7a2b6deceb414dfd24b8db39 /acpi_tables
parent46d61ba80df1ccf8364d9589170b3a7bff1268ee (diff)
downloadcrosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.tar
crosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.tar.gz
crosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.tar.bz2
crosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.tar.lz
crosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.tar.xz
crosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.tar.zst
crosvm-020fbf04c2ac112f34b87306b5fbb75e7a02a81a.zip
x86_64: generate ACPI tables
Add acpi_rsdp_addr in boot_params to allow crosvm to pass
a physicall address of RSDP to the Linux guest kernel, so
that the linux guest kernel can parse the constructed ACPI
tables and enable the ACPI.

Although there is ACPI tables but as we still have "acpi=off"
in command line parameter, there is still no ACPI in guest kernel.

The ACPI construction refers to the implementation of the
Cloud-hypervisor commit:
- arch: x86_64: Generate basic ACPI tables

BUG=chromium:1018674
TEST=None

Change-Id: Ibcb2ae98c43da8ef8c07a07eda9213f61570d14c
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2035351
Reviewed-by: Tomasz Jeznach <tjeznach@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Tomasz Jeznach <tjeznach@chromium.org>
Diffstat (limited to 'acpi_tables')
-rw-r--r--acpi_tables/src/lib.rs2
-rw-r--r--acpi_tables/src/sdt.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/acpi_tables/src/lib.rs b/acpi_tables/src/lib.rs
index 73dd9e8..49cf760 100644
--- a/acpi_tables/src/lib.rs
+++ b/acpi_tables/src/lib.rs
@@ -5,6 +5,8 @@
 pub mod rsdp;
 pub mod sdt;
 
+pub use self::sdt::HEADER_LEN;
+
 fn generate_checksum(data: &[u8]) -> u8 {
     (255 - data.iter().fold(0u8, |acc, x| acc.wrapping_add(*x))).wrapping_add(1)
 }
diff --git a/acpi_tables/src/sdt.rs b/acpi_tables/src/sdt.rs
index ca1133c..e8a9ea2 100644
--- a/acpi_tables/src/sdt.rs
+++ b/acpi_tables/src/sdt.rs
@@ -10,7 +10,7 @@ pub struct SDT {
     data: Vec<u8>,
 }
 
-const HEADER_LEN: u32 = 36;
+pub const HEADER_LEN: u32 = 36;
 const LENGTH_OFFSET: usize = 4;
 const CHECKSUM_OFFSET: usize = 9;