Skip to content

Commit 0c20799

Browse files
committed
SVSM: Fixup code conflicts after VMFileMapping merge
Some function names have changed location and two contraints need to be temporarily disabled. Signed-off-by: Joerg Roedel <[email protected]>
1 parent 79fcc93 commit 0c20799

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/lib.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
// Author: Nicolai Stange <[email protected]>
66

77
#![no_std]
8-
#![deny(missing_copy_implementations)]
9-
#![deny(missing_debug_implementations)]
8+
9+
// FIXME: Re-enable these when MM code has implemented the needed traits
10+
//#![deny(missing_copy_implementations)]
11+
//#![deny(missing_debug_implementations)]
12+
1013
#![cfg_attr(all(test, test_in_svsm), no_main)]
1114
#![cfg_attr(all(test, test_in_svsm), feature(custom_test_frameworks))]
1215
#![cfg_attr(all(test, test_in_svsm), test_runner(crate::testing::svsm_test_runner))]

src/mm/vm/mapping/file_mapping.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use crate::error::SvsmError;
2222
use crate::fs::FileHandle;
2323
use crate::mm::vm::VMR;
2424
use crate::mm::PageRef;
25-
use crate::mm::{pagetable::PageTable, PAGE_SIZE};
25+
use crate::mm::{pagetable::PTEntryFlags, PAGE_SIZE};
2626
use crate::types::PAGE_SHIFT;
2727
use crate::utils::align_up;
2828

@@ -49,7 +49,7 @@ impl VirtualMapping for VMWriteFileMapping {
4949
}
5050

5151
fn pt_flags(&self, _offset: usize) -> crate::mm::pagetable::PTEntryFlags {
52-
PageTable::task_data_flags()
52+
PTEntryFlags::task_data()
5353
}
5454
}
5555

@@ -196,19 +196,19 @@ impl VirtualMapping for VMFileMapping {
196196

197197
fn pt_flags(&self, offset: usize) -> crate::mm::pagetable::PTEntryFlags {
198198
match self.permission {
199-
VMFileMappingPermission::Read => PageTable::task_data_ro_flags(),
199+
VMFileMappingPermission::Read => PTEntryFlags::task_data_ro(),
200200
VMFileMappingPermission::Write => {
201201
if let Some(write_copy) = &self.write_copy {
202202
if write_copy.get_alloc().present(offset) {
203-
PageTable::task_data_flags()
203+
PTEntryFlags::task_data()
204204
} else {
205-
PageTable::task_data_ro_flags()
205+
PTEntryFlags::task_data_ro()
206206
}
207207
} else {
208-
PageTable::task_data_ro_flags()
208+
PTEntryFlags::task_data_ro()
209209
}
210210
}
211-
VMFileMappingPermission::Execute => PageTable::task_exec_flags(),
211+
VMFileMappingPermission::Execute => PTEntryFlags::task_exec(),
212212
}
213213
}
214214

@@ -235,7 +235,7 @@ impl VirtualMapping for VMFileMapping {
235235
copy_page(vmr, &self.file, offset_aligned, paddr_new_page, page_size)?;
236236
return Ok(VMPageFaultResolution {
237237
paddr: paddr_new_page,
238-
flags: PageTable::task_data_flags(),
238+
flags: PTEntryFlags::task_data(),
239239
});
240240
}
241241
}

0 commit comments

Comments
 (0)