[RFC V2 02/14] mm: Add read-write accessors for vm_page_prot
Mike Rapoport
rppt at kernel.org
Sun May 17 11:59:05 PDT 2026
On Wed, May 13, 2026 at 10:15:35AM +0530, Anshuman Khandual wrote:
> Currently vma->vm_page_prot is safely read from and written to, without any
> locks with READ_ONCE() and WRITE_ONCE(). But with introduction of D128 page
> tables on arm64 platform, vm_page_prot grows to 128 bits which can't safely
> be handled with READ_ONCE() and WRITE_ONCE().
>
> Add read and write accessors for vm_page_prot like pgprot_[read|write]()
> which any platform can override when required, although still defaulting as
> READ_ONCE() and WRITE_ONCE(), thus preserving the functionality for others.
>
> Cc: Andrew Morton <akpm at linux-foundation.org>
> Cc: David Hildenbrand <david at kernel.org>
> Cc: Lorenzo Stoakes <lorenzo.stoakes at oracle.com>
> Cc: Mike Rapoport <rppt at kernel.org>
> Cc: linux-mm at kvack.org
> Cc: linux-kernel at vger.kernel.org
> Signed-off-by: Anshuman Khandual <anshuman.khandual at arm.com>
Acked-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
> ---
> Changes in RFC V2:
>
> - Dropped _once from pgprot_[read|write]() callbacks per Mike
>
> include/linux/pgtable.h | 14 ++++++++++++++
> mm/huge_memory.c | 4 ++--
> mm/memory.c | 2 +-
> mm/migrate.c | 2 +-
> mm/mmap.c | 2 +-
> 5 files changed, 19 insertions(+), 5 deletions(-)
--
Sincerely yours,
Mike.
More information about the linux-arm-kernel
mailing list