Re: [PATCH v3 11/16] KVM: selftests: Move TDP mapping functions outside of vmx.c
From: Sean Christopherson
Date: Tue Dec 23 2025 - 18:13:09 EST
On Thu, Nov 27, 2025, Yosry Ahmed wrote:
> diff --git a/tools/testing/selftests/kvm/lib/x86/processor.c b/tools/testing/selftests/kvm/lib/x86/processor.c
> index 8b0e17f8ca37..517a8185eade 100644
> --- a/tools/testing/selftests/kvm/lib/x86/processor.c
> +++ b/tools/testing/selftests/kvm/lib/x86/processor.c
> @@ -467,6 +467,77 @@ void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent)
> }
> }
>
> +/*
> + * Map a range of TDP guest physical addresses to the VM's physical address
> + *
> + * Input Args:
> + * vm - Virtual Machine
> + * nested_paddr - Nested guest physical address to map
> + * paddr - VM Physical Address
> + * size - The size of the range to map
> + * level - The level at which to map the range
> + *
> + * Output Args: None
> + *
> + * Return: None
> + *
> + * Within the VM given by vm, creates a nested guest translation for the
> + * page range starting at nested_paddr to the page range starting at paddr.
> + */
Eh, opportunistically drop this function comment. If the reader can't figure out
what tdp_map() is doing, a failure generic comment isn't likely to help.
> +void __tdp_map(struct kvm_vm *vm, uint64_t nested_paddr, uint64_t paddr,
> + uint64_t size, int level)
> +{