Skip to content

Commit

Permalink
Link bug to RK wrapper relocation model.
Browse files Browse the repository at this point in the history
And fix typo in const.

BUG: 359144829
Change-Id: I1927981014bdf0aa24eb6486b0e09f36f9f35fea
  • Loading branch information
ernoc committed Aug 12, 2024
1 parent 420c873 commit f67f1eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions oak_restricted_kernel_wrapper/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ package(
#
# This is not yet supported in our Bazel setup, but we can get RK to
# work with relocation-model=static as the addresses are known at
# compile time.
# compile time. See b/359144829.
_RK_WRAPPER_RUSTC_FLAGS = [
"-C",
"lto=true", # Enable https://llvm.org/docs/LinkTimeOptimization.html.
"-C",
"panic=abort",
"-C",
"relocation-model=static",
"relocation-model=static", # TODO: b/359144829 - set relocation-model=pie.
"-C",
"opt-level=z", # Optimize for binary size, but also turn off loop vectorization.
]
Expand Down
4 changes: 2 additions & 2 deletions stage0/src/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::{
const DEFAULT_KERNEL_START: u64 = 0x200000;

/// The default location for loading a compressed (bzImage format) kerne.
const DEFAULT_BZIMAGE_SATRT: u64 = 0x2000000;
const DEFAULT_BZIMAGE_START: u64 = 0x2000000; // See b/359144829 before changing.

/// The default size for the kernel if a kernel wasn't supplied via the QEMU
/// fw_cfg device.
Expand Down Expand Up @@ -138,7 +138,7 @@ pub fn try_load_kernel_image<P: crate::Platform>(
let size = file.size();

let dma_address = if bzimage {
PhysAddr::new(DEFAULT_BZIMAGE_SATRT)
PhysAddr::new(DEFAULT_BZIMAGE_START)
} else {
// For an Elf kernel we copy the kernel image to a temporary location at the end
// of available mapped virtual memory where we can parse it.
Expand Down

0 comments on commit f67f1eb

Please sign in to comment.