Skip to content

Commit

Permalink
SVSM: Fixup code conflicts after VMFileMapping merge
Browse files Browse the repository at this point in the history
Some function names have changed location and two contraints need to
be temporarily disabled.

Signed-off-by: Joerg Roedel <[email protected]>
  • Loading branch information
joergroedel committed Nov 20, 2023
1 parent 79fcc93 commit 0c20799
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
// Author: Nicolai Stange <[email protected]>

#![no_std]
#![deny(missing_copy_implementations)]
#![deny(missing_debug_implementations)]

// FIXME: Re-enable these when MM code has implemented the needed traits
//#![deny(missing_copy_implementations)]
//#![deny(missing_debug_implementations)]

#![cfg_attr(all(test, test_in_svsm), no_main)]
#![cfg_attr(all(test, test_in_svsm), feature(custom_test_frameworks))]
#![cfg_attr(all(test, test_in_svsm), test_runner(crate::testing::svsm_test_runner))]
Expand Down
16 changes: 8 additions & 8 deletions src/mm/vm/mapping/file_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::error::SvsmError;
use crate::fs::FileHandle;
use crate::mm::vm::VMR;
use crate::mm::PageRef;
use crate::mm::{pagetable::PageTable, PAGE_SIZE};
use crate::mm::{pagetable::PTEntryFlags, PAGE_SIZE};
use crate::types::PAGE_SHIFT;
use crate::utils::align_up;

Expand All @@ -49,7 +49,7 @@ impl VirtualMapping for VMWriteFileMapping {
}

fn pt_flags(&self, _offset: usize) -> crate::mm::pagetable::PTEntryFlags {
PageTable::task_data_flags()
PTEntryFlags::task_data()
}
}

Expand Down Expand Up @@ -196,19 +196,19 @@ impl VirtualMapping for VMFileMapping {

fn pt_flags(&self, offset: usize) -> crate::mm::pagetable::PTEntryFlags {
match self.permission {
VMFileMappingPermission::Read => PageTable::task_data_ro_flags(),
VMFileMappingPermission::Read => PTEntryFlags::task_data_ro(),
VMFileMappingPermission::Write => {
if let Some(write_copy) = &self.write_copy {
if write_copy.get_alloc().present(offset) {
PageTable::task_data_flags()
PTEntryFlags::task_data()
} else {
PageTable::task_data_ro_flags()
PTEntryFlags::task_data_ro()
}
} else {
PageTable::task_data_ro_flags()
PTEntryFlags::task_data_ro()
}
}
VMFileMappingPermission::Execute => PageTable::task_exec_flags(),
VMFileMappingPermission::Execute => PTEntryFlags::task_exec(),
}
}

Expand All @@ -235,7 +235,7 @@ impl VirtualMapping for VMFileMapping {
copy_page(vmr, &self.file, offset_aligned, paddr_new_page, page_size)?;
return Ok(VMPageFaultResolution {
paddr: paddr_new_page,
flags: PageTable::task_data_flags(),
flags: PTEntryFlags::task_data(),
});
}
}
Expand Down

0 comments on commit 0c20799

Please sign in to comment.