Use correct GPA range when accepting pages in `protect_gpa_tdvm_call()`

This commit is contained in:
Tao Su 2026-01-04 03:20:14 +00:00 committed by Tate, Hongliang Tian
parent a0b746fb3f
commit 4f62f2db8e
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ pub unsafe fn protect_gpa_tdvm_call(gpa: Paddr, size: usize) -> Result<(), PageC
debug_assert!(gpa.is_multiple_of(PAGE_SIZE));
map_gpa(gpa as u64, size as u64).map_err(|_| PageConvertError::TdVmcall)?;
for page_gpa in (0..size).step_by(PAGE_SIZE) {
for page_gpa in (gpa..gpa + size).step_by(PAGE_SIZE) {
// SAFETY: The caller ensures the safety of this operation.
unsafe {
accept_page(0, page_gpa as u64).map_err(|_| PageConvertError::TdCall)?;