From: Paolo Bonzini Date: Wed, 12 Mar 2025 11:41:52 +0000 (-0400) Subject: Merge branch 'kvm-tdx-userspace-exit' into HEAD X-Git-Tag: v6.16-rc1~129^2~6^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4d2dc9a26765131641c545549ad5476ae7f4d611;p=thirdparty%2Fkernel%2Flinux.git Merge branch 'kvm-tdx-userspace-exit' into HEAD Introduces support for VM exits that are forwarded the host VMM in userspace. These are initiated from the TDCALL exit code; although these userspace exits have the same TDX exit code, they result in several different types of exits to userspace. When a guest TD issues a TDVMCALL, it exits to VMM with a new exit reason. The arguments from the guest TD and return values from the VMM are passed through the guest registers. The ABI details for the guest TD hypercalls are specified in the TDX GHCI specification. There are two types of hypercalls defined in the GHCI specification: - Standard TDVMCALLs: When input of R10 from guest TD is set to 0, it indicates that the TDVMCALL sub-function used in R11 is defined in GHCI specification. - Vendor-Specific TDVMCALLs: When input of R10 from guest TD is non-zero, it indicates a vendor-specific TDVMCALL. KVM hypercalls from the guest follow this interface, using R10 as KVM hypercall number and R11-R14 as 4 arguments. The error code returned in R10. This series includes basic standard TDVMCALLs that map to existing eixt reasons: - TDG.VP.VMCALL reuses exit reason KVM_EXIT_HYPERCALL with the hypercall number KVM_HC_MAP_GPA_RANGE. - TDG.VP.VMCALL reuses exit reason KVM_EXIT_SYSTEM_EVENT with a new event type KVM_SYSTEM_EVENT_TDX_FATAL. - TDG.VP.VMCALL reuses exit reason KVM_EXIT_IO. - TDG.VP.VMCALL<#VE.RequestMMIO> reuses exit reason KVM_EXIT_MMIO. Notably, handling for TDG.VP.VMCALL and TDG.VP.VMCALL is not included yet. --- 4d2dc9a26765131641c545549ad5476ae7f4d611