On 7/12/21 11:29 AM, Dave Hansen wrote:
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.
Ah, that should be doable. For SEV stuff, we require the VMM to register
the memory region to the hypervisor during the VM creation time. I can
check the hugetlbfs while registering the memory region and fail much
earlier.
thanks