plat/common/x86: Increase legacy high regions granularity
Split the previously named `HI_MEM` region into two separate
regions:
- a region for display buffers for video adapters (e.g. VGA Text Mode)
- mapped PCI expansion ROMs regions
This is the new legacy high region expected layout:
Expected memory map for the first 1MiB w.r.t. PC-AT systems compatibility
0x00000 – 0x9FFFF 640KB Main memory, DOS compatible. May contain the
following memory subregions that we will not need after
boot. If the EBDA is defined here, then 1KB starting
at that address shall be treated as a reserved region
0x00000 - 0x003FF Legacy BIOS IVT, segmented pointers to software
interrupt routines defined in the ROM BIOS
0x0040E - 0x0040F Optional EBDA segmented pointer (part of BDA's
structure that occupies 40:00 -> 40:101 range)
0x9FC00 - 0xA0000 Default 1KB of EBDA if not defined in previous
region
0xA0000 – 0xBFFFF 128KB Display buffer for video adapters and possible
SMM Shadow Memory
0xC0000 – 0xDFFFF 128KB ROM BIOS for add-on cards (PCI XROMBARs)
0xE0000 – 0xFFFFF 128KB System ROM BIOS
NOTE: Some systems only report 0xF0000 - 0xFFFFF for the System ROM BIOS
and that is fine.
Note that we are assigning UKPLAT_MEMRT_RESERVED to BIOS PCI ROM.
We usually have here the routines used by real-mode
bootloaders invoked through the BIOS IVT. Although this may not be
necessary anymore, we cannot assign UKPLAT_MEMRT_FREE either since
some BIOSes do set this as a RO segment in the corresponding chipset
registers, leaving this potentially unusable. Thus, just treat it
as a memory hole.
NOTE: For compatibility with newer Firecracker versions (1.7.0+), if VGA
does not exist, we mark its region as READ-ONLY.
NOTE: Assertions for in-page offsets for such regions has also been
obsoleted to deal with regions like those of EBDA, that are not
page-aligned.