On Thu, Sep 10, 2026 at 10:32 AM Brian Cain <[email protected]> wrote:
>
> Each DSP ordinarily has fewer HVX contexts than hw threads.  The thread's
> SSR:XA selects the one it's bound to.
>
> Add a hexagon-hvx-context device holding the register file.  The machine
> creates as many as the config table specifies, linked to every vCPU.
> The CPU picks among the links at run time.
>
> The linux-user side keeps one context per CPU, w/o need for a device.
>
> SSR:XA is not consulted yet, the CPU always uses context 0.
>
> Signed-off-by: Brian Cain <[email protected]>
> ---
>  include/hw/hexagon/hexagon.h             |  1 +
>  include/hw/hexagon/hexagon_hvx_context.h | 27 ++++++++
>  target/hexagon/cpu.h                     |  9 ++-
>  hw/hexagon/hex-subsys.c                  | 36 ++++++++++
>  hw/hexagon/hexagon_hvx_context.c         | 83 ++++++++++++++++++++++++
>  linux-user/hexagon/cpu_loop.c            |  2 +-
>  linux-user/main.c                        |  3 +
>  target/hexagon/cpu.c                     | 19 +++++-
>  hw/hexagon/meson.build                   |  1 +
>  9 files changed, 175 insertions(+), 6 deletions(-)
>  create mode 100644 include/hw/hexagon/hexagon_hvx_context.h
>  create mode 100644 hw/hexagon/hexagon_hvx_context.c
>
> -#ifndef CONFIG_USER_ONLY
> +#ifdef CONFIG_USER_ONLY
> +    HexagonHVXContext hvx_ctx QEMU_ALIGNED(16);
> +#else
> +    HexagonHVXContextState *hvx_ctx[HVX_CONTEXTS_MAX];
> +    HexagonHVXContext hvx_fallback QEMU_ALIGNED(16);

Why is `hvx_fallback` needed?

Reply via email to