[v3 PATCH] arm64: mm: Fix kexec failure after pte_mkwrite_novma() change

Will Deacon will at kernel.org
Fri Jan 9 03:51:28 PST 2026


On Tue, Jan 06, 2026 at 09:30:23PM +0800, Huang, Ying wrote:
> Catalin Marinas <catalin.marinas at arm.com> writes:
> > diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h
> > index 161e8660eddd..113c257d19c4 100644
> > --- a/arch/arm64/include/asm/pgtable-prot.h
> > +++ b/arch/arm64/include/asm/pgtable-prot.h
> > @@ -50,11 +50,11 @@
> >
> >  #define _PAGE_DEFAULT		(_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
> >
> > -#define _PAGE_KERNEL		(PROT_NORMAL)
> > -#define _PAGE_KERNEL_RO		((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY)
> > -#define _PAGE_KERNEL_ROX	((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY)
> > -#define _PAGE_KERNEL_EXEC	(PROT_NORMAL & ~PTE_PXN)
> > -#define _PAGE_KERNEL_EXEC_CONT	((PROT_NORMAL & ~PTE_PXN) | PTE_CONT)
> > +#define _PAGE_KERNEL		(PROT_NORMAL | PTE_DIRTY)
> > +#define _PAGE_KERNEL_RO		((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY | PTE_DIRTY)
> > +#define _PAGE_KERNEL_ROX	((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY | PTE_DIRTY)
> 
> IMHO, it appears not absolutely natural to make read-only kernel mapping
> dirty unconditionally.  However it should work.  I have no strong
> opinions here too.

So I think that's what we *used* to do and it's also what some other
architectures (notably, 32-bit ARM) continue to do. In which case, I
think I'd prefer to follow the tried-and-tested approach of marking all
kernel mappings as dirty unless there's a technical downside of doing
that.

Will



More information about the linux-arm-kernel mailing list