Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

When to enable memory pool locks #4

@hkim15

Description

@hkim15

mpool_locks_enabled begin with false initially, It is set to true only after Hafnium's own stage-1 page table is intialized.

/* Enable locks now that mm is initialised. */
dlog_enable_lock();
mpool_enable_locks();

According to the comment, it appears that the author thought lock should be enabled because Hafnium's stage-1 page table is initialized. Stage-1 page table does not appear relevant. But, presence of multiple, competing threads should have triggered switching from false to true.

In the current code, there is only one thread available when one_time_init() is executed. Therefore, it should be safe to move both dlog_enable_lock() and mpool_enable_locks() to the end of one_time_init(), where TLB invalidation is turned on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions