KernelTestFramework / ktf

Kernel Test Framework
BSD 2-Clause "Simplified" License
140 stars 18 forks source link

[Feature] Add Process Context Identifier (PCID) support #319

Open wipawel opened 11 months ago

wipawel commented 11 months ago

Is your feature request related to a problem? Please describe.

Modern x86 CPUs have support for PCID for each individual address space for different tasks and contexts. Add support for it to further enhance KTF's TLB performance optimization (again quite irrelevant), but also enable new tests.

Describe the solution you'd like

Add function to enable PCID via setting CR4.PCIDE and kernel cmdline option to control enablement of the feature. Add allocation, deallocation and maintenance functionality for active/inactive PCIDs. Preferably via existing bitmap API and a single 4K frame allocation (PCID space is 12bit wide). Make sure each contexts has individual PCID allocated and used.