Re: [PATCHv3 6/8] x86/mm: Provide ARCH_GET_UNTAG_MASK and ARCH_ENABLE_TAGGED_ADDR

From: Andy Lutomirski
Date: Tue Jun 28 2022 - 19:42:48 EST


On 6/10/22 07:35, Kirill A. Shutemov wrote:

+ /* Update CR3 to get LAM active */
+ switch_mm(current->mm, current->mm, current);

Can you at least justify this oddity? When changing an LDT, we use a dedicated mechanism. Is there a significant benefit to abusing switch_mm for this?

Also, why can't we enable LAM on a multithreaded process? We can change an LDT, and the code isn't even particularly complicated.