public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Xiong Yining" <xiongyining1480@phytium.com.cn>
To: devel@edk2.groups.io
Cc: quic_llindhol@quicinc.com, ardb+tianocore@kernel.org,
	graeme@xora.org.uk, marcin.juszkiewicz@linaro.org,
	chenbaozi@phytium.com.cn
Subject: [edk2-devel] [PATCH v5 5/7] Platform/SbsaQemu: hang if there is no cpu information
Date: Wed, 31 Jan 2024 12:05:05 +0000	[thread overview]
Message-ID: <20240131120507.2829117-6-xiongyining1480@phytium.com.cn> (raw)
In-Reply-To: <20240131120507.2829117-1-xiongyining1480@phytium.com.cn>

From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

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>
---
 .../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.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114887): https://edk2.groups.io/g/devel/message/114887
Mute This Topic: https://groups.io/mt/104073376/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  parent reply	other threads:[~2024-01-31 12:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240131120507.2829117-1-xiongyining1480@phytium.com.cn>
2024-01-31 12:05 ` [edk2-devel] [PATCH v5 1/7] Platform/SbsaQemu: add SbsaQemuHardwareInfoLib Xiong Yining
2024-01-31 12:05 ` [edk2-devel] [PATCH v5 2/7] Platform/SbsaQemu: read amount of cpus during init Xiong Yining
2024-01-31 12:05 ` [edk2-devel] [PATCH v5 3/7] Platform/SbsaQemu: use PcdCoreCount directly Xiong Yining
2024-01-31 12:05 ` [edk2-devel] [PATCH v5 4/7] Platform/SbsaQemu: move FdtHandlerLib to SbsaQemuHardwareInfoLib Xiong Yining
2024-01-31 12:05 ` Xiong Yining [this message]
2024-01-31 12:05 ` [edk2-devel] [PATCH v5 6/7] Platform/SbsaQemu: get the information of memory via SMC calls Xiong Yining
2024-01-31 12:05 ` [edk2-devel] [PATCH v5 7/7] Platform/SbsaQemu: add DeviceTree fallbacks to parse memory information Xiong Yining

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240131120507.2829117-6-xiongyining1480@phytium.com.cn \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox