linux/arch/x86/kernel/tboot.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * tboot.c: main implementation of helper functions used by kernel for
 *          runtime support of Intel(R) Trusted Execution Technology
 *
 * Copyright (c) 2006-2009, Intel Corporation
 */

#include <linux/init_task.h>
#include <linux/spinlock.h>
#include <linux/export.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/dmar.h>
#include <linux/cpu.h>
#include <linux/pfn.h>
#include <linux/mm.h>
#include <linux/tboot.h>
#include <linux/debugfs.h>

#include <asm/realmode.h>
#include <asm/processor.h>
#include <asm/bootparam.h>
#include <asm/pgalloc.h>
#include <asm/fixmap.h>
#include <asm/proto.h>
#include <asm/setup.h>
#include <asm/e820/api.h>
#include <asm/io.h>

#include "../realmode/rm/wakeup.h"

/* Global pointer to shared data; NULL means no measured launch. */
static struct tboot *tboot __read_mostly;

/* timeout for APs (in secs) to enter wait-for-SIPI state during shutdown */
#define AP_WAIT_TIMEOUT

#undef pr_fmt
#define pr_fmt(fmt)

static u8 tboot_uuid[16] __initdata =;

bool tboot_enabled(void)
{}

/* noinline to prevent gcc from warning about dereferencing constant fixaddr */
static noinline __init bool check_tboot_version(void)
{}

void __init tboot_probe(void)
{}

static pgd_t *tboot_pg_dir;
static struct mm_struct tboot_mm =;

static inline void switch_to_tboot_pt(void)
{}

static int map_tboot_page(unsigned long vaddr, unsigned long pfn,
			  pgprot_t prot)
{}

static int map_tboot_pages(unsigned long vaddr, unsigned long start_pfn,
			   unsigned long nr)
{}

static void tboot_create_trampoline(void)
{}

#ifdef CONFIG_ACPI_SLEEP

static void add_mac_region(phys_addr_t start, unsigned long size)
{}

static int tboot_setup_sleep(void)
{}

#else /* no CONFIG_ACPI_SLEEP */

static int tboot_setup_sleep(void)
{
	/* S3 shutdown requested, but S3 not supported by the kernel... */
	BUG();
	return -1;
}

#endif

void tboot_shutdown(u32 shutdown_type)
{}

static void tboot_copy_fadt(const struct acpi_table_fadt *fadt)
{}

static int tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control)
{}

static int tboot_extended_sleep(u8 sleep_state, u32 val_a, u32 val_b)
{}

static atomic_t ap_wfs_count;

static int tboot_wait_for_aps(int num_aps)
{}

static int tboot_dying_cpu(unsigned int cpu)
{}

#ifdef CONFIG_DEBUG_FS

#define TBOOT_LOG_UUID

#define TBOOT_SERIAL_LOG_ADDR
#define TBOOT_SERIAL_LOG_SIZE
#define LOG_MAX_SIZE_OFF
#define LOG_BUF_OFF

static uint8_t tboot_log_uuid[16] =;

static ssize_t tboot_log_read(struct file *file, char __user *user_buf, size_t count, loff_t *ppos)
{}

static const struct file_operations tboot_log_fops =;

#endif /* CONFIG_DEBUG_FS */

static __init int tboot_late_init(void)
{}

late_initcall(tboot_late_init);

/*
 * TXT configuration registers (offsets from TXT_{PUB, PRIV}_CONFIG_REGS_BASE)
 */

#define TXT_PUB_CONFIG_REGS_BASE
#define TXT_PRIV_CONFIG_REGS_BASE

/* # pages for each config regs space - used by fixmap */
#define NR_TXT_CONFIG_PAGES

/* offsets from pub/priv config space */
#define TXTCR_HEAP_BASE
#define TXTCR_HEAP_SIZE

#define SHA1_SIZE

struct sha1_hash {};

struct sinit_mle_data {} __packed;

struct acpi_table_header *tboot_get_dmar_table(struct acpi_table_header *dmar_tbl)
{}