1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * tboot.h: shared data structure with tboot and kernel and functions
4 * used by kernel for runtime support of Intel(R) Trusted
7 * Copyright (c) 2006-2009, Intel Corporation
10 #ifndef _LINUX_TBOOT_H
11 #define _LINUX_TBOOT_H
13 /* these must have the values from 0-5 in this order */
15 TB_SHUTDOWN_REBOOT = 0,
23 #ifdef CONFIG_INTEL_TXT
24 #include <linux/acpi.h>
25 /* used to communicate between tboot and the launched kernel */
27 #define TB_KEY_SIZE 64 /* 512 bits */
29 #define MAX_TB_MAC_REGIONS 32
31 struct tboot_mac_region {
32 u64 start; /* must be 64 byte -aligned */
33 u32 size; /* must be 64 byte -granular */
36 /* GAS - Generic Address Structure (ACPI 2.0+) */
37 struct tboot_acpi_generic_address {
46 * combines Sx info from FADT and FACS tables per ACPI 2.0+ spec
47 * (https://uefi.org/specifications)
49 struct tboot_acpi_sleep_info {
50 struct tboot_acpi_generic_address pm1a_cnt_blk;
51 struct tboot_acpi_generic_address pm1b_cnt_blk;
52 struct tboot_acpi_generic_address pm1a_evt_blk;
53 struct tboot_acpi_generic_address pm1b_evt_blk;
58 u64 kernel_s3_resume_vector;
62 * shared memory page used for communication between tboot and kernel
72 /* version number: 5 is current */
75 /* physical addr of tb_log_t log */
79 * physical addr of entry point for tboot shutdown and
80 * type of shutdown (TB_SHUTDOWN_*) being requested
85 /* kernel-specified ACPI info for Sx shutdown */
86 struct tboot_acpi_sleep_info acpi_sinfo;
88 /* tboot location in memory (physical) */
92 /* memory regions (phys addrs) for tboot to MAC on S3 */
94 struct tboot_mac_region mac_regions[MAX_TB_MAC_REGIONS];
101 /* symmetric key for use by kernel; will be encrypted on S3 */
102 u8 s3_key[TB_KEY_SIZE];
109 /* used to 4byte-align num_in_wfs */
110 u8 reserved_align[3];
112 /* number of processors in wait-for-SIPI */
117 * UUID for tboot data struct to facilitate matching
118 * defined as {663C8DFF-E8B3-4b82-AABF-19EA4D057A08} by tboot, which is
119 * represented as {} in the char array used here
121 #define TBOOT_UUID {0xff, 0x8d, 0x3c, 0x66, 0xb3, 0xe8, 0x82, 0x4b, 0xbf,\
122 0xaa, 0x19, 0xea, 0x4d, 0x5, 0x7a, 0x8}
124 bool tboot_enabled(void);
125 extern void tboot_probe(void);
126 extern void tboot_shutdown(u32 shutdown_type);
127 extern struct acpi_table_header *tboot_get_dmar_table(
128 struct acpi_table_header *dmar_tbl);
132 #define tboot_enabled() 0
133 #define tboot_probe() do { } while (0)
134 #define tboot_shutdown(shutdown_type) do { } while (0)
135 #define tboot_sleep(sleep_state, pm1a_control, pm1b_control) \
137 #define tboot_get_dmar_table(dmar_tbl) (dmar_tbl)
139 #endif /* !CONFIG_INTEL_TXT */
141 #endif /* _LINUX_TBOOT_H */