Skip to content

Commit

Permalink
x64: Fill an XSAVE area with zeroes (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuta authored Dec 18, 2021
1 parent 975614b commit 3ad3260
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/arch/x64/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Process {
.expect("failed to allocate kernel stack")
.as_vaddr();
// TODO: Check the size of XSAVE area.
let xsave_area = alloc_pages(1, AllocPageFlags::KERNEL)
let xsave_area = alloc_pages(1, AllocPageFlags::KERNEL | AllocPageFlags::ZEROED)
.expect("failed to allocate xsave area")
.as_vaddr();

Expand Down Expand Up @@ -137,7 +137,7 @@ impl Process {

pub fn fork(&self, frame: &PtRegs) -> Result<Process> {
// TODO: Check the size of XSAVE area.
let xsave_area = alloc_pages(1, AllocPageFlags::KERNEL)
let xsave_area = alloc_pages(1, AllocPageFlags::KERNEL | AllocPageFlags::ZEROED)
.expect("failed to allocate xsave area")
.as_vaddr();

Expand Down

0 comments on commit 3ad3260

Please sign in to comment.