#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/string.h>
#include <linux/uaccess.h>
#include <linux/set_memory.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/tsm.h>
#include <linux/sizes.h>
#include <uapi/linux/tdx-guest.h>
#include <asm/cpu_device_id.h>
#include <asm/tdx.h>
#define GET_QUOTE_BUF_SIZE …
#define GET_QUOTE_CMD_VER …
#define GET_QUOTE_SUCCESS …
#define GET_QUOTE_IN_FLIGHT …
struct tdx_quote_buf { … };
static void *quote_data;
static DEFINE_MUTEX(quote_lock);
static u32 getquote_timeout = …;
static long tdx_get_report0(struct tdx_report_req __user *req)
{ … }
static void free_quote_buf(void *buf)
{ … }
static void *alloc_quote_buf(void)
{ … }
static int wait_for_quote_completion(struct tdx_quote_buf *quote_buf, u32 timeout)
{ … }
static int tdx_report_new(struct tsm_report *report, void *data)
{ … }
static bool tdx_report_attr_visible(int n)
{ … }
static bool tdx_report_bin_attr_visible(int n)
{ … }
static long tdx_guest_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{ … }
static const struct file_operations tdx_guest_fops = …;
static struct miscdevice tdx_misc_dev = …;
static const struct x86_cpu_id tdx_guest_ids[] = …;
MODULE_DEVICE_TABLE(x86cpu, tdx_guest_ids);
static const struct tsm_ops tdx_tsm_ops = …;
static int __init tdx_guest_init(void)
{ … }
module_init(…) …;
static void __exit tdx_guest_exit(void)
{ … }
module_exit(tdx_guest_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;