Antonio Borneo
5dc5ed5714
target/cortex_a: use aligned accesses for read/write cpu memory slow
...
Armv7a is able to read and write memory at un-aligned address, but
only when bit SCTLR.A (Alignment check enable) is zero and the
address belongs to a memory space with attribute "Normal" (see [1]
chapter A3.2.1 "Unaligned data access"). In all the other cases
the memory access will trigger an alignment fault data abort
exception.
Memory attributes are explained in [1] chapter A3.5 "Memory types
and attributes and the memory order model".
Disabling the MMU cause a change in memory attribute, as explained
in [1] chapter B3.2 "The effects of disabling MMUs on VMSA
behavior".
This can cause several issues. e.g. a SW breakpoint on un-aligned
4-byte Thumb instruction, set when MMU is on, can be impossible to
remove when MMU turns off.
While is possible to check all the possible conditions before an
un-aligned memory access, it's clearly more maintainable to skip
such complexity and only perform aligned accesses.
Check the alignment and eventually modify the data size before
calling the functions cortex_a_{read,write}_cpu_memory_slow().
Change the comment in the two functions above to comply with the
new behaviour.
[1] ARM DDI 0406C.d - "ARM Architecture Reference Manual, ARMv7-A
and ARMv7-R edition"
Change-Id: I57b4c11e7fa7e78aaaaee4406a5734b48db740ae
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com >
Reviewed-on: http://openocd.zylin.com/5138
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de >
2019-10-18 09:20:58 +01:00
..
2019-05-14 19:37:11 +01:00
2019-05-14 19:37:11 +01:00
2019-06-14 12:10:40 +01:00
2018-01-16 09:05:41 +00:00
2019-10-18 09:20:49 +01:00
2019-04-07 08:19:15 +01:00
2016-05-24 22:30:01 +01:00
2017-02-10 13:50:17 +01:00
2019-05-14 19:37:11 +01:00
2017-02-10 13:50:17 +01:00
2019-01-08 09:59:42 +00:00
2016-05-24 22:30:55 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2016-07-19 10:45:16 +01:00
2016-05-24 22:30:55 +01:00
2019-03-06 16:10:33 +00:00
2016-05-24 22:30:55 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2019-05-14 19:37:11 +01:00
2017-02-10 13:50:17 +01:00
2019-05-14 19:37:11 +01:00
2017-02-10 13:50:17 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2019-06-19 09:51:54 +01:00
2019-10-18 09:20:49 +01:00
2019-05-14 19:37:11 +01:00
2018-04-10 09:13:02 +01:00
2019-10-18 09:20:49 +01:00
2018-06-22 07:42:27 +01:00
2018-01-13 08:36:29 +00:00
2018-11-06 12:42:24 +00:00
2018-11-06 12:42:24 +00:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2019-01-23 15:26:39 +00:00
2019-03-06 16:16:29 +00:00
2018-06-04 09:16:08 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2019-01-08 10:00:09 +00:00
2019-05-14 19:37:11 +01:00
2019-05-14 19:35:41 +01:00
2016-05-24 22:30:01 +01:00
2017-02-10 13:50:17 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2019-05-14 19:37:11 +01:00
2017-02-10 13:50:17 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2019-06-12 15:14:50 +01:00
2019-06-12 15:14:44 +01:00
2019-05-14 19:37:11 +01:00
2019-05-14 19:35:47 +01:00
2019-03-01 08:32:03 +00:00
2018-07-19 10:49:24 +01:00
2019-06-10 20:35:39 +01:00
2018-04-10 06:16:40 +01:00
2019-05-14 19:37:11 +01:00
2017-02-10 14:01:39 +01:00
2019-03-04 11:53:00 +00:00
2018-03-16 08:58:06 +00:00
2018-01-04 09:09:46 +00:00
2018-03-10 13:23:48 +00:00
2019-05-14 19:37:11 +01:00
2019-05-14 19:35:25 +01:00
2019-03-06 16:14:36 +00:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2017-02-10 13:50:17 +01:00
2016-05-24 22:30:55 +01:00
2019-03-12 06:43:49 +00:00
2017-02-10 13:50:17 +01:00
2019-10-18 09:20:58 +01:00
2018-11-06 12:17:48 +00:00
2019-06-20 19:51:01 +01:00
2019-06-19 09:35:05 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2019-09-08 11:52:06 +01:00
2016-05-24 22:30:55 +01:00
2017-02-10 13:50:17 +01:00
2016-05-24 22:30:55 +01:00
2019-03-06 16:15:56 +00:00
2016-05-24 22:30:55 +01:00
2018-12-12 08:47:44 +00:00
2018-12-12 08:47:44 +00:00
2018-10-16 11:58:24 +01:00
2019-05-14 19:37:11 +01:00
2018-12-12 08:47:44 +00:00
2019-05-14 19:37:11 +01:00
2018-12-12 08:47:44 +00:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2019-01-08 09:59:42 +00:00
2019-03-06 16:17:24 +00:00
2019-03-01 08:32:03 +00:00
2018-11-18 08:21:25 +00:00
2017-02-10 13:50:17 +01:00
2019-03-06 16:19:28 +00:00
2017-02-10 13:50:17 +01:00
2017-02-10 13:50:17 +01:00
2018-12-12 08:47:44 +00:00
2019-06-12 15:15:29 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2017-05-08 18:03:28 +01:00
2019-03-23 17:43:30 +00:00
2019-05-14 19:37:11 +01:00
2018-04-10 06:16:40 +01:00
2017-05-08 18:05:58 +01:00
2018-01-13 09:46:00 +00:00
2019-05-14 19:37:11 +01:00
2017-05-08 18:04:56 +01:00
2017-02-10 13:50:17 +01:00
2017-02-10 13:50:17 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:01 +01:00
2016-05-24 22:30:55 +01:00
2017-02-10 13:50:17 +01:00
2017-02-10 13:50:17 +01:00
2017-02-10 13:50:17 +01:00
2016-05-24 22:30:55 +01:00
2017-02-10 13:50:17 +01:00
2017-02-10 13:50:17 +01:00
2017-02-10 13:50:17 +01:00
2016-05-24 22:30:55 +01:00
2017-02-10 13:50:17 +01:00
2016-05-24 22:30:55 +01:00
2018-06-04 09:16:08 +01:00
2017-02-10 13:50:17 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2016-05-24 22:30:01 +01:00
2018-01-13 09:25:12 +00:00
2019-08-28 08:07:37 +01:00
2019-08-28 08:07:37 +01:00
2019-05-14 19:37:11 +01:00
2018-06-04 09:16:08 +01:00
2019-05-14 19:37:11 +01:00
2019-03-27 08:55:03 +00:00
2019-02-19 08:53:47 +00:00
2019-05-14 19:37:11 +01:00
2017-12-07 07:53:13 +00:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2019-08-28 08:07:37 +01:00
2019-10-18 09:17:24 +01:00
2019-08-28 08:07:37 +01:00
2019-04-07 08:17:36 +01:00
2019-05-14 19:37:11 +01:00
2016-05-24 22:30:55 +01:00
2019-05-14 19:37:11 +01:00
2018-01-13 09:25:34 +00:00
2019-06-12 15:15:40 +01:00
2016-05-24 22:30:55 +01:00