W dniu 15.03.2024 o 12:49, Marcin Juszkiewicz pisze:
W dniu 14.03.2024 o 16:13, Ard Biesheuvel pisze:
How is it guaranteed that other components will only see the correct
core count? DXE dispatch is ordered using a dependency graph, so all
users of this PCD should never execute before this driver.
SbsaQemuPlatformDxe is a DXE, right? So it is called on platform init.
At the end of initialization it calls SbsaQemuGetCpuCount() from
SbsaQemuHardwareInfoLib to SET this PCD. It does not use it during
platform init cause it does not require this information. But calls
function to make sure that amount of cpus is known to whatever will be
called later.
Sure, maybe SbsaQemuHardwareInfoLib should be something else (DXE,
Protocol or other EDK2 magic thing) but it is set of functions to be
called from other places of EDK2.
EDK2 starts and one of the first DXE called is SbsaQemuPlatformDxe one:
InitializeSbsaQemuPlatformDxe: InitializeSbsaQemuPlatformDxe called
InitializeSbsaQemuPlatformDxe: Got platform AHCI 60100000 65536
INFO: SMC call: (0xc2000001) (function id: 1)
INFO: Platform version requested
Platform version: 0.3
INFO: SMC call: (0xc2000064) (function id: 100)
GICD base: 0x40060000
GICR base: 0x40080000
INFO: SMC call: (0xc2000065) (function id: 101)
GICI base: 0x44081000
InitializeSbsaQemuPlatformDxe: Got platform XHCI 60110000 65536
INFO: SMC call: (0xc20000c8) (function id: 200)
We have 4 cpus.
It does:
- AHCI init
- Platform version
- GIC addresses
- GIC ITS address
- XHCI init
- CPU count
Then system boot continues with
gArmVirtSbsaQemuPlatformTokenSpaceGuid.PcdCoreCount being set to proper
value.
If replacing use of Pcd with calls to SbsaQemuGetCpuCount() look better
then I can change code to make it happen.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116890): https://edk2.groups.io/g/devel/message/116890
Mute This Topic: https://groups.io/mt/104763764/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-