[PATCH] hw/hexagon: assign a distinct htid to each DSP machine CPU

Brian Cain posted 1 patch 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260819130341.4076146-1-brian.cain@oss.qualcomm.com
Maintainers: Brian Cain <brian.cain@oss.qualcomm.com>, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
hw/hexagon/hexagon_dsp.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] hw/hexagon: assign a distinct htid to each DSP machine CPU
Posted by Brian Cain 1 month, 1 week ago
The htid property defaults to 0 and hexagon_dsp.c never set it, so every
CPU on the DSP machines came up as hardware thread 0.

This bug was causing h2 test failures.

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

diff --git a/hw/hexagon/hexagon_dsp.c b/hw/hexagon/hexagon_dsp.c
index 20306c28e72..81f8fbef362 100644
--- a/hw/hexagon/hexagon_dsp.c
+++ b/hw/hexagon/hexagon_dsp.c
@@ -124,6 +124,8 @@ static void hexagon_common_init(MachineState *machine, Rev_t rev,
         HexagonCPU *cpu = HEXAGON_CPU(object_new(machine->cpu_type));
         qemu_register_reset(do_cpu_reset, cpu);
 
+        qdev_prop_set_uint32(DEVICE(cpu), "htid", i);
+
         /*
          * CPU #0 is the only CPU running at boot, others must be
          * explicitly enabled via start instruction.
-- 
2.34.1

Re: [PATCH] hw/hexagon: assign a distinct htid to each DSP machine CPU
Posted by Philippe Mathieu-Daudé 1 month, 1 week ago
On 19/8/26 15:03, Brian Cain wrote:
> The htid property defaults to 0 and hexagon_dsp.c never set it, so every
> CPU on the DSP machines came up as hardware thread 0.
> 
> This bug was causing h2 test failures.
> 
> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
> ---
>   hw/hexagon/hexagon_dsp.c | 2 ++
>   1 file changed, 2 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>

Re: [PATCH] hw/hexagon: assign a distinct htid to each DSP machine CPU
Posted by Pierrick Bouvier 1 month, 1 week ago
On 8/19/2026 6:03 AM, Brian Cain wrote:
> The htid property defaults to 0 and hexagon_dsp.c never set it, so every
> CPU on the DSP machines came up as hardware thread 0.
> 
> This bug was causing h2 test failures.
> 
> Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
> ---
>  hw/hexagon/hexagon_dsp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>