On Thu, 29 Jul 2021 at 01:50, Richard Henderson <richard.hender...@linaro.org> wrote: > > This began with Peter wanting a cpu_ldst.h interface that can handle > alignment info for Arm M-profile system mode, which will also compile > for user-only without ifdefs. This is patch 32. > > Once I had that interface, I thought I might as well enforce the > requested alignment in user-only. There are plenty of cases where > we ought to have been doing that for quite a while. This took rather > more work than I imagined to start. > > So far only x86 host has been fully converted to handle unaligned > operations in user-only mode. I'll get to the others later. But > the added testcase is fairly broad, and caught lots of bugs and/or > missing code between target/ and linux-user/. > > Notes: > * For target/i386 we have no way to signal SIGBUS from user-only. > In theory we could go through do_unaligned_access in system mode, > via #AC. But we don't even implement that control in tcg, probably > because no one ever sets it. The cmpxchg16b insn requires alignment, > but raises #GP, which maps to SIGSEGV. > > * For target/s390x we have no way to signal SIGBUS from user-only. > The atomic operations raise PGM_SPECIFICATION, which the linux > kernel maps to SIGILL. > > * I think target/hexagon should be setting TARGET_ALIGNED_ONLY=y. > In the meantime, all memory accesses are allowed to be unaligned.
Could you include suitable updates to docs/devel/loads-stores.rst as well, please? thanks -- PMM