On Tue, Jan 25, 2022 at 03:30:11PM +0100, Nicolas Ojeda Leon wrote: > Read the "hardware-info" item from fw-cfg to extract specifications > of PCI host bridges and analyze the 64-bit apertures of them to > find out the highest 64-bit MMIO address required which determines > the address space required by the guest, and, consequently, the > FirstNonAddress used to calculate size of physical addresses. > > Using the static PeiHardwareInfoLib, read the fw-cfg file of > hardware information to extract, one by one, all the host > bridges. Find the last 64-bit MMIO address of each host bridge, > using the HardwareInfoPciHostBridgeLib API, and compare it to an > accumulate value to discover the highest address used, which > corresponds to the highest value that must be included in the > guest's physical address space. > > Given that platforms with multiple host bridges may provide the PCI > apertures' addresses, the memory detection logic must take into > account that, if the host provided the MMIO windows that can and must > be used, the guest needs to take those values. Therefore, if the > MMIO windows are found in the host-provided fw-cfg file, skip all the > logic calculating the physical address size and just use the value > provided. Since each PCI host bridge corresponds to an element in > the information provided by the host, each of these must be analyzed > looking for the highest address used. > > Cc: Alexander Graf <[email protected]> > Cc: Gerd Hoffmann <[email protected]> > > Signed-off-by: Nicolas Ojeda Leon <[email protected]>
Acked-by: Gerd Hoffmann <[email protected]> -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#86154): https://edk2.groups.io/g/devel/message/86154 Mute This Topic: https://groups.io/mt/88672492/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
