Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools headers UAPI: Sync kvm header with the kernel sources

To pick the changes in:

c9c1e20b4c7d60fa ("KVM: x86: Introduce Intel specific quirk KVM_X86_QUIRK_IGNORE_GUEST_PAT")
012426d6f59cab21 ("KVM: TDX: Finalize VM initialization")
c846b451d3c5d4ba ("KVM: TDX: Add an ioctl to create initial guest memory")
488808e682e72bdb ("KVM: x86: Introduce KVM_TDX_GET_CPUID")
a50f673f25e0ba2b ("KVM: TDX: Do TDX specific vcpu initialization")
0186dd29a251866d ("KVM: TDX: add ioctl to initialize VM with TDX specific parameters")
61bb28279623b636 ("KVM: TDX: Get system-wide info about TDX module on initialization")
b2aaf38ced6905b8 ("KVM: TDX: Add place holder for TDX VM specific mem_enc_op ioctl")

This addresses these perf build warnings:

Warning: Kernel ABI header differences:
diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h

Please see tools/include/uapi/README for further details.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Isaku Yamahata <isaku.yamahata@intel.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: Yan Zhao <yan.y.zhao@intel.com>
Link: https://lore.kernel.org/r/aErqLPktXIzGyS-m@x1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+71
+71
tools/arch/x86/include/uapi/asm/kvm.h
··· 441 441 #define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS (1 << 6) 442 442 #define KVM_X86_QUIRK_SLOT_ZAP_ALL (1 << 7) 443 443 #define KVM_X86_QUIRK_STUFF_FEATURE_MSRS (1 << 8) 444 + #define KVM_X86_QUIRK_IGNORE_GUEST_PAT (1 << 9) 444 445 445 446 #define KVM_STATE_NESTED_FORMAT_VMX 0 446 447 #define KVM_STATE_NESTED_FORMAT_SVM 1 ··· 931 930 #define KVM_X86_SEV_ES_VM 3 932 931 #define KVM_X86_SNP_VM 4 933 932 #define KVM_X86_TDX_VM 5 933 + 934 + /* Trust Domain eXtension sub-ioctl() commands. */ 935 + enum kvm_tdx_cmd_id { 936 + KVM_TDX_CAPABILITIES = 0, 937 + KVM_TDX_INIT_VM, 938 + KVM_TDX_INIT_VCPU, 939 + KVM_TDX_INIT_MEM_REGION, 940 + KVM_TDX_FINALIZE_VM, 941 + KVM_TDX_GET_CPUID, 942 + 943 + KVM_TDX_CMD_NR_MAX, 944 + }; 945 + 946 + struct kvm_tdx_cmd { 947 + /* enum kvm_tdx_cmd_id */ 948 + __u32 id; 949 + /* flags for sub-commend. If sub-command doesn't use this, set zero. */ 950 + __u32 flags; 951 + /* 952 + * data for each sub-command. An immediate or a pointer to the actual 953 + * data in process virtual address. If sub-command doesn't use it, 954 + * set zero. 955 + */ 956 + __u64 data; 957 + /* 958 + * Auxiliary error code. The sub-command may return TDX SEAMCALL 959 + * status code in addition to -Exxx. 960 + */ 961 + __u64 hw_error; 962 + }; 963 + 964 + struct kvm_tdx_capabilities { 965 + __u64 supported_attrs; 966 + __u64 supported_xfam; 967 + __u64 reserved[254]; 968 + 969 + /* Configurable CPUID bits for userspace */ 970 + struct kvm_cpuid2 cpuid; 971 + }; 972 + 973 + struct kvm_tdx_init_vm { 974 + __u64 attributes; 975 + __u64 xfam; 976 + __u64 mrconfigid[6]; /* sha384 digest */ 977 + __u64 mrowner[6]; /* sha384 digest */ 978 + __u64 mrownerconfig[6]; /* sha384 digest */ 979 + 980 + /* The total space for TD_PARAMS before the CPUIDs is 256 bytes */ 981 + __u64 reserved[12]; 982 + 983 + /* 984 + * Call KVM_TDX_INIT_VM before vcpu creation, thus before 985 + * KVM_SET_CPUID2. 986 + * This configuration supersedes KVM_SET_CPUID2s for VCPUs because the 987 + * TDX module directly virtualizes those CPUIDs without VMM. The user 988 + * space VMM, e.g. qemu, should make KVM_SET_CPUID2 consistent with 989 + * those values. If it doesn't, KVM may have wrong idea of vCPUIDs of 990 + * the guest, and KVM may wrongly emulate CPUIDs or MSRs that the TDX 991 + * module doesn't virtualize. 992 + */ 993 + struct kvm_cpuid2 cpuid; 994 + }; 995 + 996 + #define KVM_TDX_MEASURE_MEMORY_REGION _BITULL(0) 997 + 998 + struct kvm_tdx_init_mem_region { 999 + __u64 source_addr; 1000 + __u64 gpa; 1001 + __u64 nr_pages; 1002 + }; 934 1003 935 1004 #endif /* _ASM_X86_KVM_H */