[PATCH v1 1/3] KVM: arm64: Consistently use free_removed_table() for stage-2

Yu Zhao yuzhao at google.com
Thu Jun 8 15:13:44 PDT 2023


On Thu, Jun 8, 2023 at 4:06 PM Chun-Tse Shao <ctshao at google.com> wrote:
>
> From: Oliver Upton <oliver.upton at linux.dev>
>
> free_removed_table() is essential to the RCU-protected parallel walking
> scheme, as behind the scenes the cleanup is deferred until an RCU grace
> period. Nonetheless, the stage-2 unmap path calls put_page() directly,
> which leads to table memory being freed inline with the table walk.
>
> This is safe for the time being, as the stage-2 unmap walker is called
> while holding the write lock. A future change to KVM will further relax
> the locking mechanics around the stage-2 page tables to allow lock-free
> walkers protected only by RCU. As such, switch to the RCU-safe mechanism
> for freeing table memory.
>
> Signed-off-by: Oliver Upton <oliver.upton at linux.dev>
> Signed-off-by: Chun-Tse Shao <ctshao at google.com>

Acked-by: Yu Zhao <yuzhao at google.com>



More information about the linux-arm-kernel mailing list