[PATCH 5/8] hw/hexagon: Modify "Standalone" symbols

Brian Cain posted 8 patches 11 months, 2 weeks ago
[PATCH 5/8] hw/hexagon: Modify "Standalone" symbols
Posted by Brian Cain 11 months, 2 weeks ago
From: Brian Cain <bcain@quicinc.com>

These symbols are used by Hexagon Standalone OS to indicate whether
the program should halt and wait for interrupts at startup.  For QEMU,
we want these programs to just continue crt0 startup through to the user
program's main().

Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 hw/hexagon/hexagon_dsp.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/hw/hexagon/hexagon_dsp.c b/hw/hexagon/hexagon_dsp.c
index c4962a98bc..34bbe98149 100644
--- a/hw/hexagon/hexagon_dsp.c
+++ b/hw/hexagon/hexagon_dsp.c
@@ -28,9 +28,17 @@
 
 #include "machine_cfg_v66g_1024.h.inc"
 
+static hwaddr isdb_secure_flag;
+static hwaddr isdb_trusted_flag;
 static void hex_symbol_callback(const char *st_name, int st_info,
                                 uint64_t st_value, uint64_t st_size)
 {
+    if (!g_strcmp0("isdb_secure_flag", st_name)) {
+        isdb_secure_flag = st_value;
+    }
+    if (!g_strcmp0("isdb_trusted_flag", st_name)) {
+        isdb_trusted_flag = st_value;
+    }
 }
 
 /* Board init.  */
@@ -59,6 +67,13 @@ static void hexagon_init_bootstrap(MachineState *machine, HexagonCPU *cpu)
 {
     if (machine->kernel_filename) {
         hexagon_load_kernel(cpu);
+        uint32_t mem = 1;
+        if (isdb_secure_flag) {
+            cpu_physical_memory_write(isdb_secure_flag, &mem, sizeof(mem));
+        }
+        if (isdb_trusted_flag) {
+            cpu_physical_memory_write(isdb_trusted_flag, &mem, sizeof(mem));
+        }
     }
 }
 
-- 
2.34.1

RE: [PATCH 5/8] hw/hexagon: Modify "Standalone" symbols
Posted by ltaylorsimpson@gmail.com 10 months, 3 weeks ago

> -----Original Message-----
> From: Brian Cain <brian.cain@oss.qualcomm.com>
> Sent: Saturday, March 1, 2025 11:21 AM
> To: qemu-devel@nongnu.org
> Cc: brian.cain@oss.qualcomm.com; richard.henderson@linaro.org;
> philmd@linaro.org; quic_mathbern@quicinc.com; ale@rev.ng; anjo@rev.ng;
> quic_mliebel@quicinc.com; ltaylorsimpson@gmail.com;
> alex.bennee@linaro.org; quic_mburton@quicinc.com;
> sidneym@quicinc.com; Brian Cain <bcain@quicinc.com>
> Subject: [PATCH 5/8] hw/hexagon: Modify "Standalone" symbols
> 
> From: Brian Cain <bcain@quicinc.com>
> 
> These symbols are used by Hexagon Standalone OS to indicate whether the
> program should halt and wait for interrupts at startup.  For QEMU, we want
> these programs to just continue crt0 startup through to the user program's
> main().
> 
> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>

Reviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com>