qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: JIANG Muhui <1905356@bugs.launchpad.net>
To: qemu-devel@nongnu.org
Subject: [Bug 1905356] Re: No check for unaligned data access in ARM32 instructions
Date: Wed, 25 Nov 2020 03:35:14 -0000	[thread overview]
Message-ID: <160627531411.8423.11269209663426726849.malone@gac.canonical.com> (raw)
In-Reply-To: 160619430337.31223.17547021210606740630.malonedeb@chaenomeles.canonical.com

Thanks for confirmation.

Btw: I was wondering why the fix will only apply to system mode rather
than user-only mode. Unaligned data access is not permitted in user
level programs, either.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1905356

Title:
  No check for unaligned data access in ARM32 instructions

Status in QEMU:
  Confirmed

Bug description:
  hi

  According to the ARM documentation, there are alignment requirements
  of load/store instructions.  Alignment fault should be raised if the
  alignment check is failed. However, it seems that QEMU doesn't
  implement this, which is against the documentation of ARM. For
  example, the instruction LDRD/STRD/LDREX/STREX must check the address
  is word alignment no matter what value the SCTLR.A is.

  I attached a testcase, which contains an instruction at VA 0x10240:
  ldrd r0,[pc.#1] in the main function. QEMU can successfully load the
  data in the unaligned address. The test is done in QEMU 5.1.0. I can
  provide more testcases for the other instructions if you need. Many
  thanks.

  To patch this, we need a check while we translate the instruction to
  tcg. If the address is unaligned, a signal number (i.e., SIGBUS)
  should be raised.

  Regards
  Muhui

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1905356/+subscriptions


  parent reply	other threads:[~2020-11-25  3:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-24  5:05 [Bug 1905356] [NEW] No check for unaligned data access in ARM32 instructions JIANG Muhui
2020-11-24 23:46 ` [Bug 1905356] " Richard Henderson
2020-11-25  3:18 ` Richard Henderson
2020-11-25  3:35 ` JIANG Muhui [this message]
2020-11-25  4:04 ` Richard Henderson
2020-11-25  4:47 ` Richard Henderson
2021-05-05  5:31 ` Thomas Huth
2021-08-25  7:12 ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=160627531411.8423.11269209663426726849.malone@gac.canonical.com \
    --to=1905356@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).