x86/traps: Demand-populate PASID MSR via #GP
authorFenghua Yu <fenghua.yu@intel.com>
Mon, 7 Feb 2022 23:02:51 +0000 (15:02 -0800)
committerBorislav Petkov <bp@suse.de>
Tue, 15 Feb 2022 10:31:43 +0000 (11:31 +0100)
commitfa6af69f38d3f409bedc55d0112eec36ed526d4b
tree24ecc48dfb6bb2b66a3a8900a981e18a33017169
parenta3d29e8291b622780eb6e4e3eeaf2b24ec78fd43
x86/traps: Demand-populate PASID MSR via #GP

All tasks start with PASID state disabled. This means that the first
time they execute an ENQCMD instruction they will take a #GP fault.

Modify the #GP fault handler to check if the "mm" for the task has
already been allocated a PASID. If so, try to fix the #GP fault by
loading the IA32_PASID MSR.

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>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20220207230254.3342514-9-fenghua.yu@intel.com
arch/x86/kernel/traps.c