[PATCH V2 2/2] arm64/mm: Add remaining TLBI_XXX_MASK macros

Anshuman Khandual anshuman.khandual at arm.com
Sun Oct 26 18:14:05 PDT 2025


On 24/10/25 2:26 PM, Ben Horgan wrote:
> Hi Anshuman,
> 
> On 10/24/25 05:02, Anshuman Khandual wrote:
>> Add remaining TLBI_XXX_MASK macros and replace current open encoded fields.
>> While here replace hard coded page size based shifts but with derived ones
>> via ilog2() thus adding some required context.
>>
>> TLBI_TTL_MASK has been split into separate TLBI_TTL_MASK and TLBI_TG_MASK
>> as appropriate because currently it simultaneously contains both page size
>> and translation table level information. KVM on arm64 has been updated to
>> accommodate these changes to TLBI_TTL_MASK.
>>
>> Cc: Catalin Marinas <catalin.marinas at arm.com>
>> Cc: Will Deacon <will at kernel.org>
>> Cc: Marc Zyngier <maz at kernel.org>
>> Cc: Oliver Upton <oliver.upton at linux.dev>
>> Cc: linux-arm-kernel at lists.infradead.org
>> Cc: linux-kernel at vger.kernel.org
>> Cc: kvmarm at lists.linux.dev
>> Signed-off-by: Anshuman Khandual <anshuman.khandual at arm.com>
>> ---
>>  arch/arm64/include/asm/tlbflush.h | 26 ++++++++++++++++++--------
>>  arch/arm64/kvm/nested.c           |  8 +++++---
>>  2 files changed, 23 insertions(+), 11 deletions(-)
>>
> The code looks correct to me, no functional changes. I however, don't
> have any experience with this code and so don't know whether the split
> of TTL into TG and TTL is a good idea or not and if the kvm naming is

TLBI_TTL field contains both encoded page size and also page table
level information. This split in the mask makes the code much clear
and explicit.
> best to stay the same or be updated to match this.
This proposed patch keeps the KVM code churn to the minimum while
also adapting to the mask split as necessary. But further changes
to KVM if required can be done subsequently later.



More information about the linux-arm-kernel mailing list