[PATCH v2 0/1] target/i386: Raise #GP on unaligned m128 accesses when required.

Ricky Zhou posted 1 patch 3 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220830021152.40618-1-ricky@rzhou.org
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>
target/i386/tcg/excp_helper.c        | 13 ++++++++
target/i386/tcg/helper-tcg.h         | 28 +++++++++-------
target/i386/tcg/sysemu/excp_helper.c |  8 +++++
target/i386/tcg/tcg-cpu.c            |  1 +
target/i386/tcg/translate.c          | 49 ++++++++++++++++++----------
target/i386/tcg/user/excp_helper.c   |  7 ++++
6 files changed, 77 insertions(+), 29 deletions(-)
[PATCH v2 0/1] target/i386: Raise #GP on unaligned m128 accesses when required.
Posted by Ricky Zhou 3 years, 5 months ago
Thanks Richard for the detailed comments/code pointers! I've switched to
using MO_ALIGN_16 and implemented record_sigbus and do_unaligned_access
hooks to simulate #GP(0) as suggested. Given what was said about the low
likelihood of implementing #AC anytime soon, I have hardcoded #GP(0) in
these hooks for now rather than plumbing through an extra bit in MemOp.
Let me know if that seems reasonable, thanks!

Ricky Zhou (1):
  target/i386: Raise #GP on unaligned m128 accesses when required.

 target/i386/tcg/excp_helper.c        | 13 ++++++++
 target/i386/tcg/helper-tcg.h         | 28 +++++++++-------
 target/i386/tcg/sysemu/excp_helper.c |  8 +++++
 target/i386/tcg/tcg-cpu.c            |  1 +
 target/i386/tcg/translate.c          | 49 ++++++++++++++++++----------
 target/i386/tcg/user/excp_helper.c   |  7 ++++
 6 files changed, 77 insertions(+), 29 deletions(-)

-- 
2.37.2