Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F139430156
D20625.id58570.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D20625.id58570.diff
View Options
Index: vm_reserv.c
===================================================================
--- vm_reserv.c
+++ vm_reserv.c
@@ -1177,17 +1177,21 @@
vm_reserv_test_contig(vm_reserv_t rv, u_long npages, vm_paddr_t low,
vm_paddr_t high, u_long alignment, vm_paddr_t boundary)
{
- vm_paddr_t pa, size;
+ vm_paddr_t hi, lo, pa, size;
u_long changes;
- int bitpos, bits_left, i, hi, lo, n;
+ int bitpos, bits_left, i, n;
vm_reserv_assert_locked(rv);
size = npages << PAGE_SHIFT;
pa = VM_PAGE_TO_PHYS(&rv->pages[0]);
+ KASSERT(pa + VM_LEVEL_0_SIZE - size >= low,
+ ("%s: reservation is too low", __func__));
lo = (pa < low) ?
((low + PAGE_MASK - pa) >> PAGE_SHIFT) : 0;
i = lo / NBPOPMAP;
changes = rv->popmap[i] | ((1UL << (lo % NBPOPMAP)) - 1);
+ KASSERT(pa + size <= high,
+ ("%s: reservation is too high", __func__));
hi = (pa + VM_LEVEL_0_SIZE > high) ?
((high + PAGE_MASK - pa) >> PAGE_SHIFT) : VM_LEVEL_0_NPAGES;
n = hi / NBPOPMAP;
@@ -1231,7 +1235,7 @@
return (false);
pa = VM_PAGE_TO_PHYS(&rv->pages[lo]);
}
- if (lo * PAGE_SIZE + size <= hi * PAGE_SIZE)
+ if (lo + npages <= hi)
return (true);
lo = hi;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 13, 12:17 AM (22 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26916317
Default Alt Text
D20625.id58570.diff (1 KB)
Attached To
Mode
D20625: clarify reserv_test_config
Attached
Detach File
Event Timeline
Log In to Comment