New Linux Patches Confirm Next-Gen EPYC "Milan" CPUs To Support MPK
The Memory Protection Key (PKE) support has been supported by Intel processors since Xeon Skylake and allow for page-based memory protections with the RDPKRU and WRPKRU instructions. As noted in the PRM, the feature "provides a way for applications to impose page-based data access protections (read/write, read-only or no access), without requiring modification of page tables and subsequent TLB invalidations when the application changes protection domains."
Sent out today were a set of patches reusing the Linux kernel's X86_INTEL_MEMORY_PROTECTION_KEYS code path and supporting MPK within the AMD SVM KVM virtualization code.
The patch comment spells it out quite clearly that this is for next-gen EPYC CPUs, "AMD's next generation of EPYC processors support the MPK (Memory Protection Keys) feature."
The patches are quite straight-forward in re-using the kernel's existing MPK code plumbed in previously by Intel and just two dozen or so lines of code for the AMD SVM code within the Kernel-based Virtual Machine (KVM).
It's possible this AMD MPK support will be mainlined for Linux 5.8. The patches may be revised as an upstream Intel developer has asked not to have the Kconfig X86_INTEL_MEMORY_PROTECTION_KEYS option to the proposed X86_MEMORY_PROTECTION_KEYS to avoid configuration file woes when transitioning to new kernel versions, so we'll see, but in any case it's a small enough change that there still is time to get this material queued for the forthcoming 5.8 cycle kicking off in June and should be out as stable in August.
This goes along with a string of other open-source work we have seen in recent weeks/months around Zen 3. AMD EPYC "Milan" Zen 3 based processors are expected to be released by the end of this calendar year.