Re: [PATCH Part2 RFC v4 10/40] x86/fault: Add support to handle the RMP fault for user address

From: Dave Hansen
Date: Mon Jul 12 2021 - 12:30:18 EST

On 7/12/21 9:24 AM, Brijesh Singh wrote:
> Apologies if I was not clear in the messaging, that's exactly what I
> mean that we don't feed RMP entries during the page state change.
> The sequence of the operation is:
> 1. Guest issues a VMGEXIT (page state change) to add a page in the RMP
> 2. Hyperivosr adds the page in the RMP table.
> The check will be inside the hypervisor (#2), to query the backing page
> type, if the backing page is from the hugetlbfs, then don't add the page
> in the RMP, and fail the page state change VMGEXIT.

Right, but *LOOOOOONG* before that, something walked the page tables and
stuffed the PFN into the NPT (that's the AMD equivalent of EPT, right?).
You could also avoid this whole mess by refusing to allow hugetblfs to
be mapped into the guest in the first place.