pci: do not check for page-aligned size and offset before calling mmap()

The kernel will validate that the size is page-aligned.  The file offset
is always zero, so the kernel will also validate that the offset is
page-aligned.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
Demi Marie Obenour 2025-06-27 18:22:09 -04:00 committed by Rob Bradford
parent 8be28f8438
commit 0e21b56aea

View file

@ -1650,17 +1650,6 @@ impl VfioPciDevice {
self.common.interrupt.msix.as_ref(),
)?;
for area in &sparse_areas {
if !is_page_size_aligned(area.size) || !is_page_size_aligned(area.offset) {
error!(
"Could not mmap sparse area that is not page size aligned \
(offset = 0x{:x}, size = 0x{:x})",
area.offset, area.size
);
return Err(VfioPciError::MmapArea);
}
}
for area in sparse_areas.iter() {
let mapping = match MmapRegion::mmap(
area.size,