Commit 6fb6283
committed
vmm: extend last MMIO64 allocator to cover full range
The MMIO64 allocator size is computed with alignment truncation:
size = (range / alignment) * alignment
This loses up to one alignment unit (4 GiB) at the top of the
address space. When a guest (Windows with virtio-win 0.1.285)
programs a BAR near the top of the physical address space, the
allocation fails because the address falls in the truncated gap.
Give the last PCI segment allocator all remaining space up to
the end of the device area, so no addresses are lost.
The `end` parameter of create_mmio_allocators() is an inclusive
address (the last valid byte). Fix the 32-bit caller and tests
to pass inclusive values, consistent with the 64-bit caller
which already uses the inclusive end_of_device_area().
Signed-off-by: CMGS <ilskdw@gmail.com>1 parent 88bde66 commit 6fb6283
1 file changed
Lines changed: 16 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1127 | 1127 | | |
1128 | 1128 | | |
1129 | 1129 | | |
| 1130 | + | |
| 1131 | + | |
1130 | 1132 | | |
1131 | 1133 | | |
1132 | 1134 | | |
| |||
1144 | 1146 | | |
1145 | 1147 | | |
1146 | 1148 | | |
1147 | | - | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1148 | 1158 | | |
1149 | 1159 | | |
1150 | 1160 | | |
| |||
1205 | 1215 | | |
1206 | 1216 | | |
1207 | 1217 | | |
1208 | | - | |
| 1218 | + | |
| 1219 | + | |
1209 | 1220 | | |
1210 | 1221 | | |
1211 | 1222 | | |
| |||
5695 | 5706 | | |
5696 | 5707 | | |
5697 | 5708 | | |
5698 | | - | |
| 5709 | + | |
5699 | 5710 | | |
5700 | 5711 | | |
5701 | 5712 | | |
| |||
5706 | 5717 | | |
5707 | 5718 | | |
5708 | 5719 | | |
5709 | | - | |
| 5720 | + | |
5710 | 5721 | | |
5711 | 5722 | | |
5712 | 5723 | | |
| |||
5725 | 5736 | | |
5726 | 5737 | | |
5727 | 5738 | | |
5728 | | - | |
| 5739 | + | |
5729 | 5740 | | |
5730 | 5741 | | |
5731 | 5742 | | |
| |||
0 commit comments