]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/mm: Handle global ASID context switch and TLB flush
authorRik van Riel <riel@surriel.com>
Wed, 26 Feb 2025 03:00:43 +0000 (22:00 -0500)
committerIngo Molnar <mingo@kernel.org>
Wed, 19 Mar 2025 10:12:29 +0000 (11:12 +0100)
commitbe88a1dd6112bbcf40d0fe9da02fb71bfb427cfe
tree5fb5311ec236d7489abd6a98301f3f425d1bc5f4
parentd504d1247e369e82c30588b296cc45a85a1ecc12
x86/mm: Handle global ASID context switch and TLB flush

Do context switch and TLB flush support for processes that use a global
ASID and PCID across all CPUs.

At both context switch time and TLB flush time, it needs to be checked whether
a task is switching to a global ASID, and, if so, reload the TLB with the new
ASID as appropriate.

In both code paths, the TLB flush is avoided if a global ASID is used, because
the global ASIDs are always kept up to date across CPUs, even when the
process is not running on a CPU.

  [ bp:
   - Massage
   - :%s/\<static_cpu_has\>/cpu_feature_enabled/cgi
  ]

Signed-off-by: Rik van Riel <riel@surriel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20250226030129.530345-9-riel@surriel.com
arch/x86/include/asm/tlbflush.h
arch/x86/mm/tlb.c