Skip to content

Commit

Permalink
ProcessContext: add page_table_ref to support page table copy
Browse files Browse the repository at this point in the history
  • Loading branch information
mmisono committed Dec 10, 2024
1 parent 165718d commit f4e6e95
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/src/process_manager/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl TrustedProcess {
if data != 0 {
let (function_code, function_code_range) = ProcessPageTableRef::copy_data_from_guest(data, size, pgt);
let size = (4096 - (size & 0xFFF)) + size;
trustlet.base.page_table_ref.add_function(function_code, size);
trustlet.context.page_table_ref.add_function(function_code, size);
function_code_range.delete();
}
trustlet
Expand Down Expand Up @@ -373,6 +373,7 @@ pub struct ProcessContext {
pub channel: MemoryChannel,
pub sev_features: u64,
pub measurements: ProcessMeasurements,
pub page_table_ref: ProcessPageTableRef,
}

impl Default for ProcessContext {
Expand All @@ -383,6 +384,7 @@ impl Default for ProcessContext {
channel: MemoryChannel::default(),
sev_features: 0,
measurements: ProcessMeasurements::default(),
page_table_ref: ProcessPageTableRef::default(),
}
}
}
Expand Down Expand Up @@ -453,6 +455,7 @@ impl ProcessContext {
self.sev_features = vmsa.sev_features;
self.base = base;
self.measurements = measurements;
self.page_table_ref = page_table_ref;
}

pub fn add_function(&mut self, function: VirtAddr, size: u64) {
Expand Down

0 comments on commit f4e6e95

Please sign in to comment.