Skip to content

Comments

qemu: add support for qemu MMU target.#10575

Open
lgirdwood wants to merge 4 commits intothesofproject:mainfrom
lgirdwood:qemudc233c
Open

qemu: add support for qemu MMU target.#10575
lgirdwood wants to merge 4 commits intothesofproject:mainfrom
lgirdwood:qemudc233c

Conversation

@lgirdwood
Copy link
Member

Intended use is CI ztests and userspace development

${sof_module} no longer set anywhere and resolved to NULL. Fix with
correct paths.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Userspace can be built without fast_get().

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add a qemu target for SOF that will build with native zephyr support
for drivers including xtensa MMU. This will be used for GH worklow
ztest validation and as a SDV for userspace work.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Call directly here as more qemu target wont simulate IPC which is used
as entry for testing on HW.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a minimal SOF “qemu_xtensa” platform wiring to enable running Zephyr userspace/ztest workloads on QEMU Xtensa DC233C (incl. MMU variant), primarily for CI and local development.

Changes:

  • Introduce a new qemu_xtensa platform subtree (platform source + stub platform headers) and hook it into Zephyr/XTOS CMake selection.
  • Extend build tooling (xtensa-build-zephyr.py, set_xtensa_params.sh) and app board configs to build/run QEMU DC233C targets.
  • Update app entry to optionally run SOF boot tests on QEMU and adjust userspace syscall gating.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
zephyr/test/userspace/README.md Documents how to build/run userspace tests on QEMU DC233C MMU.
zephyr/CMakeLists.txt Adds include paths and selects qemu_xtensa platform + sources when building for QEMU Xtensa.
src/platform/qemu_xtensa/platform.c Adds a (currently minimal) QEMU platform implementation file.
src/platform/qemu_xtensa/include/platform/trace/trace.h Adds a dummy trace header for the QEMU platform.
src/platform/qemu_xtensa/include/platform/platform.h Adds a dummy platform header for the QEMU platform.
src/platform/qemu_xtensa/include/platform/lib/memory.h Adds a dummy platform memory header for the QEMU platform.
src/platform/qemu_xtensa/include/platform/lib/mailbox.h Adds a dummy mailbox layout/ops header for the QEMU platform.
src/platform/qemu_xtensa/include/platform/lib/dma.h Adds a dummy DMA header for the QEMU platform.
src/platform/qemu_xtensa/include/platform/lib/dai.h Adds a dummy DAI header for the QEMU platform.
src/platform/qemu_xtensa/include/platform/lib/clk.h Adds a dummy clock header for the QEMU platform.
src/platform/qemu_xtensa/CMakeLists.txt Adds CMake glue to build QEMU platform sources in XTOS-style builds.
src/platform/CMakeLists.txt Registers the qemu_xtensa platform subdirectory when selected.
src/audio/module_adapter/module/generic.c Wraps userspace syscall verification/marshalling for mod_fast_get behind CONFIG_FAST_GET.
scripts/xtensa-build-zephyr.py Adds QEMU board targets and skips firmware install/RI info for QEMU builds.
scripts/set_xtensa_params.sh Adds QEMU xtensa toolchain settings and sets Zephyr toolchain variant for QEMU targets.
app/src/main.c Adds optional QEMU-only boot test execution and includes boot test header.
app/boards/qemu_xtensa_dc233c_mmu.conf Adds a Zephyr app board config for QEMU DC233C MMU.
app/boards/qemu_xtensa_dc233c.conf Adds a Zephyr app board config for QEMU DC233C.
app/CMakeLists.txt Switches SOF include dirs to a repo-relative path (instead of ${sof_module}).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is excellent, looks great! This is also a great checkpoint for #7248 , showing what a minimal SOF platform implementation looks like.

@lgirdwood
Copy link
Member Author

This is excellent, looks great! This is also a great checkpoint for #7248 , showing what a minimal SOF platform implementation looks like.

Ack - get more MMU on developers desks :)

(.venv) lrg@moth:~/work/sof/build-qemu_xtensa_mmu$ west build -t run
-- west build: running target run
[0/27] cmake -P /home/lrg/work/sof/sof/scripts/cmake/version.cmake
-- SOF version.cmake starting at 2026-02-24T15:36:32Z UTC
-- /home/lrg/work/sof/sof/ is at git commit with parent(s):
commit 7bee513d082b5e058f2accb3bde00c2c7907b439 f3a360cd9d6e7c35fe89994b58578e8f1f74dce6 (HEAD -> qemudc233c)
Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Date:   Tue Feb 24 15:23:00 2026 +0000

    qemu: add qemu target with and without MMU for CI and developer usage.
    
    Add a qemu target for SOF that will build with native zephyr support
    for drivers including xtensa MMU. This will be used for GH worklow
    ztest validation and as a SDV for userspace work.
    
    Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
-- GIT_TAG / GIT_LOG_HASH : v2.14-pre-rc-426-g7bee513d082b-dirty / 7bee513d0
-- Source content hash: a7e9da60. Notes:
  - by design, source hash is broken by Kconfig changes. See #3890.
  - Source hash is also broken by _asymmetric_ autocrlf=input, see
    #5917 and reverted #5920.
-- Unchanged /home/lrg/work/sof/build-qemu_xtensa_mmu/zephyr/include/generated/sof_versions.h
[1/2] To exit from QEMU enter: 'CTRL+a, x'[QEMU] CPU: dc233c
[    0.017300] <inf> init: FW ABI 0x301d001 DBG ABI 0x5003000 tags SOF:v2.14-pre-rc-426-g7bee513d082b-dirty zephyr:v4.3.0-5654-gf6a32b27dc17 src hash 0xa7e9da60 (ref hash 0xa7e9da60)
*** Booting Zephyr OS build v4.3.0-5654-gf6a32b27dc17 ***
[    0.017672] <inf> main: SOF on qemu_xtensa
[    0.017697] <inf> main: SOF initialized
Running TESTSUITE sof_boot
===================================================================
START - test_sys_sem
[    0.023955] <inf> sof_boot_test: SOF thread UserSpace! (qemu_xtensa/dc233c/mmu) sem 0x1a9000: 0
 PASS - test_sys_sem in 0.007 seconds
===================================================================
START - user_space
[    0.125345] <inf> sof_boot_test: SOF thread UserSpace! (qemu_xtensa/dc233c/mmu)
[    0.136033] <inf> sof_boot_test: SOF thread UserSpace! (qemu_xtensa/dc233c/mmu)
 PASS - user_space in 0.012 seconds
===================================================================
TESTSUITE sof_boot succeeded

------ TESTSUITE SUMMARY START ------

SUITE PASS - 100.00% [sof_boot]: pass = 2, fail = 0, skip = 0, total = 2 duration = 0.019 seconds
 - PASS - [sof_boot.test_sys_sem] duration = 0.007 seconds
 - PASS - [sof_boot.user_space] duration = 0.012 seconds

------ TESTSUITE SUMMARY END ------

===================================================================
PROJECT EXECUTION SUCCESSFUL
QEMU: Terminated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants