Page MenuHomeFreeBSD

x86/xen: stop assuming kernel memory loading order in PVH
ClosedPublic

Authored by royger on Jun 28 2022, 3:53 PM.
Tags
None
Referenced Files
F154404729: D35628.id107482.diff
Tue, Apr 28, 9:11 AM
F154398469: D35628.id107579.diff
Tue, Apr 28, 8:33 AM
F154340219: D35628.id107482.diff
Mon, Apr 27, 11:16 PM
F154291071: D35628.id107535.diff
Mon, Apr 27, 3:43 PM
Unknown Object (File)
Mon, Apr 27, 6:41 AM
Unknown Object (File)
Sun, Apr 26, 4:09 AM
Unknown Object (File)
Sat, Apr 25, 5:29 AM
Unknown Object (File)
Fri, Apr 24, 8:55 PM
Subscribers

Details

Summary

Do not assume that start_info will always be loaded at the highest
memory address, and instead check the position of all the loaded
elements in order to find the last loaded one, and thus a likely safe
place to use as early boot allocation memory space.

Reported by: markj, cpercival
Sponsored by: Citrix Systems R&D

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46152
Build 43041: arc lint + arc unit

Event Timeline

sys/x86/xen/pv.c
154

max() is not really appropriate here. It only compares a pair of unsigned ints. (Yes, it's too confusing.) The MAX() macro is a better alternative. I think this happens to work because the addresses involved are small, but it'd still be better to switch away from its use.

176

Extra newline.

royger added inline comments.
sys/x86/xen/pv.c
154

Yes, all addresses should be below 4G, and hence fit in an unsigned int. That mess with max() is confusing, will switch to MAX() instead.

  • Use MAX() instead of max().
  • Remove extra newline.
This revision is now accepted and ready to land.Jun 29 2022, 3:04 PM