Commit 6c6f1a5
arch: arm64: mmu: revert useless cache handling
This reverts the following commits:
commit c9b534c
("arch: arm64: mmu: avoid using of set/way cache instructions")
commit c4ffadb
("arch: arm64: avoid invalidating of RO mem after mem map")
The reason for the former is about Xen not virtualizing set/way cache
operations used by sys_cache_data_invd_all() originally used prior to
enabling the MMU and data cache. But the cure is worse than the Xen
issue as:
- Cache invalidation is performed on _every_ mapping change.
- Those invalidations are completely unnecessary with a PIPT data cache.
ARM64 implementations use Physically Indexed, Physically Tagged (PIPT)
data caches where cache maintenance is not needed during MMU operations.
- arch_mem_map() invoked with K_MEM_MAP_UNPAGED triggers page faults
when accessing the unmapped region for cache operations. The page
fault handler in do_page_fault() tries to reacquire z_mm_lock which
is already held by the caller of arch_mem_map(). This results in a
deadlock.
And the latter commit disables cache operations for read-only mappings,
effectively rendering the workaround described in the first commit
inoperative on half the mappings, making the performance cost of the
first commit's approach unjustifiable since it doesn't actually solve
the problem it set out to fix.
Given the above, the actual "fix" should simply have been the removal of
the sys_cache_data_invd_all() as, in theory, it isn't strictly needed
and its replacement is already ineffective on read-only areas as mentioned.
So let's revert them, which fixes the deadlock-induced CI test failures
on ARM FVP SMP configurations that were triggered when demand paging or
memory mapping operations were involved.
Signed-off-by: Nicolas Pitre <[email protected]>1 parent 5b43674 commit 6c6f1a5
1 file changed
+0
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
873 | | - | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | 873 | | |
889 | 874 | | |
890 | 875 | | |
| |||
924 | 909 | | |
925 | 910 | | |
926 | 911 | | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | | - | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | 912 | | |
942 | 913 | | |
943 | 914 | | |
| |||
1132 | 1103 | | |
1133 | 1104 | | |
1134 | 1105 | | |
1135 | | - | |
1136 | | - | |
1137 | 1106 | | |
1138 | 1107 | | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
1149 | 1108 | | |
1150 | 1109 | | |
1151 | 1110 | | |
| |||
1261 | 1220 | | |
1262 | 1221 | | |
1263 | 1222 | | |
1264 | | - | |
1265 | 1223 | | |
1266 | 1224 | | |
1267 | 1225 | | |
| |||
0 commit comments