*** HACK *** linux-headers: Update headers to pull in TDX API changes
Pull in recent TDX updates, which are not backwards compatible. It's just to make this series runnable. It will be updated by script scripts/update-linux-headers.sh once TDX support is upstreamed in linux kernel Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
This commit is contained in:
@@ -167,6 +167,92 @@ struct kvm_xen_exit {
|
||||
} u;
|
||||
};
|
||||
|
||||
/* masks for reg_mask to indicate which registers are passed. */
|
||||
#define TDX_VMCALL_REG_MASK_RBX BIT_ULL(2)
|
||||
#define TDX_VMCALL_REG_MASK_RDX BIT_ULL(3)
|
||||
#define TDX_VMCALL_REG_MASK_RSI BIT_ULL(6)
|
||||
#define TDX_VMCALL_REG_MASK_RDI BIT_ULL(7)
|
||||
#define TDX_VMCALL_REG_MASK_R8 BIT_ULL(8)
|
||||
#define TDX_VMCALL_REG_MASK_R9 BIT_ULL(9)
|
||||
#define TDX_VMCALL_REG_MASK_R10 BIT_ULL(10)
|
||||
#define TDX_VMCALL_REG_MASK_R11 BIT_ULL(11)
|
||||
#define TDX_VMCALL_REG_MASK_R12 BIT_ULL(12)
|
||||
#define TDX_VMCALL_REG_MASK_R13 BIT_ULL(13)
|
||||
#define TDX_VMCALL_REG_MASK_R14 BIT_ULL(14)
|
||||
#define TDX_VMCALL_REG_MASK_R15 BIT_ULL(15)
|
||||
|
||||
struct kvm_tdx_exit {
|
||||
#define KVM_EXIT_TDX_VMCALL 1
|
||||
__u32 type;
|
||||
__u32 pad;
|
||||
|
||||
union {
|
||||
struct kvm_tdx_vmcall {
|
||||
/*
|
||||
* RAX(bit 0), RCX(bit 1) and RSP(bit 4) are reserved.
|
||||
* RAX(bit 0): TDG.VP.VMCALL status code.
|
||||
* RCX(bit 1): bitmap for used registers.
|
||||
* RSP(bit 4): the caller stack.
|
||||
*/
|
||||
union {
|
||||
__u64 in_rcx;
|
||||
__u64 reg_mask;
|
||||
};
|
||||
|
||||
/*
|
||||
* Guest-Host-Communication Interface for TDX spec
|
||||
* defines the ABI for TDG.VP.VMCALL.
|
||||
*/
|
||||
/* Input parameters: guest -> VMM */
|
||||
union {
|
||||
__u64 in_r10;
|
||||
__u64 type;
|
||||
};
|
||||
union {
|
||||
__u64 in_r11;
|
||||
__u64 subfunction;
|
||||
};
|
||||
/*
|
||||
* Subfunction specific.
|
||||
* Registers are used in this order to pass input
|
||||
* arguments. r12=arg0, r13=arg1, etc.
|
||||
*/
|
||||
__u64 in_r12;
|
||||
__u64 in_r13;
|
||||
__u64 in_r14;
|
||||
__u64 in_r15;
|
||||
__u64 in_rbx;
|
||||
__u64 in_rdi;
|
||||
__u64 in_rsi;
|
||||
__u64 in_r8;
|
||||
__u64 in_r9;
|
||||
__u64 in_rdx;
|
||||
|
||||
/* Output parameters: VMM -> guest */
|
||||
union {
|
||||
__u64 out_r10;
|
||||
__u64 status_code;
|
||||
};
|
||||
/*
|
||||
* Subfunction specific.
|
||||
* Registers are used in this order to output return
|
||||
* values. r11=ret0, r12=ret1, etc.
|
||||
*/
|
||||
__u64 out_r11;
|
||||
__u64 out_r12;
|
||||
__u64 out_r13;
|
||||
__u64 out_r14;
|
||||
__u64 out_r15;
|
||||
__u64 out_rbx;
|
||||
__u64 out_rdi;
|
||||
__u64 out_rsi;
|
||||
__u64 out_r8;
|
||||
__u64 out_r9;
|
||||
__u64 out_rdx;
|
||||
} vmcall;
|
||||
} u;
|
||||
};
|
||||
|
||||
#define KVM_S390_GET_SKEYS_NONE 1
|
||||
#define KVM_S390_SKEYS_MAX 1048576
|
||||
|
||||
@@ -210,6 +296,7 @@ struct kvm_xen_exit {
|
||||
#define KVM_EXIT_NOTIFY 37
|
||||
#define KVM_EXIT_LOONGARCH_IOCSR 38
|
||||
#define KVM_EXIT_MEMORY_FAULT 39
|
||||
#define KVM_EXIT_TDX 40
|
||||
|
||||
/* For KVM_EXIT_INTERNAL_ERROR */
|
||||
/* Emulate instruction failed. */
|
||||
@@ -466,6 +553,8 @@ struct kvm_run {
|
||||
__u64 gpa;
|
||||
__u64 size;
|
||||
} memory_fault;
|
||||
/* KVM_EXIT_TDX_VMCALL */
|
||||
struct kvm_tdx_exit tdx;
|
||||
/* Fix the size of the union. */
|
||||
char padding[256];
|
||||
};
|
||||
@@ -1151,6 +1240,8 @@ struct kvm_ppc_resize_hpt {
|
||||
#define KVM_CAP_MEMORY_ATTRIBUTES 233
|
||||
#define KVM_CAP_GUEST_MEMFD 234
|
||||
#define KVM_CAP_VM_TYPES 235
|
||||
#define KVM_CAP_MEMORY_MAPPING 236
|
||||
#define KVM_CAP_X86_BUS_FREQUENCY_CONTROL 237
|
||||
|
||||
#ifdef KVM_CAP_IRQ_ROUTING
|
||||
|
||||
@@ -2223,4 +2314,13 @@ struct kvm_create_guest_memfd {
|
||||
__u64 reserved[6];
|
||||
};
|
||||
|
||||
#define KVM_MEMORY_MAPPING _IOWR(KVMIO, 0xd5, struct kvm_memory_mapping)
|
||||
|
||||
struct kvm_memory_mapping {
|
||||
__u64 base_gfn;
|
||||
__u64 nr_pages;
|
||||
__u64 flags;
|
||||
__u64 source;
|
||||
};
|
||||
|
||||
#endif /* __LINUX_KVM_H */
|
||||
|
||||
Reference in New Issue
Block a user