posix: align mailboxes

Using unaligned mailboxes with UBSAN causes fuzzing failures with
aligned data structures

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
This commit is contained in:
Curtis Malainey 2024-09-03 16:44:35 -07:00 committed by Liam Girdwood
parent 19ea950b61
commit 01c9ce9eda
2 changed files with 8 additions and 8 deletions

View File

@ -11,19 +11,19 @@
#define uncache_to_cache(addr) (addr)
#define cache_to_uncache(addr) (addr)
extern uint8_t posix_hostbox[];
extern uint32_t posix_hostbox[];
#define MAILBOX_HOSTBOX_SIZE 1024
#define MAILBOX_HOSTBOX_BASE (&posix_hostbox[0])
extern uint8_t posix_dspbox[];
extern uint32_t posix_dspbox[];
#define MAILBOX_DSPBOX_SIZE 4096
#define MAILBOX_DSPBOX_BASE (&posix_dspbox[0])
extern uint8_t posix_stream[];
extern uint32_t posix_stream[];
#define MAILBOX_STREAM_SIZE 4096
#define MAILBOX_STREAM_BASE (&posix_stream[0])
extern uint8_t posix_trace[];
extern uint32_t posix_trace[];
#define MAILBOX_TRACE_BASE (&posix_trace[0])
#define MAILBOX_TRACE_SIZE 4096

View File

@ -9,10 +9,10 @@
#include <sof/schedule/ll_schedule.h>
#include <sof/lib/agent.h>
uint8_t posix_hostbox[MAILBOX_HOSTBOX_SIZE];
uint8_t posix_dspbox[MAILBOX_DSPBOX_SIZE];
uint8_t posix_stream[MAILBOX_STREAM_SIZE];
uint8_t posix_trace[MAILBOX_TRACE_SIZE];
uint32_t posix_hostbox[MAILBOX_HOSTBOX_SIZE / sizeof(uint32_t)];
uint32_t posix_dspbox[MAILBOX_DSPBOX_SIZE / sizeof(uint32_t)];
uint32_t posix_stream[MAILBOX_STREAM_SIZE / sizeof(uint32_t)];
uint32_t posix_trace[MAILBOX_TRACE_SIZE / sizeof(uint32_t)];
/* This seems like a vestige. Existing Zephyr platforms are emitting
* these markers in their linker scripts, and wrapper.c code iterates