#2775 closed defect (fixed)

ARM CP15 arm_cp15_set_translation_table_entries fails if TTB in read-only memory

Reported by: Chris Johns Owned by: Chris Johns <chrisj@…>
Priority: normal Milestone: 5.1
Component: arch/arm Version: 5
Severity: normal Keywords: ARM
Cc: Blocked By:
Blocking:

Description

If the TTB is held in the text section and the section is set to read-only, and cached when booting no section change happen at run time because the table cannot be written too to change. The table cannot be changed unless the MMU is disabled.

I suggest the MMU be disabled, the table updated and then the MMU enabled.

Note, the issue only shows up on real hardware, qemu does not complain.

Change History (10)

comment:1 Changed on Aug 14, 2016 at 9:51:15 PM by Pavel Pisa

I think that disabling of MMU at runtime is highly problematic. You need to stop all parallel processes to ensure that all modifications held in cache are propagated to memory and then switch MMU off. If multiple CPUs are running (SMP) then there is almost no way hot to ensure fully synchronized case for at least some ARM architecture members. Coherency is maintained through MMU and guaranteed only for cache clean through VMA. The cache clean by level+set+way does not need to generate required snoop operations.

On the other hand, ARM architecture is prepared and operations are optimized for runtime page tables updates and switching and there are defined operations sequences to ensure correct page tables changes propagations in ARM architecture manuals. So I vote for this direction.

comment:2 Changed on Aug 14, 2016 at 10:38:09 PM by Chris Johns

I agree it is problematic for a running system. I had not seen the note in your git commit about adding the MMU tables section. I have a patch which add this to the default set. It removes the current issue we are facing.

comment:3 Changed on Aug 14, 2016 at 11:23:05 PM by Chris Johns <chrisj@…>

Owner: set to Chris Johns <chrisj@…>
Resolution: fixed
Status: newclosed

In 01aa1ba34a1696736ed5200ffa1d4be9963d99b3/rtems:

libbsp/arm: Add the TTB table to the default MMU set up as read/write.

This lets the table be changed at runtime for dynamic loading and
debugger support.

Closes #2775.

comment:4 Changed on Aug 17, 2016 at 7:34:22 AM by Sebastian Huber

Resolution: fixed
Status: closedreopened

This change breaks a lot of ARM BSPs since bsp_translation_table_end is not defined.

comment:5 Changed on Aug 17, 2016 at 7:41:49 AM by Chris Johns

If you have a list I can add them to https://git.rtems.org/rtems-tools/tree/tester/rtems/rtems-bsps.ini and then they can be built.

Thanks.

comment:6 Changed on Aug 17, 2016 at 8:18:38 AM by Sebastian Huber

You can use "/path/to/rtems/configure --target=arm-rtems4.12 --enable-maintainer-mode --enable-tests=samples" to build all ARM BSPs.

comment:7 Changed on Aug 23, 2016 at 1:14:16 AM by Chris Johns <chrisj@…>

Resolution: fixed
Status: reopenedclosed

In 89a319a0f8bb9374e5a23358b266db3745268a3a/rtems:

libbsp/arm: Fix ARM BSPs missing the bsp_translation_table_end symbol.

Closes #2775.

comment:8 Changed on May 11, 2017 at 7:31:02 AM by Sebastian Huber

Milestone: 4.124.12.0

comment:9 Changed on Oct 10, 2017 at 6:32:23 AM by Sebastian Huber

Component: libcpuarch/arm

comment:10 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber

Milestone: 4.12.05.1

Milestone renamed

Note: See TracTickets for help on using tickets.