On Wed, 15 Nov 2023 at 17:26, Patrick Venture <vent...@google.com> wrote: > > > > On Wed, Nov 15, 2023 at 9:02 AM Richard Henderson > <richard.hender...@linaro.org> wrote: >> >> On 11/15/23 08:58, Patrick Venture wrote: >> > >> > >> > On Wed, Nov 15, 2023 at 2:35 AM Peter Maydell <peter.mayd...@linaro.org >> > <mailto:peter.mayd...@linaro.org>> wrote: >> > >> > On Tue, 14 Nov 2023 at 20:55, Patrick Venture <vent...@google.com >> > <mailto:vent...@google.com>> wrote: >> > > Avoids unaligned pointer issues. >> > > >> > >> > It would be nice to be more specific in the commit message here, by >> > describing what kind of guest behaviour or machine config runs into >> > this >> > problem, and whether this happens in a situation users are likely to >> > run into. If the latter, we should consider tagging the commit >> > with "Cc: qemu-sta...@nongnu.org <mailto:qemu-sta...@nongnu.org>" to >> > have it >> > backported to the >> > stable release branches. >> > >> > >> > Thanks! I'll update the commit message with v2. We were seeing this in our >> > infrastructure with unaligned accesses using the pointer dereference as >> > there are no >> > guarantees on alignment of the incoming values. >> >> Which host cpu, for reference? There aren't many that generate unaligned >> traps these days... >> > > Here's the sanitizer log/qemu log, the host-cpu was an amd64. > third_party/qemu/softmmu/memory.c:1341:16: runtime error: load of misaligned > address 0x52500020b10d for type 'uint32_t' (aka 'unsigned int'), which > requires 4 byte alignment > 0x52500020b10d: note: pointer points here > ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab ab > ab ab ab ab ab ab ab ab > ^
> SUMMARY: UndefinedBehaviorSanitizer: misaligned-pointer-use > third_party/qemu/softmmu/memory.c:1341:16 in Ah, right, so the clang/gcc undefined-behaviour sanitizers rather than the actual host hardware barfing. (We definitely want to fix these regardless.) thanks -- PMM