[edk2-devel] [PATCH edk2-platforms v3 5/5] Platform/SbsaQemu: hang if there is no cpu information

Marcin Juszkiewicz posted 5 patches 8 months, 3 weeks ago
[edk2-devel] [PATCH edk2-platforms v3 5/5] Platform/SbsaQemu: hang if there is no cpu information
Posted by Marcin Juszkiewicz 8 months, 3 weeks ago
In case we do not have cpu information (SMC call fails,
our minimal DT lacks info) we hang.

TODO: shutdown instead

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
---
 .../SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
index 6315cce3fb7f..923997edb2f1 100644
--- a/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
+++ b/Silicon/Qemu/SbsaQemu/Library/SbsaQemuHardwareInfoLib/SbsaQemuHardwareInfoLib.c
@@ -95,6 +95,9 @@ FdtHelperCountCpus (
   Node = fdt_path_offset (DeviceTreeBase, "/cpus");
   if (Node <= 0) {
     DEBUG ((DEBUG_ERROR, "Unable to locate /cpus in DeviceTree\n"));
+    // as we do not have information about cpu count we panic here
+    // TODO: shutdown rather than hang
+    CpuDeadLoop();
     return 0;
   }
 

-- 
2.43.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114299): https://edk2.groups.io/g/devel/message/114299
Mute This Topic: https://groups.io/mt/103931821/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-