Re: [PATCH v4 01/15] arm64: mm: Map the linear alias of text/rodata as tagged

Ard Biesheuvel
2026-04-28T16:24:12Z

Hi Kevin,

On Tue, 28 Apr 2026, at 16:16, Kevin Brodsky wrote:
> On 27/04/2026 17:34, Ard Biesheuvel wrote:
>> From: Ard Biesheuvel <ardb@kernel.org>
>>
>> Before moving the empty_zero_page into the __ro_after_init section, make
>> sure it has the memory-tagged type. This is needed to ensure that
>> cpu_enable_mte() will be able to initialize the tags correctly.
>
> mark_linear_text_alias_ro() is called after all features have been
> detected and enabled, so do we actually need this?
>
> AFAICT the lines that matter for cpu_enable_mte() are those, in map_mem():
>
>     __map_memblock(pgdp, kernel_start, kernel_end,
>                PAGE_KERNEL, NO_CONT_MAPPINGS);
>
> It is probably this call that needs to be changed to use
> pgprot_tagged(PAGE_KERNEL).
>

I see. I guess we should probably update both, no?