Reenable ENQCMD/PASID support:

 - Simplify the PASID handling to allocate the PASID once, associate it to
   the mm of a process and free it on mm_exit(). The previous attempt of
   refcounted PASIDs and dynamic alloc()/free() turned out to be error
   prone and too complex. The PASID space is 20bits, so the case of
   resource exhaustion is a pure academic concern.

 - Populate the PASID MSR on demand via #GP to avoid racy updates via IPIs.

 - Reenable ENQCMD and let objtool check for the forbidden usage of ENQCMD
   in the kernel.

 - Update the documentation for Shared Virtual Addressing accordingly.
Documentation/x86: Update documentation for SVA (Shared Virtual Addressing)

Adjust the documentation to the new way how a PASID is being allocated,
freed and fixed up.

Based on a patch by Ashok Raj <ashok.raj@intel.com>

  [ bp: Massage commit message, fix htmldocs build warning ]

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220207230254.3342514-12-fenghua.yu@intel.com
1 file changed