Activity log for bug #1905356

Date Who What changed Old value New value Message
2020-11-24 05:05:03 JIANG Muhui bug added bug
2020-11-24 05:05:03 JIANG Muhui attachment added case_ldrd_arm https://bugs.launchpad.net/bugs/1905356/+attachment/5437364/+files/case_ldrd_arm
2020-11-24 05:05:38 JIANG Muhui 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 a 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 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
2020-11-24 23:43:39 Richard Henderson qemu: status New Confirmed
2020-11-25 03:18:14 Richard Henderson qemu: assignee Richard Henderson (rth)
2021-05-05 05:31:59 Thomas Huth qemu: status Confirmed Fix Committed
2021-08-25 07:12:58 Thomas Huth qemu: status Fix Committed Fix Released