]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: mm: Rename asid2idx() to ctxid2asid()
authorYunfeng Ye <yeyunfeng@huawei.com>
Thu, 9 Dec 2021 01:42:25 +0000 (09:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2025 12:24:59 +0000 (13:24 +0100)
commitde29cb3bdfb223b2d03089d8f2deab9b0cfff726
treeb2ca49ad4e2f7e8f5353a2d1dc8380c8ce08d583
parent109f91d8b9335b0f3714ef9920eae5a8b21d56af
arm64: mm: Rename asid2idx() to ctxid2asid()

[ Upstream commit a3a5b763410c7bceacf41a52071134d9dc26202a ]

The commit 0c8ea531b774 ("arm64: mm: Allocate ASIDs in pairs") introduce
the asid2idx and idx2asid macro, but these macros are not really useful
after the commit f88f42f853a8 ("arm64: context: Free up kernel ASIDs if
KPTI is not in use").

The code "(asid & ~ASID_MASK)" can be instead by a macro, which is the
same code with asid2idx(). So rename it to ctxid2asid() for a better
understanding.

Also we add asid2ctxid() macro, the contextid can be generated based on
the asid and generation through this macro.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Link: https://lore.kernel.org/r/c31516eb-6d15-94e0-421c-305fc010ea79@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Stable-dep-of: c0900d15d31c ("arm64: Ensure bits ASID[15:8] are masked out when the kernel uses 8-bit ASIDs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/mm/context.c