A quick question about ASID on KPTI
hi folks,
i am look at some patches about the KPTI on ARM64, a quick question about the ASDI on KPTI:
On KPIT, it will allocate a pairs ASID for a process, when the process running on kernel space, it will set the even ASID into TTBR1 register in tramp_map_kernel function, when the process running on User space, it will set the odd ASID into the TTBR1 register in tramp_unmap_kernel function. my question is, when the process running in kernel space, if the process want to access the userspace address by copy_to/from_user(), the CPU will look-up the TLB with even ASID or odd ASID? if it use even ASID to look-up TLB for userspace, it will always TLB miss, that will be performance impact. is it right? pls correct me if i am wrong.
Best
Ben
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 7 lines · FF
i am look at some patches about the KPTI on ARM64, a quick question about the ASDI on KPTI:
On KPIT, it will allocate a pairs ASID for a process, when the process running on kernel space, it will set the even ASID into TTBR1 register intramp_map_kernelfunction, when the process running on User space, it will set the odd ASID into the TTBR1 register intramp_unmap_kernelfunction.
Correct.
Quoted 3 lines
my question is, when the process running in kernel space, if the process want to access the userspace address by copy_to/from_user(), the CPU will look-up the TLB with even ASID or odd ASID?
The even ASID as that's the current one.
Quoted 2 lines
if it use even ASID to look-up TLB for userspace, it will always TLB miss, that will be performance impact. is it right?
As with any other TLB miss, a TLB entry will be allocated and may or may not be removed, depending on what other activities happen on the CPU. In theory, there is a small performance impact but I don't think it's significant in practice (with real-world benchmarks).
Signature · 6 lines
Catalin _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel