This code looks just like the 64-bit code (I guess it's becoming prime
for unification), and I'd just spent some time debugging a bug in Xen64
caused by an overrun of the allocated area when creating non-PSE
mappings of physical memory. I didn't observe a specific problem with
this code, but consistency and pattern matching made it seem like a
necessary addition. It only ends up reserving the amount of space
actually used, so there's no wasted memory.
If you use PSE to create the mapping and have enough mapped pages anyway
(small kernel), then you may not end up using any of this space.
J
--