Re: [PATCH 09/12] KVM: selftests: Move all PTE accesses into nested_create_pte()

From: Jim Mattson

Date: Mon Oct 13 2025 - 14:41:35 EST


On Wed, Oct 1, 2025 at 8:05 AM Yosry Ahmed <yosry.ahmed@xxxxxxxxx> wrote:
>
> From: Yosry Ahmed <yosryahmed@xxxxxxxxxx>
>
> In preparation for making the nested mapping functions work for NPT,
> move all logic that directly accesses the PTE into nested_create_pte(),
> as these accesses will be different for SVM.
>
> Stop using struct eptPageTableEntry in the caller, instead pass a
> uint64_t pointer (and add an assertion on the size to make sure it stays
> correct).
>
> Calculate whether or not an EPT entry is a leaf in __nested_pg_map(),
> and return the address from nested_create_pte() to __nested_pg_map().
> Also, set the access and dirty bits in nested_create_pte() for leaf
> entries. This matches the current behavior and removes all direct
> accesses to the EPT entry from __nested_pg_map().
>
> Signed-off-by: Yosry Ahmed <yosry.ahmed@xxxxxxxxx>

Reviewed-by: Jim Mattson <jmattson@xxxxxxxxxx>