Re: [PATCH v3 04/11] arm64/mm: Add set_memory_device() and set_memory_normal()

From: Will Deacon

Date: Thu Jul 02 2026 - 05:56:41 EST


On Wed, Jul 01, 2026 at 06:08:15PM +0200, Thierry Reding wrote:
> From: Chun Ng <chunn@xxxxxxxxxx>
>
> Add helpers to swap PROT_NORMAL and PROT_DEVICE_nGnRnE protection bits
> on a kernel-linear-map range.

That sounds like a really terrible idea. Why is this necessary and how
does it interact with things like load_unaligned_zeropad()?

I think you should unmap the memory from the linear map and memremap()
it instead.

Will