Skip to content

Commit f16e21e

Browse files
ziqiaozhouCopilot
andcommitted
kernel: migrate page tables to paging crate
Replace the kernel-local page table implementation with wrappers around the generic paging crate. Add the SvsmPaging adapter for allocation, address conversion, feature masks, and self-map index configuration while preserving the kernel-facing PageTable and PageTablePart APIs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Ziqiao Zhou <ziqiaozhou@microsoft.com>
1 parent 8da895a commit f16e21e

3 files changed

Lines changed: 158 additions & 1030 deletions

File tree

kernel/src/error.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ use crate::virtio::VirtioError;
3838
#[cfg(feature = "vsock")]
3939
use crate::vsock::VsockError;
4040
use elf::ElfError;
41+
use paging::traits::PagingError;
4142
use syscall::SysCallError;
4243

4344
/// Errors related to I/O operations.
@@ -160,6 +161,8 @@ pub enum SvsmError {
160161
TeeAttestation(AttestationError),
161162
/// Errors related to ImmutAfterInitCell
162163
ImmutAfterInit(ImmutAfterInitError),
164+
/// Errors from the paging crate
165+
Paging(PagingError),
163166
/// Errors related to vsock.
164167
#[cfg(feature = "vsock")]
165168
Vsock(VsockError),
@@ -179,6 +182,12 @@ impl From<ElfError> for SvsmError {
179182
}
180183
}
181184

185+
impl From<PagingError> for SvsmError {
186+
fn from(err: PagingError) -> Self {
187+
Self::Paging(err)
188+
}
189+
}
190+
182191
impl From<ApicError> for SvsmError {
183192
fn from(err: ApicError) -> Self {
184193
Self::Apic(err)

0 commit comments

Comments
 (0)