On 10/2/2026 3:37 AM, Lisa Wang wrote:
> From: Sean Christopherson <[email protected]>
>
> Add a layer of indirection to x86's ucall infrastructure to allow wiring up
> a different set of {do,get}_ucall() operations for TDX VMs. TDX can't use
> port I/O (at least, not robustly), as the TDX ABI doesn't allow the guest
> to share arbitrary register state with the host on a PIO exit, and the PIO
> data payload is limited to 4 bytes, i.e. would potentially truncate the
> address of the per-ucall structure.
>
> No functional change intended, as the ops are still hardwired to the common
> x86 ucall functions.
>
> Signed-off-by: Sean Christopherson <[email protected]>
> Signed-off-by: Lisa Wang <[email protected]>
> ---
> tools/testing/selftests/kvm/include/x86/ucall.h | 6 +-----
> tools/testing/selftests/kvm/lib/x86/ucall.c | 27
> +++++++++++++++++++++++--
> 2 files changed, 26 insertions(+), 7 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/include/x86/ucall.h
> b/tools/testing/selftests/kvm/include/x86/ucall.h
> index 0e4950041e3e..3639f03a4da9 100644
> --- a/tools/testing/selftests/kvm/include/x86/ucall.h
> +++ b/tools/testing/selftests/kvm/include/x86/ucall.h
> @@ -2,12 +2,8 @@
> #ifndef SELFTEST_KVM_UCALL_H
> #define SELFTEST_KVM_UCALL_H
>
> -#include "kvm_util.h"
> +#include "linux/kvm.h"
Nit:
#include <linux/kvm.h>
[...]
> +
> +void ucall_arch_do_ucall(gva_t uc)
> +{
> + return ucall_x86_ops.do_ucall(uc);
return should be dropped.
> +}
> +
> +void *ucall_arch_get_ucall(struct kvm_vcpu *vcpu)
> +{
> + return ucall_x86_ops.get_ucall(vcpu);
> +}
>