Not all ipc_comp_dev structs contain a comp_dev pointer, it's unioned
based on the "type" field. Since the object ID is part of an IPC
command and under the control of external software, and since there
can be valid non-stream components stored in the list, we need to
check this type before accessing the invalid data belonging to the
other union types.
It's possible to reach dma_trace_on() from IPC handlers based on host
state before DMA trace has been initialized (found this via fuzzing,
so the precise circumstances are a little opaque). When that happens,
the schedule_task() call ends up putting a delayed work queue item
into the Zephyr queue which has a NULL callback. This eventually
blows up later when the timeout expires.
Check for initialization state before doing anything.
ipc3: Silence top-level IPC cmd formatting errors when fuzzing
Command format errors during fuzzing are reported for virtually all
commands, and the resulting flood of logging becomes a severe
performance penalty (i.e. we get a lot less fuzzing done per CPU
cycle).
This extends the ideas in CONFIG_LIBRARY=y to implement SOF as an
application for the Zephyr native_posix architecture. These are host
x86 or x86_64 binaries that include a full OS build, which can be used
(via mocked drivers) for testing against host validation environments
like ASAN/MSAN.
The mechanism uses the existing "host" architecture used by
CONFIG_LIBRARY, but adds a new platform layer named "posix", populated
entirely with stubs.
No driver integration is provided in this patch. The resulting
executable builds correctly, but has no devices and won't do anything.
This file needs the clk.h APIs, so include the header. Don't include
the Xtensa cache.h, as it's unused (and not supposed to be, zephyr.c
is portable code). Use the proper interrupt en/disable APIs instead
of the SOC-level calls they wrap.