Re: [PATCH Part2 v6 14/49] crypto: ccp: Handle the legacy TMR allocation when SNP is enabled

From: Kalra, Ashish
Date: Wed Nov 16 2022 - 14:23:40 EST


On 11/16/2022 1:09 PM, Borislav Petkov wrote:
On Wed, Nov 16, 2022 at 12:53:36PM -0600, Kalra, Ashish wrote:
Actually, these host allocated pages would have already been removed from
the kernel direct map,

And, as I said above, it would be a lot easier to handle any potential
faults resulting from the host touching them by having it raise a *RMP*
fault instead of normal *PF* fault where the latter code is a crazy mess.

Just to reiterate here, we won't be getting a *RMP* fault but will instead get a normal (not-present) #PF fault when the host touches these pages.

Sorry for any confusion about the fault signaled, earlier i mentioned we will get a RMP violation #PF, but actually as these pages are also removed from the kernel direct-map, therefore, we will get the not-present #PF and not the RMP #PF (core will check and signal not-present #PF before it performs the RMP checks).

Thanks,
Ashish