Re: [PATCH] mm: Update mask post pxd_clear_bad()

From: Dev Jain
Date: Fri Mar 14 2025 - 08:58:06 EST




On 14/03/25 2:14 am, Matthew Wilcox wrote:
On Thu, Mar 13, 2025 at 11:44:14PM +0530, Dev Jain wrote:
Since pxd_clear_bad() is an operation changing the state of the page tables,
we should call arch_sync_kernel_mappings() post this.

Could you explain why? What effect does not calling
arch_sync_kernel_mappings() have in this case?

Apologies, I again forgot to explain the userspace effect.
I just found this by code inspection, using the logic the fixes commit uses: we should sync when we change the pxd.

The question I have been pondering on is, what is the use of the pxd_bad() macros, when do we actually hit a bad state, and why don't we just trigger a BUG when we hit pxd_bad()?