mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
committed by
Rob Bradford
parent
8be28f8438
commit
0e21b56aea
@@ -1650,17 +1650,6 @@ impl VfioPciDevice {
|
|||||||
self.common.interrupt.msix.as_ref(),
|
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() {
|
for area in sparse_areas.iter() {
|
||||||
let mapping = match MmapRegion::mmap(
|
let mapping = match MmapRegion::mmap(
|
||||||
area.size,
|
area.size,
|
||||||
|
|||||||
Reference in New Issue
Block a user