|
@@ -262,7 +262,14 @@ impl PciMemory32Allocator {
|
|
cpu_physical,
|
|
cpu_physical,
|
|
size,
|
|
size,
|
|
);
|
|
);
|
|
- if range_type == PciRangeType::Memory32 && size > memory_32_size.into() {
|
|
|
|
|
|
+ // Use the largest range within the 32-bit address space for 32-bit memory, even if it
|
|
|
|
+ // is marked as a 64-bit range. This is necessary because crosvm doesn't currently
|
|
|
|
+ // provide any 32-bit ranges.
|
|
|
|
+ if !prefetchable
|
|
|
|
+ && matches!(range_type, PciRangeType::Memory32 | PciRangeType::Memory64)
|
|
|
|
+ && size > memory_32_size.into()
|
|
|
|
+ && bus_address + size < u32::MAX.into()
|
|
|
|
+ {
|
|
assert_eq!(bus_address, cpu_physical);
|
|
assert_eq!(bus_address, cpu_physical);
|
|
memory_32_address = u32::try_from(cpu_physical).unwrap();
|
|
memory_32_address = u32::try_from(cpu_physical).unwrap();
|
|
memory_32_size = u32::try_from(size).unwrap();
|
|
memory_32_size = u32::try_from(size).unwrap();
|