-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The stage2 binary has grown beyond the point that it can fit below 640 KB with its heap. Stage2 now executes at an address just above 8 MB. The initial stage 2 stack consumes the first 24 KB, followed by the secrets page and CPUID page, and then come the stage 2 image (with enough room for a heap) and the kernel images. TDP images include the stage1 binary at the base of the stage2 stack area. Signed-off-by: Jon Lange <[email protected]>
- Loading branch information
1 parent
17f5cfe
commit 39bd354
Showing
10 changed files
with
90 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,14 @@ | |
// | ||
// Author: Roy Hopkins <[email protected]> | ||
|
||
use std::mem::size_of; | ||
|
||
use igvm::snp_defs::{SevFeatures, SevVmsa}; | ||
use igvm::IgvmDirectiveHeader; | ||
use igvm_defs::IgvmNativeVpContextX64; | ||
use zerocopy::FromZeroes; | ||
|
||
use crate::cmd_options::SevExtraFeatures; | ||
use crate::stage2_stack::Stage2Stack; | ||
|
||
pub fn construct_start_context() -> Box<IgvmNativeVpContextX64> { | ||
pub fn construct_start_context(start_rip: u64, start_rsp: u64) -> Box<IgvmNativeVpContextX64> { | ||
let mut context_box = IgvmNativeVpContextX64::new_box_zeroed(); | ||
let context = context_box.as_mut(); | ||
|
||
|
@@ -35,8 +32,8 @@ pub fn construct_start_context() -> Box<IgvmNativeVpContextX64> { | |
context.cr4 = 0x40; | ||
|
||
context.rflags = 2; | ||
context.rip = 0x10000; | ||
context.rsp = context.rip - size_of::<Stage2Stack>() as u64; | ||
context.rip = start_rip; | ||
context.rsp = start_rsp; | ||
|
||
context_box | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.