Skip to content

Commit 2f6087b

Browse files
povergoingstephanosio
authored andcommitted
arch: arm64: Fix arm mpu SMP issues
Only primary core do the dynamic_areas_init. Signed-off-by: Jaxson Han <[email protected]>
1 parent ab29fb8 commit 2f6087b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arch/arm64/core/cortex_r/arm_mpu.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ static void region_init(const uint32_t index,
151151
*/
152152
void z_arm64_mm_init(bool is_primary_core)
153153
{
154-
/* This param is only for compatibility with the MMU init */
155-
ARG_UNUSED(is_primary_core);
156154
uint64_t val;
157155
uint32_t r_index;
158156

@@ -200,7 +198,12 @@ void z_arm64_mm_init(bool is_primary_core)
200198

201199
arm_core_mpu_enable();
202200

201+
if (!is_primary_core) {
202+
return;
203+
}
204+
203205
#ifdef CONFIG_USERSPACE
206+
/* Only primary core do the dynamic_areas_init. */
204207
int rc = dynamic_areas_init(MPU_DYNAMIC_REGIONS_AREA_START,
205208
MPU_DYNAMIC_REGIONS_AREA_SIZE);
206209
if (rc <= 0) {

0 commit comments

Comments
 (0)