| Server IP : 112.74.42.100 / Your IP : 216.73.216.142 Web Server : nginx/1.20.2 System : Linux iZwz96lx4pjqiy84w4hni7Z 5.10.134-17.3.al8.x86_64 #1 SMP Thu Oct 31 14:29:57 CST 2024 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/include/linux/ |
Upload File : |
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Userspace interface for TDX guest driver
*
* Copyright (C) 2022 Intel Corporation
*/
#ifndef _LINUX_TDX_GUEST_H_
#define _LINUX_TDX_GUEST_H_
#include <linux/ioctl.h>
#include <linux/types.h>
/* Length of the REPORTDATA used in TDG.MR.REPORT TDCALL */
#define TDX_REPORTDATA_LEN 64
/* Length of TDREPORT used in TDG.MR.REPORT TDCALL */
#define TDX_REPORT_LEN 1024
/* Length of RTMR extend data */
#define TDX_EXTEND_RTMR_DATA_LEN 48
/**
* struct tdx_report_req - Request struct for TDX_CMD_GET_REPORT0 IOCTL.
*
* @reportdata: User buffer with REPORTDATA to be included into TDREPORT.
* Typically it can be some nonce provided by attestation
* service, so the generated TDREPORT can be uniquely verified.
* @tdreport: User buffer to store TDREPORT output from TDCALL[TDG.MR.REPORT].
*/
struct tdx_report_req {
__u8 reportdata[TDX_REPORTDATA_LEN];
__u8 tdreport[TDX_REPORT_LEN];
};
/*
* TDX_CMD_GET_REPORT0 - Get TDREPORT0 (a.k.a. TDREPORT subtype 0) using
* TDCALL[TDG.MR.REPORT]
*
* Return 0 on success, -EIO on TDCALL execution failure, and
* standard errno on other general error cases.
*/
#define TDX_CMD_GET_REPORT0 _IOWR('T', 1, struct tdx_report_req)
/**
* struct tdx_extend_rtmr_req - Request struct for TDX_CMD_EXTEND_RTMR IOCTL.
*
* @data: User buffer with RTMR extend data.
* @index: Index of RTMR register to be extended. RTMR0 and RTMR1 registers
* are used by kernel and BIOS and hence are not allowed to be extended
* by the userspace.
*/
struct tdx_extend_rtmr_req {
__u8 data[TDX_EXTEND_RTMR_DATA_LEN];
__u8 index;
};
/*
* TDX_CMD_EXTEND_RTMR - Extend RTMR registers with user data using
* TDG.MR.RTMR.EXTEND TDCALL.
*
* Returns 0 on success, and standard errono on other failures.
*/
#define TDX_CMD_EXTEND_RTMR _IOR('T', 3, struct tdx_extend_rtmr_req)
/* TD Quote status codes */
#define GET_QUOTE_SUCCESS 0
#define GET_QUOTE_IN_FLIGHT 0xffffffffffffffff
#define GET_QUOTE_ERROR 0x8000000000000000
#define GET_QUOTE_SERVICE_UNAVAILABLE 0x8000000000000001
/*
* Format of Quote data header. More details can be found in TDX
* Guest-Host Communication Interface (GHCI) for Intel TDX 1.0,
* section titled "TDG.VP.VMCALL<GetQuote>"
*/
struct tdx_quote_hdr {
/* Quote version, filled by TD */
__u64 version;
/* Status code of Quote request, filled by VMM */
__u64 status;
/* Length of TDREPORT, filled by TD */
__u32 in_len;
/* Length of Quote, filled by VMM */
__u32 out_len;
/* Actual Quote data or TDREPORT on input */
__u64 data[0];
};
/* struct tdx_quote_req: Request to generate TD Quote using TDREPORT
*
* @buf : Pass user data that includes TDREPORT as input. Upon
* successful completion of IOCTL, output is copied
* back to the same buffer.
* @len : Length of the Quote buffer.
*/
struct tdx_quote_req {
__u64 buf;
__u64 len;
};
/*
* TDX_CMD_GET_QUOTE - Get TD Quote from QE/QGS using GetQuote
* TDVMCALL.
*
* Returns 0 on success, -EINTR for interrupted request, and
* standard errono on other failures.
*/
#define TDX_CMD_GET_QUOTE _IOR('T', 4, struct tdx_quote_req)
#endif /* _LINUX_TDX_GUEST_H_ */