]> xenbits.xensource.com Git - unikraft/unikraft.git/commit
plat/common/x86: Increase legacy high regions granularity
authorSergiu Moga <sergiu@unikraft.io>
Wed, 5 Jun 2024 14:12:34 +0000 (17:12 +0300)
committerUnikraft Bot <monkey@unikraft.io>
Wed, 5 Jun 2024 21:49:12 +0000 (21:49 +0000)
commita001e41f607c2f1156e82c21abbfeaf83e752f1a
tree6b66a7a5722fec18565a3441b8f34e40fef90142
parent37c966115fb8d9f04b41e4ad8bf92a05afe76d7a
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.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1449
plat/common/include/uk/plat/common/memory.h
plat/common/memory.c